Make JavaScriptFrame pure virtual.
Bug: v8:6409 Change-Id: I23b5c20022dcda5f46489596b3de4fb69be7e568 Reviewed-on: https://chromium-review.googlesource.com/660539 Commit-Queue: Michael Stanton <mvstanton@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#48037}
This commit is contained in:
parent
eeebbbcf7f
commit
c5295b0d71
@ -720,7 +720,7 @@ static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) {
|
||||
FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset));
|
||||
|
||||
// Leave the frame (also dropping the register file).
|
||||
__ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
||||
__ LeaveFrame(StackFrame::INTERPRETED);
|
||||
|
||||
// Drop receiver + arguments.
|
||||
__ add(sp, sp, args_count, LeaveCC);
|
||||
|
@ -727,7 +727,7 @@ static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) {
|
||||
FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset));
|
||||
|
||||
// Leave the frame (also dropping the register file).
|
||||
__ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
||||
__ LeaveFrame(StackFrame::INTERPRETED);
|
||||
|
||||
// Drop receiver + arguments.
|
||||
__ Drop(args_count, 1);
|
||||
|
@ -701,7 +701,7 @@ static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) {
|
||||
FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset));
|
||||
|
||||
// Leave the frame (also dropping the register file).
|
||||
__ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
||||
__ LeaveFrame(StackFrame::INTERPRETED);
|
||||
|
||||
// Drop receiver + arguments.
|
||||
__ Addu(sp, sp, args_count);
|
||||
|
@ -701,7 +701,7 @@ static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) {
|
||||
__ Lw(t0, FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset));
|
||||
|
||||
// Leave the frame (also dropping the register file).
|
||||
__ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
||||
__ LeaveFrame(StackFrame::INTERPRETED);
|
||||
|
||||
// Drop receiver + arguments.
|
||||
__ Daddu(sp, sp, args_count);
|
||||
|
@ -719,7 +719,7 @@ static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) {
|
||||
FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset));
|
||||
|
||||
// Leave the frame (also dropping the register file).
|
||||
__ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
||||
__ LeaveFrame(StackFrame::INTERPRETED);
|
||||
|
||||
__ add(sp, sp, args_count);
|
||||
}
|
||||
|
@ -722,7 +722,7 @@ static void LeaveInterpreterFrame(MacroAssembler* masm, Register scratch) {
|
||||
FieldMemOperand(args_count, BytecodeArray::kParameterSizeOffset));
|
||||
|
||||
// Leave the frame (also dropping the register file).
|
||||
__ LeaveFrame(StackFrame::JAVA_SCRIPT);
|
||||
__ LeaveFrame(StackFrame::INTERPRETED);
|
||||
|
||||
__ AddP(sp, sp, args_count);
|
||||
}
|
||||
|
@ -153,34 +153,6 @@ Address JavaScriptFrame::GetParameterSlot(int index) const {
|
||||
return caller_sp() + parameter_offset;
|
||||
}
|
||||
|
||||
inline Address JavaScriptFrame::GetOperandSlot(int index) const {
|
||||
Address base = fp() + JavaScriptFrameConstants::kLocal0Offset;
|
||||
DCHECK(IsAddressAligned(base, kPointerSize));
|
||||
DCHECK_EQ(type(), JAVA_SCRIPT);
|
||||
DCHECK_LT(index, ComputeOperandsCount());
|
||||
DCHECK_LE(0, index);
|
||||
// Operand stack grows down.
|
||||
return base - index * kPointerSize;
|
||||
}
|
||||
|
||||
|
||||
inline Object* JavaScriptFrame::GetOperand(int index) const {
|
||||
return Memory::Object_at(GetOperandSlot(index));
|
||||
}
|
||||
|
||||
|
||||
inline int JavaScriptFrame::ComputeOperandsCount() const {
|
||||
Address base = fp() + JavaScriptFrameConstants::kLocal0Offset;
|
||||
// Base points to low address of first operand and stack grows down, so add
|
||||
// kPointerSize to get the actual stack size.
|
||||
intptr_t stack_size_in_bytes = (base + kPointerSize) - sp();
|
||||
DCHECK(IsAligned(stack_size_in_bytes, kPointerSize));
|
||||
DCHECK(type() == JAVA_SCRIPT);
|
||||
DCHECK(stack_size_in_bytes >= 0);
|
||||
return static_cast<int>(stack_size_in_bytes >> kPointerSizeLog2);
|
||||
}
|
||||
|
||||
|
||||
inline void JavaScriptFrame::set_receiver(Object* value) {
|
||||
Memory::Object_at(GetParameterSlot(-1)) = value;
|
||||
}
|
||||
|
@ -241,9 +241,9 @@ SafeStackFrameIterator::SafeStackFrameIterator(
|
||||
advance_frame = true;
|
||||
}
|
||||
} else {
|
||||
// Mark the frame as JAVA_SCRIPT if we cannot determine its type.
|
||||
// Mark the frame as OPTIMIZED if we cannot determine its type.
|
||||
// The frame anyways will be skipped.
|
||||
type = StackFrame::JAVA_SCRIPT;
|
||||
type = StackFrame::OPTIMIZED;
|
||||
// Top frame is incomplete so we cannot reliably determine its type.
|
||||
top_frame_type_ = StackFrame::NONE;
|
||||
}
|
||||
@ -430,7 +430,7 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
|
||||
*(state->pc_address))) {
|
||||
return INTERPRETED;
|
||||
} else {
|
||||
return JAVA_SCRIPT;
|
||||
return OPTIMIZED;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -490,7 +490,6 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
|
||||
case WASM_COMPILED:
|
||||
return candidate;
|
||||
case JS_TO_WASM:
|
||||
case JAVA_SCRIPT:
|
||||
case OPTIMIZED:
|
||||
case INTERPRETED:
|
||||
default:
|
||||
@ -792,7 +791,6 @@ void StandardFrame::IterateCompiledFrame(RootVisitor* v) const {
|
||||
case C_WASM_ENTRY:
|
||||
frame_header_size = TypedFrameConstants::kFixedFrameSizeFromFp;
|
||||
break;
|
||||
case JAVA_SCRIPT:
|
||||
case OPTIMIZED:
|
||||
case INTERPRETED:
|
||||
case BUILTIN:
|
||||
@ -1138,7 +1136,7 @@ bool IsNonDeoptimizingAsmCode(Code* code, JSFunction* function) {
|
||||
FrameSummary::JavaScriptFrameSummary::JavaScriptFrameSummary(
|
||||
Isolate* isolate, Object* receiver, JSFunction* function,
|
||||
AbstractCode* abstract_code, int code_offset, bool is_constructor)
|
||||
: FrameSummaryBase(isolate, JAVA_SCRIPT),
|
||||
: FrameSummaryBase(isolate, FrameSummary::JAVA_SCRIPT),
|
||||
receiver_(receiver, isolate),
|
||||
function_(function, isolate),
|
||||
abstract_code_(abstract_code, isolate),
|
||||
|
11
src/frames.h
11
src/frames.h
@ -88,7 +88,6 @@ class StackHandler BASE_EMBEDDED {
|
||||
V(ENTRY, EntryFrame) \
|
||||
V(CONSTRUCT_ENTRY, ConstructEntryFrame) \
|
||||
V(EXIT, ExitFrame) \
|
||||
V(JAVA_SCRIPT, JavaScriptFrame) \
|
||||
V(OPTIMIZED, OptimizedFrame) \
|
||||
V(WASM_COMPILED, WasmCompiledFrame) \
|
||||
V(WASM_TO_JS, WasmToJsFrame) \
|
||||
@ -218,8 +217,7 @@ class StackFrame BASE_EMBEDDED {
|
||||
|
||||
bool is_java_script() const {
|
||||
Type type = this->type();
|
||||
return (type == JAVA_SCRIPT) || (type == OPTIMIZED) ||
|
||||
(type == INTERPRETED) || (type == BUILTIN) ||
|
||||
return (type == OPTIMIZED) || (type == INTERPRETED) || (type == BUILTIN) ||
|
||||
(type == JAVA_SCRIPT_BUILTIN_CONTINUATION);
|
||||
}
|
||||
bool is_wasm() const {
|
||||
@ -676,7 +674,7 @@ class StandardFrame : public StackFrame {
|
||||
|
||||
class JavaScriptFrame : public StandardFrame {
|
||||
public:
|
||||
Type type() const override { return JAVA_SCRIPT; }
|
||||
Type type() const override = 0;
|
||||
|
||||
void Summarize(std::vector<FrameSummary>* frames) const override;
|
||||
|
||||
@ -693,11 +691,6 @@ class JavaScriptFrame : public StandardFrame {
|
||||
Object* GetParameter(int index) const override;
|
||||
int ComputeParametersCount() const override;
|
||||
|
||||
// Access the operand stack.
|
||||
inline Address GetOperandSlot(int index) const;
|
||||
inline Object* GetOperand(int index) const;
|
||||
inline int ComputeOperandsCount() const;
|
||||
|
||||
// Debugger access.
|
||||
void SetParameterValue(int index, Object* value) const;
|
||||
|
||||
|
@ -1961,7 +1961,7 @@ void MarkCompactCollector::ProcessEphemeralMarking(
|
||||
void MarkCompactCollector::ProcessTopOptimizedFrame(ObjectVisitor* visitor) {
|
||||
for (StackFrameIterator it(isolate(), isolate()->thread_local_top());
|
||||
!it.done(); it.Advance()) {
|
||||
if (it.frame()->type() == StackFrame::JAVA_SCRIPT) {
|
||||
if (it.frame()->type() == StackFrame::INTERPRETED) {
|
||||
return;
|
||||
}
|
||||
if (it.frame()->type() == StackFrame::OPTIMIZED) {
|
||||
|
@ -592,7 +592,6 @@ Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSReceiver> error_object,
|
||||
StackFrame* frame = iter.frame();
|
||||
|
||||
switch (frame->type()) {
|
||||
case StackFrame::JAVA_SCRIPT:
|
||||
case StackFrame::JAVA_SCRIPT_BUILTIN_CONTINUATION:
|
||||
case StackFrame::OPTIMIZED:
|
||||
case StackFrame::INTERPRETED:
|
||||
@ -1338,9 +1337,8 @@ Object* Isolate::UnwindAndFindHandler() {
|
||||
return FoundHandler(context, code, 0, return_sp, frame->fp());
|
||||
}
|
||||
|
||||
case StackFrame::JAVA_SCRIPT:
|
||||
case StackFrame::BUILTIN:
|
||||
// For JavaScript frames we are guaranteed not to find a handler.
|
||||
// For builtin frames we are guaranteed not to find a handler.
|
||||
if (catchable_by_js) {
|
||||
CHECK_EQ(-1,
|
||||
JavaScriptFrame::cast(frame)->LookupExceptionHandlerInTable(
|
||||
@ -1452,7 +1450,6 @@ Isolate::CatchType Isolate::PredictExceptionCatcher() {
|
||||
} break;
|
||||
|
||||
// For JavaScript frames we perform a lookup in the handler table.
|
||||
case StackFrame::JAVA_SCRIPT:
|
||||
case StackFrame::OPTIMIZED:
|
||||
case StackFrame::INTERPRETED:
|
||||
case StackFrame::BUILTIN: {
|
||||
|
@ -297,8 +297,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
|
||||
}
|
||||
|
||||
// Make the profiler arm all back edges in unoptimized code.
|
||||
if (it.frame()->type() == StackFrame::JAVA_SCRIPT ||
|
||||
it.frame()->type() == StackFrame::INTERPRETED) {
|
||||
if (it.frame()->type() == StackFrame::INTERPRETED) {
|
||||
isolate->runtime_profiler()->AttemptOnStackReplacement(
|
||||
it.frame(), AbstractCode::kMaxLoopNestingMarker);
|
||||
}
|
||||
|
@ -324,7 +324,6 @@ FRAME_MARKERS = (
|
||||
"ENTRY",
|
||||
"CONSTRUCT_ENTRY",
|
||||
"EXIT",
|
||||
"JAVA_SCRIPT",
|
||||
"OPTIMIZED",
|
||||
"WASM_COMPILED",
|
||||
"WASM_TO_JS",
|
||||
|
Loading…
Reference in New Issue
Block a user