Commit f8b72674 authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

Naming consistency and further small cleanups to frames.h

R=mstarzinger@chromium.org

Bug: 
Change-Id: Ia416acd8c12a3c8e3fdfabc56a4cd31cb946c88c
Reviewed-on: https://chromium-review.googlesource.com/599949
Commit-Queue: Ben Titzer <titzer@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47135}
parent 2751ca49
...@@ -1078,7 +1078,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { ...@@ -1078,7 +1078,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// r2: receiver // r2: receiver
// r3: argc // r3: argc
// r4: argv // r4: argv
if (type() == StackFrame::ENTRY_CONSTRUCT) { if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline), __ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else { } else {
......
...@@ -1148,7 +1148,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { ...@@ -1148,7 +1148,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// x3: argc. // x3: argc.
// x4: argv. // x4: argv.
if (type() == StackFrame::ENTRY_CONSTRUCT) { if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline), __ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else { } else {
......
...@@ -969,7 +969,7 @@ class JSEntryStub : public PlatformCodeStub { ...@@ -969,7 +969,7 @@ class JSEntryStub : public PlatformCodeStub {
public: public:
JSEntryStub(Isolate* isolate, StackFrame::Type type) JSEntryStub(Isolate* isolate, StackFrame::Type type)
: PlatformCodeStub(isolate) { : PlatformCodeStub(isolate) {
DCHECK(type == StackFrame::ENTRY || type == StackFrame::ENTRY_CONSTRUCT); DCHECK(type == StackFrame::ENTRY || type == StackFrame::CONSTRUCT_ENTRY);
minor_key_ = StackFrameTypeBits::encode(type); minor_key_ = StackFrameTypeBits::encode(type);
} }
......
...@@ -67,12 +67,9 @@ inline EntryFrame::EntryFrame(StackFrameIteratorBase* iterator) ...@@ -67,12 +67,9 @@ inline EntryFrame::EntryFrame(StackFrameIteratorBase* iterator)
: StackFrame(iterator) { : StackFrame(iterator) {
} }
inline ConstructEntryFrame::ConstructEntryFrame(
inline EntryConstructFrame::EntryConstructFrame(
StackFrameIteratorBase* iterator) StackFrameIteratorBase* iterator)
: EntryFrame(iterator) { : EntryFrame(iterator) {}
}
inline ExitFrame::ExitFrame(StackFrameIteratorBase* iterator) inline ExitFrame::ExitFrame(StackFrameIteratorBase* iterator)
: StackFrame(iterator) { : StackFrame(iterator) {
......
...@@ -322,7 +322,7 @@ bool SafeStackFrameIterator::IsValidFrame(StackFrame* frame) const { ...@@ -322,7 +322,7 @@ bool SafeStackFrameIterator::IsValidFrame(StackFrame* frame) const {
bool SafeStackFrameIterator::IsValidCaller(StackFrame* frame) { bool SafeStackFrameIterator::IsValidCaller(StackFrame* frame) {
StackFrame::State state; StackFrame::State state;
if (frame->is_entry() || frame->is_entry_construct()) { if (frame->is_entry() || frame->is_construct_entry()) {
// See EntryFrame::GetCallerState. It computes the caller FP address // See EntryFrame::GetCallerState. It computes the caller FP address
// and calls ExitFrame::GetStateForFramePointer on it. We need to be // and calls ExitFrame::GetStateForFramePointer on it. We need to be
// sure that caller FP address is valid. // sure that caller FP address is valid.
...@@ -513,7 +513,7 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator, ...@@ -513,7 +513,7 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
StackFrame::Type candidate = StackFrame::MarkerToType(marker); StackFrame::Type candidate = StackFrame::MarkerToType(marker);
switch (candidate) { switch (candidate) {
case ENTRY: case ENTRY:
case ENTRY_CONSTRUCT: case CONSTRUCT_ENTRY:
case EXIT: case EXIT:
case BUILTIN_CONTINUATION: case BUILTIN_CONTINUATION:
case JAVA_SCRIPT_BUILTIN_CONTINUATION: case JAVA_SCRIPT_BUILTIN_CONTINUATION:
...@@ -579,8 +579,7 @@ StackFrame::Type EntryFrame::GetCallerState(State* state) const { ...@@ -579,8 +579,7 @@ StackFrame::Type EntryFrame::GetCallerState(State* state) const {
return ExitFrame::GetStateForFramePointer(fp, state); return ExitFrame::GetStateForFramePointer(fp, state);
} }
Code* ConstructEntryFrame::unchecked_code() const {
Code* EntryConstructFrame::unchecked_code() const {
return isolate()->heap()->js_construct_entry_code(); return isolate()->heap()->js_construct_entry_code();
} }
...@@ -699,6 +698,13 @@ int BuiltinExitFrame::ComputeParametersCount() const { ...@@ -699,6 +698,13 @@ int BuiltinExitFrame::ComputeParametersCount() const {
return argc; return argc;
} }
namespace {
void PrintIndex(StringStream* accumulator, StackFrame::PrintMode mode,
int index) {
accumulator->Add((mode == StackFrame::OVERVIEW) ? "%5d: " : "[%d]: ", index);
}
} // namespace
void BuiltinExitFrame::Print(StringStream* accumulator, PrintMode mode, void BuiltinExitFrame::Print(StringStream* accumulator, PrintMode mode,
int index) const { int index) const {
DisallowHeapAllocation no_gc; DisallowHeapAllocation no_gc;
...@@ -812,7 +818,7 @@ void StandardFrame::IterateCompiledFrame(RootVisitor* v) const { ...@@ -812,7 +818,7 @@ void StandardFrame::IterateCompiledFrame(RootVisitor* v) const {
StackFrame::Type candidate = StackFrame::MarkerToType(marker); StackFrame::Type candidate = StackFrame::MarkerToType(marker);
switch (candidate) { switch (candidate) {
case ENTRY: case ENTRY:
case ENTRY_CONSTRUCT: case CONSTRUCT_ENTRY:
case EXIT: case EXIT:
case BUILTIN_CONTINUATION: case BUILTIN_CONTINUATION:
case JAVA_SCRIPT_BUILTIN_CONTINUATION: case JAVA_SCRIPT_BUILTIN_CONTINUATION:
...@@ -1685,12 +1691,6 @@ Code* InternalFrame::unchecked_code() const { ...@@ -1685,12 +1691,6 @@ Code* InternalFrame::unchecked_code() const {
} }
void StackFrame::PrintIndex(StringStream* accumulator,
PrintMode mode,
int index) {
accumulator->Add((mode == OVERVIEW) ? "%5d: " : "[%d]: ", index);
}
void WasmCompiledFrame::Print(StringStream* accumulator, PrintMode mode, void WasmCompiledFrame::Print(StringStream* accumulator, PrintMode mode,
int index) const { int index) const {
PrintIndex(accumulator, mode, index); PrintIndex(accumulator, mode, index);
......
...@@ -86,7 +86,7 @@ class StackHandler BASE_EMBEDDED { ...@@ -86,7 +86,7 @@ class StackHandler BASE_EMBEDDED {
#define STACK_FRAME_TYPE_LIST(V) \ #define STACK_FRAME_TYPE_LIST(V) \
V(ENTRY, EntryFrame) \ V(ENTRY, EntryFrame) \
V(ENTRY_CONSTRUCT, EntryConstructFrame) \ V(CONSTRUCT_ENTRY, ConstructEntryFrame) \
V(EXIT, ExitFrame) \ V(EXIT, ExitFrame) \
V(JAVA_SCRIPT, JavaScriptFrame) \ V(JAVA_SCRIPT, JavaScriptFrame) \
V(OPTIMIZED, OptimizedFrame) \ V(OPTIMIZED, OptimizedFrame) \
...@@ -104,7 +104,6 @@ class StackHandler BASE_EMBEDDED { ...@@ -104,7 +104,6 @@ class StackHandler BASE_EMBEDDED {
V(BUILTIN, BuiltinFrame) \ V(BUILTIN, BuiltinFrame) \
V(BUILTIN_EXIT, BuiltinExitFrame) V(BUILTIN_EXIT, BuiltinExitFrame)
// Abstract base class for all stack frames. // Abstract base class for all stack frames.
class StackFrame BASE_EMBEDDED { class StackFrame BASE_EMBEDDED {
public: public:
...@@ -193,7 +192,7 @@ class StackFrame BASE_EMBEDDED { ...@@ -193,7 +192,7 @@ class StackFrame BASE_EMBEDDED {
// Type testers. // Type testers.
bool is_entry() const { return type() == ENTRY; } bool is_entry() const { return type() == ENTRY; }
bool is_entry_construct() const { return type() == ENTRY_CONSTRUCT; } bool is_construct_entry() const { return type() == CONSTRUCT_ENTRY; }
bool is_exit() const { return type() == EXIT; } bool is_exit() const { return type() == EXIT; }
bool is_optimized() const { return type() == OPTIMIZED; } bool is_optimized() const { return type() == OPTIMIZED; }
bool is_interpreted() const { return type() == INTERPRETED; } bool is_interpreted() const { return type() == INTERPRETED; }
...@@ -250,9 +249,6 @@ class StackFrame BASE_EMBEDDED { ...@@ -250,9 +249,6 @@ class StackFrame BASE_EMBEDDED {
virtual void SetCallerFp(Address caller_fp) = 0; virtual void SetCallerFp(Address caller_fp) = 0;
// Manually changes value of fp in this object.
void UpdateFp(Address fp) { state_.fp = fp; }
Address* pc_address() const { return state_.pc_address; } Address* pc_address() const { return state_.pc_address; }
Address* constant_pool_address() const { Address* constant_pool_address() const {
...@@ -316,11 +312,6 @@ class StackFrame BASE_EMBEDDED { ...@@ -316,11 +312,6 @@ class StackFrame BASE_EMBEDDED {
// Compute the stack pointer for the calling frame. // Compute the stack pointer for the calling frame.
virtual Address GetCallerStackPointer() const = 0; virtual Address GetCallerStackPointer() const = 0;
// Printing support.
static void PrintIndex(StringStream* accumulator,
PrintMode mode,
int index);
// Compute the stack frame type for the given state. // Compute the stack frame type for the given state.
static Type ComputeType(const StackFrameIteratorBase* iterator, State* state); static Type ComputeType(const StackFrameIteratorBase* iterator, State* state);
...@@ -381,20 +372,19 @@ class EntryFrame: public StackFrame { ...@@ -381,20 +372,19 @@ class EntryFrame: public StackFrame {
friend class StackFrameIteratorBase; friend class StackFrameIteratorBase;
}; };
class ConstructEntryFrame : public EntryFrame {
class EntryConstructFrame: public EntryFrame {
public: public:
Type type() const override { return ENTRY_CONSTRUCT; } Type type() const override { return CONSTRUCT_ENTRY; }
Code* unchecked_code() const override; Code* unchecked_code() const override;
static EntryConstructFrame* cast(StackFrame* frame) { static ConstructEntryFrame* cast(StackFrame* frame) {
DCHECK(frame->is_entry_construct()); DCHECK(frame->is_construct_entry());
return static_cast<EntryConstructFrame*>(frame); return static_cast<ConstructEntryFrame*>(frame);
} }
protected: protected:
inline explicit EntryConstructFrame(StackFrameIteratorBase* iterator); inline explicit ConstructEntryFrame(StackFrameIteratorBase* iterator);
private: private:
friend class StackFrameIteratorBase; friend class StackFrameIteratorBase;
......
...@@ -2769,7 +2769,7 @@ void Heap::CreateJSEntryStub() { ...@@ -2769,7 +2769,7 @@ void Heap::CreateJSEntryStub() {
void Heap::CreateJSConstructEntryStub() { void Heap::CreateJSConstructEntryStub() {
JSEntryStub stub(isolate(), StackFrame::ENTRY_CONSTRUCT); JSEntryStub stub(isolate(), StackFrame::CONSTRUCT_ENTRY);
set_js_construct_entry_code(*stub.GetCode()); set_js_construct_entry_code(*stub.GetCode());
} }
......
...@@ -1155,7 +1155,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { ...@@ -1155,7 +1155,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// pop the faked function when we return. Notice that we cannot store a // pop the faked function when we return. Notice that we cannot store a
// reference to the trampoline code directly in this stub, because the // reference to the trampoline code directly in this stub, because the
// builtin stubs may not have been generated yet. // builtin stubs may not have been generated yet.
if (type() == StackFrame::ENTRY_CONSTRUCT) { if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline), __ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else { } else {
......
...@@ -1205,7 +1205,7 @@ Object* Isolate::UnwindAndFindHandler() { ...@@ -1205,7 +1205,7 @@ Object* Isolate::UnwindAndFindHandler() {
switch (frame->type()) { switch (frame->type()) {
case StackFrame::ENTRY: case StackFrame::ENTRY:
case StackFrame::ENTRY_CONSTRUCT: { case StackFrame::CONSTRUCT_ENTRY: {
// For JSEntryStub frames we always have a handler. // For JSEntryStub frames we always have a handler.
StackHandler* handler = frame->top_handler(); StackHandler* handler = frame->top_handler();
...@@ -1436,7 +1436,7 @@ Isolate::CatchType Isolate::PredictExceptionCatcher() { ...@@ -1436,7 +1436,7 @@ Isolate::CatchType Isolate::PredictExceptionCatcher() {
switch (frame->type()) { switch (frame->type()) {
case StackFrame::ENTRY: case StackFrame::ENTRY:
case StackFrame::ENTRY_CONSTRUCT: { case StackFrame::CONSTRUCT_ENTRY: {
Address entry_handler = frame->top_handler()->next()->address(); Address entry_handler = frame->top_handler()->next()->address();
// The exception has been externally caught if and only if there is an // The exception has been externally caught if and only if there is an
// external handler which is on top of the top-most JS_ENTRY handler. // external handler which is on top of the top-most JS_ENTRY handler.
......
...@@ -1200,7 +1200,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { ...@@ -1200,7 +1200,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// 4 args slots // 4 args slots
// args // args
if (type() == StackFrame::ENTRY_CONSTRUCT) { if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate, JSConstructEntryTrampoline), __ Call(BUILTIN_CODE(isolate, JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else { } else {
......
...@@ -1197,7 +1197,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { ...@@ -1197,7 +1197,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// [ O32: 4 args slots] // [ O32: 4 args slots]
// args // args
if (type() == StackFrame::ENTRY_CONSTRUCT) { if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate, JSConstructEntryTrampoline), __ Call(BUILTIN_CODE(isolate, JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else { } else {
......
...@@ -1144,7 +1144,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { ...@@ -1144,7 +1144,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// r5: receiver // r5: receiver
// r6: argc // r6: argc
// r7: argv // r7: argv
if (type() == StackFrame::ENTRY_CONSTRUCT) { if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline), __ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else { } else {
......
...@@ -1117,7 +1117,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { ...@@ -1117,7 +1117,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// r4: receiver // r4: receiver
// r5: argc // r5: argc
// r6: argv // r6: argv
if (type() == StackFrame::ENTRY_CONSTRUCT) { if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline), __ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else { } else {
......
...@@ -1093,7 +1093,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) { ...@@ -1093,7 +1093,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// external reference instead of inlining the call target address directly // external reference instead of inlining the call target address directly
// in the code, because the builtin stubs may not have been generated yet // in the code, because the builtin stubs may not have been generated yet
// at the time this code is generated. // at the time this code is generated.
if (type() == StackFrame::ENTRY_CONSTRUCT) { if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline), __ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET); RelocInfo::CODE_TARGET);
} else { } else {
......
...@@ -320,7 +320,7 @@ KNOWN_OBJECTS = { ...@@ -320,7 +320,7 @@ KNOWN_OBJECTS = {
# List of known V8 Frame Markers. # List of known V8 Frame Markers.
FRAME_MARKERS = ( FRAME_MARKERS = (
"ENTRY", "ENTRY",
"ENTRY_CONSTRUCT", "CONSTRUCT_ENTRY",
"EXIT", "EXIT",
"JAVA_SCRIPT", "JAVA_SCRIPT",
"OPTIMIZED", "OPTIMIZED",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment