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) {
// r2: receiver
// r3: argc
// r4: argv
if (type() == StackFrame::ENTRY_CONSTRUCT) {
if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET);
} else {
......
......@@ -1148,7 +1148,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// x3: argc.
// x4: argv.
if (type() == StackFrame::ENTRY_CONSTRUCT) {
if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET);
} else {
......
......@@ -969,7 +969,7 @@ class JSEntryStub : public PlatformCodeStub {
public:
JSEntryStub(Isolate* isolate, StackFrame::Type type)
: PlatformCodeStub(isolate) {
DCHECK(type == StackFrame::ENTRY || type == StackFrame::ENTRY_CONSTRUCT);
DCHECK(type == StackFrame::ENTRY || type == StackFrame::CONSTRUCT_ENTRY);
minor_key_ = StackFrameTypeBits::encode(type);
}
......
......@@ -67,12 +67,9 @@ inline EntryFrame::EntryFrame(StackFrameIteratorBase* iterator)
: StackFrame(iterator) {
}
inline EntryConstructFrame::EntryConstructFrame(
inline ConstructEntryFrame::ConstructEntryFrame(
StackFrameIteratorBase* iterator)
: EntryFrame(iterator) {
}
: EntryFrame(iterator) {}
inline ExitFrame::ExitFrame(StackFrameIteratorBase* iterator)
: StackFrame(iterator) {
......
......@@ -322,7 +322,7 @@ bool SafeStackFrameIterator::IsValidFrame(StackFrame* frame) const {
bool SafeStackFrameIterator::IsValidCaller(StackFrame* frame) {
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
// and calls ExitFrame::GetStateForFramePointer on it. We need to be
// sure that caller FP address is valid.
......@@ -513,7 +513,7 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
StackFrame::Type candidate = StackFrame::MarkerToType(marker);
switch (candidate) {
case ENTRY:
case ENTRY_CONSTRUCT:
case CONSTRUCT_ENTRY:
case EXIT:
case BUILTIN_CONTINUATION:
case JAVA_SCRIPT_BUILTIN_CONTINUATION:
......@@ -579,8 +579,7 @@ StackFrame::Type EntryFrame::GetCallerState(State* state) const {
return ExitFrame::GetStateForFramePointer(fp, state);
}
Code* EntryConstructFrame::unchecked_code() const {
Code* ConstructEntryFrame::unchecked_code() const {
return isolate()->heap()->js_construct_entry_code();
}
......@@ -699,6 +698,13 @@ int BuiltinExitFrame::ComputeParametersCount() const {
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,
int index) const {
DisallowHeapAllocation no_gc;
......@@ -812,7 +818,7 @@ void StandardFrame::IterateCompiledFrame(RootVisitor* v) const {
StackFrame::Type candidate = StackFrame::MarkerToType(marker);
switch (candidate) {
case ENTRY:
case ENTRY_CONSTRUCT:
case CONSTRUCT_ENTRY:
case EXIT:
case BUILTIN_CONTINUATION:
case JAVA_SCRIPT_BUILTIN_CONTINUATION:
......@@ -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,
int index) const {
PrintIndex(accumulator, mode, index);
......
......@@ -86,7 +86,7 @@ class StackHandler BASE_EMBEDDED {
#define STACK_FRAME_TYPE_LIST(V) \
V(ENTRY, EntryFrame) \
V(ENTRY_CONSTRUCT, EntryConstructFrame) \
V(CONSTRUCT_ENTRY, ConstructEntryFrame) \
V(EXIT, ExitFrame) \
V(JAVA_SCRIPT, JavaScriptFrame) \
V(OPTIMIZED, OptimizedFrame) \
......@@ -104,7 +104,6 @@ class StackHandler BASE_EMBEDDED {
V(BUILTIN, BuiltinFrame) \
V(BUILTIN_EXIT, BuiltinExitFrame)
// Abstract base class for all stack frames.
class StackFrame BASE_EMBEDDED {
public:
......@@ -193,7 +192,7 @@ class StackFrame BASE_EMBEDDED {
// Type testers.
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_optimized() const { return type() == OPTIMIZED; }
bool is_interpreted() const { return type() == INTERPRETED; }
......@@ -250,9 +249,6 @@ class StackFrame BASE_EMBEDDED {
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* constant_pool_address() const {
......@@ -316,11 +312,6 @@ class StackFrame BASE_EMBEDDED {
// Compute the stack pointer for the calling frame.
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.
static Type ComputeType(const StackFrameIteratorBase* iterator, State* state);
......@@ -381,20 +372,19 @@ class EntryFrame: public StackFrame {
friend class StackFrameIteratorBase;
};
class EntryConstructFrame: public EntryFrame {
class ConstructEntryFrame : public EntryFrame {
public:
Type type() const override { return ENTRY_CONSTRUCT; }
Type type() const override { return CONSTRUCT_ENTRY; }
Code* unchecked_code() const override;
static EntryConstructFrame* cast(StackFrame* frame) {
DCHECK(frame->is_entry_construct());
return static_cast<EntryConstructFrame*>(frame);
static ConstructEntryFrame* cast(StackFrame* frame) {
DCHECK(frame->is_construct_entry());
return static_cast<ConstructEntryFrame*>(frame);
}
protected:
inline explicit EntryConstructFrame(StackFrameIteratorBase* iterator);
inline explicit ConstructEntryFrame(StackFrameIteratorBase* iterator);
private:
friend class StackFrameIteratorBase;
......
......@@ -2769,7 +2769,7 @@ void Heap::CreateJSEntryStub() {
void Heap::CreateJSConstructEntryStub() {
JSEntryStub stub(isolate(), StackFrame::ENTRY_CONSTRUCT);
JSEntryStub stub(isolate(), StackFrame::CONSTRUCT_ENTRY);
set_js_construct_entry_code(*stub.GetCode());
}
......
......@@ -1155,7 +1155,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// pop the faked function when we return. Notice that we cannot store a
// reference to the trampoline code directly in this stub, because the
// builtin stubs may not have been generated yet.
if (type() == StackFrame::ENTRY_CONSTRUCT) {
if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET);
} else {
......
......@@ -1205,7 +1205,7 @@ Object* Isolate::UnwindAndFindHandler() {
switch (frame->type()) {
case StackFrame::ENTRY:
case StackFrame::ENTRY_CONSTRUCT: {
case StackFrame::CONSTRUCT_ENTRY: {
// For JSEntryStub frames we always have a handler.
StackHandler* handler = frame->top_handler();
......@@ -1436,7 +1436,7 @@ Isolate::CatchType Isolate::PredictExceptionCatcher() {
switch (frame->type()) {
case StackFrame::ENTRY:
case StackFrame::ENTRY_CONSTRUCT: {
case StackFrame::CONSTRUCT_ENTRY: {
Address entry_handler = frame->top_handler()->next()->address();
// 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.
......
......@@ -1200,7 +1200,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// 4 args slots
// args
if (type() == StackFrame::ENTRY_CONSTRUCT) {
if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate, JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET);
} else {
......
......@@ -1197,7 +1197,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// [ O32: 4 args slots]
// args
if (type() == StackFrame::ENTRY_CONSTRUCT) {
if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate, JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET);
} else {
......
......@@ -1144,7 +1144,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// r5: receiver
// r6: argc
// r7: argv
if (type() == StackFrame::ENTRY_CONSTRUCT) {
if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET);
} else {
......
......@@ -1117,7 +1117,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// r4: receiver
// r5: argc
// r6: argv
if (type() == StackFrame::ENTRY_CONSTRUCT) {
if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET);
} else {
......
......@@ -1093,7 +1093,7 @@ void JSEntryStub::Generate(MacroAssembler* masm) {
// external reference instead of inlining the call target address directly
// in the code, because the builtin stubs may not have been generated yet
// at the time this code is generated.
if (type() == StackFrame::ENTRY_CONSTRUCT) {
if (type() == StackFrame::CONSTRUCT_ENTRY) {
__ Call(BUILTIN_CODE(isolate(), JSConstructEntryTrampoline),
RelocInfo::CODE_TARGET);
} else {
......
......@@ -320,7 +320,7 @@ KNOWN_OBJECTS = {
# List of known V8 Frame Markers.
FRAME_MARKERS = (
"ENTRY",
"ENTRY_CONSTRUCT",
"CONSTRUCT_ENTRY",
"EXIT",
"JAVA_SCRIPT",
"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