[wasm] Remove interpreter entry frames
Interpreter entry compilation was removed in https://crrev.com/c/2172962. This CL removes the {WasmInterpreterEntryFrame} and the corresponding {WASM_INTERPRETER_ENTRY} code kind. Some follow-up cleanups are left as TODOs. R=jkummerow@chromium.org,bmeurer@chromium.org Bug: v8:10389 Change-Id: I1a43eba1ac1a751e05990c688088d99fc901231f Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2182456 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/master@{#67607}
This commit is contained in:
parent
8c8e6b4117
commit
2c45f607a2
@ -169,8 +169,6 @@ StackFrame::Type OptimizedCompilationInfo::GetOutputStackFrameType() const {
|
||||
return StackFrame::JS_TO_WASM;
|
||||
case Code::WASM_TO_JS_FUNCTION:
|
||||
return StackFrame::WASM_TO_JS;
|
||||
case Code::WASM_INTERPRETER_ENTRY:
|
||||
return StackFrame::WASM_INTERPRETER_ENTRY;
|
||||
case Code::C_WASM_ENTRY:
|
||||
return StackFrame::C_WASM_ENTRY;
|
||||
default:
|
||||
|
@ -93,7 +93,6 @@ CodeGenerator::CodeGenerator(
|
||||
if (code_kind == Code::WASM_FUNCTION ||
|
||||
code_kind == Code::WASM_TO_CAPI_FUNCTION ||
|
||||
code_kind == Code::WASM_TO_JS_FUNCTION ||
|
||||
code_kind == Code::WASM_INTERPRETER_ENTRY ||
|
||||
code_kind == Code::JS_TO_WASM_FUNCTION) {
|
||||
tasm_.set_abort_hard(true);
|
||||
}
|
||||
|
@ -2328,7 +2328,6 @@ struct VerifyGraphPhase {
|
||||
case Code::WASM_TO_CAPI_FUNCTION:
|
||||
case Code::WASM_TO_JS_FUNCTION:
|
||||
case Code::JS_TO_WASM_FUNCTION:
|
||||
case Code::WASM_INTERPRETER_ENTRY:
|
||||
case Code::C_WASM_ENTRY:
|
||||
code_type = Verifier::kWasm;
|
||||
break;
|
||||
|
@ -43,12 +43,6 @@ FrameInspector::FrameInspector(StandardFrame* frame, int inlined_frame_index,
|
||||
DCHECK_NOT_NULL(js_frame);
|
||||
deoptimized_frame_.reset(Deoptimizer::DebuggerInspectableFrame(
|
||||
js_frame, inlined_frame_index, isolate));
|
||||
} else if (frame_->is_wasm_interpreter_entry()) {
|
||||
wasm_interpreted_frame_ =
|
||||
WasmInterpreterEntryFrame::cast(frame_)
|
||||
->debug_info()
|
||||
.GetInterpretedFrame(frame_->fp(), inlined_frame_index);
|
||||
DCHECK(wasm_interpreted_frame_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,14 +57,11 @@ JavaScriptFrame* FrameInspector::javascript_frame() {
|
||||
|
||||
int FrameInspector::GetParametersCount() {
|
||||
if (is_optimized_) return deoptimized_frame_->parameters_count();
|
||||
if (wasm_interpreted_frame_)
|
||||
return wasm_interpreted_frame_->GetParameterCount();
|
||||
return frame_->ComputeParametersCount();
|
||||
}
|
||||
|
||||
Handle<Object> FrameInspector::GetParameter(int index) {
|
||||
if (is_optimized_) return deoptimized_frame_->GetParameter(index);
|
||||
// TODO(clemensb): Handle wasm_interpreted_frame_.
|
||||
return handle(frame_->GetParameter(index), isolate_);
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,6 @@ class FrameInspector {
|
||||
StandardFrame* frame_;
|
||||
int inlined_frame_index_;
|
||||
std::unique_ptr<DeoptimizedFrameInfo> deoptimized_frame_;
|
||||
wasm::WasmInterpreter::FramePtr wasm_interpreted_frame_;
|
||||
Isolate* isolate_;
|
||||
Handle<Script> script_;
|
||||
Handle<Object> receiver_;
|
||||
|
@ -135,7 +135,6 @@ std::vector<wasm_addr_t> WasmModuleDebug::GetCallStack(
|
||||
break;
|
||||
}
|
||||
|
||||
case StackFrame::WASM_INTERPRETER_ENTRY:
|
||||
case StackFrame::BUILTIN_EXIT:
|
||||
default:
|
||||
// ignore the frame.
|
||||
@ -157,8 +156,7 @@ std::vector<FrameSummary> WasmModuleDebug::FindWasmFrame(
|
||||
case StackFrame::OPTIMIZED:
|
||||
case StackFrame::INTERPRETED:
|
||||
case StackFrame::BUILTIN:
|
||||
case StackFrame::WASM_COMPILED:
|
||||
case StackFrame::WASM_INTERPRETER_ENTRY: {
|
||||
case StackFrame::WASM_COMPILED: {
|
||||
// A standard frame may include many summarized frames, due to inlining.
|
||||
std::vector<FrameSummary> frames;
|
||||
StandardFrame::cast(frame)->Summarize(&frames);
|
||||
|
@ -242,10 +242,6 @@ inline WasmCompiledFrame::WasmCompiledFrame(StackFrameIteratorBase* iterator)
|
||||
inline WasmExitFrame::WasmExitFrame(StackFrameIteratorBase* iterator)
|
||||
: WasmCompiledFrame(iterator) {}
|
||||
|
||||
inline WasmInterpreterEntryFrame::WasmInterpreterEntryFrame(
|
||||
StackFrameIteratorBase* iterator)
|
||||
: StandardFrame(iterator) {}
|
||||
|
||||
inline WasmDebugBreakFrame::WasmDebugBreakFrame(
|
||||
StackFrameIteratorBase* iterator)
|
||||
: StandardFrame(iterator) {}
|
||||
|
@ -558,8 +558,6 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
|
||||
return WASM_EXIT;
|
||||
case wasm::WasmCode::kWasmToJsWrapper:
|
||||
return WASM_TO_JS;
|
||||
case wasm::WasmCode::kInterpreterEntry:
|
||||
return WASM_INTERPRETER_ENTRY;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
@ -592,7 +590,6 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
|
||||
case Code::WASM_FUNCTION:
|
||||
case Code::WASM_TO_CAPI_FUNCTION:
|
||||
case Code::WASM_TO_JS_FUNCTION:
|
||||
case Code::WASM_INTERPRETER_ENTRY:
|
||||
// Never appear as on-heap {Code} objects.
|
||||
UNREACHABLE();
|
||||
default:
|
||||
@ -975,7 +972,6 @@ void StandardFrame::IterateCompiledFrame(RootVisitor* v) const {
|
||||
break;
|
||||
case WASM_TO_JS:
|
||||
case WASM_COMPILED:
|
||||
case WASM_INTERPRETER_ENTRY:
|
||||
case WASM_COMPILE_LAZY:
|
||||
frame_header_size = WasmCompiledFrameConstants::kFixedFrameSizeFromFp;
|
||||
break;
|
||||
@ -1406,13 +1402,11 @@ Handle<Object> FrameSummary::WasmFrameSummary::receiver() const {
|
||||
return wasm_instance_->GetIsolate()->global_proxy();
|
||||
}
|
||||
|
||||
#define WASM_SUMMARY_DISPATCH(type, name) \
|
||||
type FrameSummary::WasmFrameSummary::name() const { \
|
||||
DCHECK(kind() == Kind::WASM_COMPILED || kind() == Kind::WASM_INTERPRETED); \
|
||||
return kind() == Kind::WASM_COMPILED \
|
||||
? static_cast<const WasmCompiledFrameSummary*>(this)->name() \
|
||||
: static_cast<const WasmInterpretedFrameSummary*>(this) \
|
||||
->name(); \
|
||||
// TODO(clemensb): Remove this dispatch.
|
||||
#define WASM_SUMMARY_DISPATCH(type, name) \
|
||||
type FrameSummary::WasmFrameSummary::name() const { \
|
||||
DCHECK_EQ(Kind::WASM_COMPILED, kind()); \
|
||||
return static_cast<const WasmCompiledFrameSummary*>(this)->name(); \
|
||||
}
|
||||
|
||||
WASM_SUMMARY_DISPATCH(uint32_t, function_index)
|
||||
@ -1458,13 +1452,6 @@ int FrameSummary::WasmCompiledFrameSummary::byte_offset() const {
|
||||
return code_->GetSourcePositionBefore(code_offset());
|
||||
}
|
||||
|
||||
FrameSummary::WasmInterpretedFrameSummary::WasmInterpretedFrameSummary(
|
||||
Isolate* isolate, Handle<WasmInstanceObject> instance,
|
||||
uint32_t function_index, int byte_offset)
|
||||
: WasmFrameSummary(isolate, WASM_INTERPRETED, instance, false),
|
||||
function_index_(function_index),
|
||||
byte_offset_(byte_offset) {}
|
||||
|
||||
FrameSummary::~FrameSummary() {
|
||||
#define FRAME_SUMMARY_DESTR(kind, type, field, desc) \
|
||||
case kind: \
|
||||
@ -1511,11 +1498,8 @@ FrameSummary FrameSummary::Get(const StandardFrame* frame, int index) {
|
||||
return java_script_summary_.name(); \
|
||||
case WASM_COMPILED: \
|
||||
return wasm_compiled_summary_.name(); \
|
||||
case WASM_INTERPRETED: \
|
||||
return wasm_interpreted_summary_.name(); \
|
||||
default: \
|
||||
UNREACHABLE(); \
|
||||
return ret{}; \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -1966,70 +1950,6 @@ int WasmCompiledFrame::LookupExceptionHandlerInTable() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void WasmInterpreterEntryFrame::Iterate(RootVisitor* v) const {
|
||||
IterateCompiledFrame(v);
|
||||
}
|
||||
|
||||
void WasmInterpreterEntryFrame::Print(StringStream* accumulator, PrintMode mode,
|
||||
int index) const {
|
||||
PrintIndex(accumulator, mode, index);
|
||||
accumulator->Add("WASM INTERPRETER ENTRY [");
|
||||
Script script = this->script();
|
||||
accumulator->PrintName(script.name());
|
||||
accumulator->Add("]");
|
||||
if (mode != OVERVIEW) accumulator->Add("\n");
|
||||
}
|
||||
|
||||
void WasmInterpreterEntryFrame::Summarize(
|
||||
std::vector<FrameSummary>* functions) const {
|
||||
Handle<WasmInstanceObject> instance(wasm_instance(), isolate());
|
||||
std::vector<std::pair<uint32_t, int>> interpreted_stack =
|
||||
instance->debug_info().GetInterpretedStack(fp());
|
||||
|
||||
for (auto& e : interpreted_stack) {
|
||||
FrameSummary::WasmInterpretedFrameSummary summary(isolate(), instance,
|
||||
e.first, e.second);
|
||||
functions->push_back(summary);
|
||||
}
|
||||
}
|
||||
|
||||
Code WasmInterpreterEntryFrame::unchecked_code() const { return Code(); }
|
||||
|
||||
int WasmInterpreterEntryFrame::NumberOfActiveFrames() const {
|
||||
Handle<WasmInstanceObject> instance(wasm_instance(), isolate());
|
||||
return instance->debug_info().NumberOfActiveFrames(fp());
|
||||
}
|
||||
|
||||
WasmInstanceObject WasmInterpreterEntryFrame::wasm_instance() const {
|
||||
const int offset = WasmCompiledFrameConstants::kWasmInstanceOffset;
|
||||
Object instance(Memory<Address>(fp() + offset));
|
||||
return WasmInstanceObject::cast(instance);
|
||||
}
|
||||
|
||||
WasmDebugInfo WasmInterpreterEntryFrame::debug_info() const {
|
||||
return wasm_instance().debug_info();
|
||||
}
|
||||
|
||||
WasmModuleObject WasmInterpreterEntryFrame::module_object() const {
|
||||
return wasm_instance().module_object();
|
||||
}
|
||||
|
||||
Script WasmInterpreterEntryFrame::script() const {
|
||||
return module_object().script();
|
||||
}
|
||||
|
||||
int WasmInterpreterEntryFrame::position() const {
|
||||
return FrameSummary::GetBottom(this).AsWasmInterpreted().SourcePosition();
|
||||
}
|
||||
|
||||
Object WasmInterpreterEntryFrame::context() const {
|
||||
return wasm_instance().native_context();
|
||||
}
|
||||
|
||||
Address WasmInterpreterEntryFrame::GetCallerStackPointer() const {
|
||||
return fp() + ExitFrameConstants::kCallerSPOffset;
|
||||
}
|
||||
|
||||
void WasmDebugBreakFrame::Iterate(RootVisitor* v) const {
|
||||
// Nothing to iterate here. This will change once we support references in
|
||||
// Liftoff.
|
||||
|
@ -69,7 +69,6 @@ class StackHandler {
|
||||
V(WASM_COMPILED, WasmCompiledFrame) \
|
||||
V(WASM_TO_JS, WasmToJsFrame) \
|
||||
V(JS_TO_WASM, JsToWasmFrame) \
|
||||
V(WASM_INTERPRETER_ENTRY, WasmInterpreterEntryFrame) \
|
||||
V(WASM_DEBUG_BREAK, WasmDebugBreakFrame) \
|
||||
V(C_WASM_ENTRY, CWasmEntryFrame) \
|
||||
V(WASM_EXIT, WasmExitFrame) \
|
||||
@ -181,12 +180,11 @@ class StackFrame {
|
||||
bool is_exit() const { return type() == EXIT; }
|
||||
bool is_optimized() const { return type() == OPTIMIZED; }
|
||||
bool is_interpreted() const { return type() == INTERPRETED; }
|
||||
bool is_wasm() const { return this->type() == WASM_COMPILED; }
|
||||
// TODO(clemensb): Remove {is_wasm_compiled}, replace by {is_wasm}.
|
||||
bool is_wasm_compiled() const { return type() == WASM_COMPILED; }
|
||||
bool is_wasm_compile_lazy() const { return type() == WASM_COMPILE_LAZY; }
|
||||
bool is_wasm_debug_break() const { return type() == WASM_DEBUG_BREAK; }
|
||||
bool is_wasm_interpreter_entry() const {
|
||||
return type() == WASM_INTERPRETER_ENTRY;
|
||||
}
|
||||
bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; }
|
||||
bool is_builtin() const { return type() == BUILTIN; }
|
||||
bool is_internal() const { return type() == INTERNAL; }
|
||||
@ -209,10 +207,6 @@ class StackFrame {
|
||||
(type == JAVA_SCRIPT_BUILTIN_CONTINUATION) ||
|
||||
(type == JAVA_SCRIPT_BUILTIN_CONTINUATION_WITH_CATCH);
|
||||
}
|
||||
bool is_wasm() const {
|
||||
Type type = this->type();
|
||||
return type == WASM_COMPILED || type == WASM_INTERPRETER_ENTRY;
|
||||
}
|
||||
bool is_wasm_to_js() const { return type() == WASM_TO_JS; }
|
||||
|
||||
// Accessors.
|
||||
@ -458,12 +452,10 @@ class StandardFrame;
|
||||
class V8_EXPORT_PRIVATE FrameSummary {
|
||||
public:
|
||||
// Subclasses for the different summary kinds:
|
||||
#define FRAME_SUMMARY_VARIANTS(F) \
|
||||
F(JAVA_SCRIPT, JavaScriptFrameSummary, java_script_summary_, JavaScript) \
|
||||
F(WASM_COMPILED, WasmCompiledFrameSummary, wasm_compiled_summary_, \
|
||||
WasmCompiled) \
|
||||
F(WASM_INTERPRETED, WasmInterpretedFrameSummary, wasm_interpreted_summary_, \
|
||||
WasmInterpreted)
|
||||
#define FRAME_SUMMARY_VARIANTS(F) \
|
||||
F(JAVA_SCRIPT, JavaScriptFrameSummary, java_script_summary_, JavaScript) \
|
||||
F(WASM_COMPILED, WasmCompiledFrameSummary, wasm_compiled_summary_, \
|
||||
WasmCompiled)
|
||||
|
||||
#define FRAME_SUMMARY_KIND(kind, type, field, desc) kind,
|
||||
enum Kind { FRAME_SUMMARY_VARIANTS(FRAME_SUMMARY_KIND) };
|
||||
@ -552,19 +544,6 @@ class V8_EXPORT_PRIVATE FrameSummary {
|
||||
int code_offset_;
|
||||
};
|
||||
|
||||
class WasmInterpretedFrameSummary : public WasmFrameSummary {
|
||||
public:
|
||||
WasmInterpretedFrameSummary(Isolate*, Handle<WasmInstanceObject>,
|
||||
uint32_t function_index, int byte_offset);
|
||||
uint32_t function_index() const { return function_index_; }
|
||||
int code_offset() const { return byte_offset_; }
|
||||
int byte_offset() const { return byte_offset_; }
|
||||
|
||||
private:
|
||||
uint32_t function_index_;
|
||||
int byte_offset_;
|
||||
};
|
||||
|
||||
#define FRAME_SUMMARY_CONS(kind, type, field, desc) \
|
||||
FrameSummary(type summ) : field(summ) {} // NOLINT
|
||||
FRAME_SUMMARY_VARIANTS(FRAME_SUMMARY_CONS)
|
||||
@ -600,11 +579,9 @@ class V8_EXPORT_PRIVATE FrameSummary {
|
||||
FRAME_SUMMARY_VARIANTS(FRAME_SUMMARY_CAST)
|
||||
#undef FRAME_SUMMARY_CAST
|
||||
|
||||
bool IsWasm() const { return IsWasmCompiled() || IsWasmInterpreted(); }
|
||||
const WasmFrameSummary& AsWasm() const {
|
||||
if (IsWasmCompiled()) return AsWasmCompiled();
|
||||
return AsWasmInterpreted();
|
||||
}
|
||||
// TODO(clemensb): Remove {IsWasmCompiled()} and {AsWasmCompiled()}.
|
||||
bool IsWasm() const { return IsWasmCompiled(); }
|
||||
const WasmFrameSummary& AsWasm() const { return AsWasmCompiled(); }
|
||||
|
||||
private:
|
||||
#define FRAME_SUMMARY_FIELD(kind, type, field, desc) type field;
|
||||
@ -996,46 +973,6 @@ class WasmExitFrame : public WasmCompiledFrame {
|
||||
friend class StackFrameIteratorBase;
|
||||
};
|
||||
|
||||
class WasmInterpreterEntryFrame final : public StandardFrame {
|
||||
public:
|
||||
Type type() const override { return WASM_INTERPRETER_ENTRY; }
|
||||
|
||||
// GC support.
|
||||
void Iterate(RootVisitor* v) const override;
|
||||
|
||||
// Printing support.
|
||||
void Print(StringStream* accumulator, PrintMode mode,
|
||||
int index) const override;
|
||||
|
||||
void Summarize(std::vector<FrameSummary>* frames) const override;
|
||||
|
||||
// Determine the code for the frame.
|
||||
Code unchecked_code() const override;
|
||||
|
||||
// Accessors.
|
||||
int NumberOfActiveFrames() const;
|
||||
WasmDebugInfo debug_info() const;
|
||||
WasmInstanceObject wasm_instance() const;
|
||||
|
||||
Script script() const override;
|
||||
int position() const override;
|
||||
Object context() const override;
|
||||
|
||||
static WasmInterpreterEntryFrame* cast(StackFrame* frame) {
|
||||
DCHECK(frame->is_wasm_interpreter_entry());
|
||||
return static_cast<WasmInterpreterEntryFrame*>(frame);
|
||||
}
|
||||
|
||||
protected:
|
||||
inline explicit WasmInterpreterEntryFrame(StackFrameIteratorBase* iterator);
|
||||
|
||||
Address GetCallerStackPointer() const override;
|
||||
|
||||
private:
|
||||
friend class StackFrameIteratorBase;
|
||||
WasmModuleObject module_object() const;
|
||||
};
|
||||
|
||||
class WasmDebugBreakFrame final : public StandardFrame {
|
||||
public:
|
||||
Type type() const override { return WASM_DEBUG_BREAK; }
|
||||
|
@ -650,16 +650,6 @@ class FrameArrayBuilder {
|
||||
summary.code_offset(), flags);
|
||||
}
|
||||
|
||||
void AppendWasmInterpretedFrame(
|
||||
FrameSummary::WasmInterpretedFrameSummary const& summary) {
|
||||
Handle<WasmInstanceObject> instance = summary.wasm_instance();
|
||||
int flags = FrameArray::kIsWasmInterpretedFrame;
|
||||
DCHECK(!instance->module_object().is_asm_js());
|
||||
elements_ = FrameArray::AppendWasmFrame(elements_, instance,
|
||||
summary.function_index(), {},
|
||||
summary.byte_offset(), flags);
|
||||
}
|
||||
|
||||
void AppendBuiltinExitFrame(BuiltinExitFrame* exit_frame) {
|
||||
Handle<JSFunction> function = handle(exit_frame->function(), isolate_);
|
||||
|
||||
@ -952,8 +942,7 @@ Handle<Object> CaptureStackTrace(Isolate* isolate, Handle<Object> caller,
|
||||
case StackFrame::OPTIMIZED:
|
||||
case StackFrame::INTERPRETED:
|
||||
case StackFrame::BUILTIN:
|
||||
case StackFrame::WASM_COMPILED:
|
||||
case StackFrame::WASM_INTERPRETER_ENTRY: {
|
||||
case StackFrame::WASM_COMPILED: {
|
||||
// A standard frame may include many summarized frames (due to
|
||||
// inlining).
|
||||
std::vector<FrameSummary> frames;
|
||||
@ -977,12 +966,6 @@ Handle<Object> CaptureStackTrace(Isolate* isolate, Handle<Object> caller,
|
||||
//=========================================================
|
||||
auto const& wasm_compiled = summary.AsWasmCompiled();
|
||||
builder.AppendWasmCompiledFrame(wasm_compiled);
|
||||
} else if (summary.IsWasmInterpreted()) {
|
||||
//=========================================================
|
||||
// Handle a Wasm interpreted frame.
|
||||
//=========================================================
|
||||
auto const& wasm_interpreted = summary.AsWasmInterpreted();
|
||||
builder.AppendWasmInterpretedFrame(wasm_interpreted);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1800,12 +1783,6 @@ Object Isolate::UnwindAndFindHandler() {
|
||||
}
|
||||
break;
|
||||
|
||||
case StackFrame::WASM_INTERPRETER_ENTRY: {
|
||||
if (trap_handler::IsThreadInWasm()) {
|
||||
trap_handler::ClearThreadInWasm();
|
||||
}
|
||||
} break;
|
||||
|
||||
case StackFrame::JAVA_SCRIPT_BUILTIN_CONTINUATION_WITH_CATCH: {
|
||||
// Builtin continuation frames with catch can handle exceptions.
|
||||
if (!catchable_by_js) break;
|
||||
|
@ -547,19 +547,14 @@ void WasmStackFrame::FromFrameArray(Isolate* isolate, Handle<FrameArray> array,
|
||||
// This function is called for compiled and interpreted wasm frames, and for
|
||||
// asm.js->wasm frames.
|
||||
DCHECK(array->IsWasmFrame(frame_ix) ||
|
||||
array->IsWasmInterpretedFrame(frame_ix) ||
|
||||
array->IsAsmJsWasmFrame(frame_ix));
|
||||
isolate_ = isolate;
|
||||
wasm_instance_ = handle(array->WasmInstance(frame_ix), isolate);
|
||||
wasm_func_index_ = array->WasmFunctionIndex(frame_ix).value();
|
||||
if (array->IsWasmInterpretedFrame(frame_ix)) {
|
||||
code_ = nullptr;
|
||||
} else {
|
||||
// The {WasmCode*} is held alive by the {GlobalWasmCodeRef}.
|
||||
auto global_wasm_code_ref =
|
||||
Managed<wasm::GlobalWasmCodeRef>::cast(array->WasmCodeObject(frame_ix));
|
||||
code_ = global_wasm_code_ref.get()->code();
|
||||
}
|
||||
// The {WasmCode*} is held alive by the {GlobalWasmCodeRef}.
|
||||
auto global_wasm_code_ref =
|
||||
Managed<wasm::GlobalWasmCodeRef>::cast(array->WasmCodeObject(frame_ix));
|
||||
code_ = global_wasm_code_ref.get()->code();
|
||||
offset_ = array->Offset(frame_ix).value();
|
||||
}
|
||||
|
||||
@ -688,20 +683,15 @@ StackFrameBase* FrameArrayIterator::Frame() {
|
||||
DCHECK(HasFrame());
|
||||
const int flags = array_->Flags(frame_ix_).value();
|
||||
int flag_mask = FrameArray::kIsWasmCompiledFrame |
|
||||
FrameArray::kIsWasmInterpretedFrame |
|
||||
FrameArray::kIsAsmJsWasmFrame;
|
||||
switch (flags & flag_mask) {
|
||||
case 0:
|
||||
// JavaScript Frame.
|
||||
js_frame_.FromFrameArray(isolate_, array_, frame_ix_);
|
||||
return &js_frame_;
|
||||
case FrameArray::kIsWasmCompiledFrame:
|
||||
case FrameArray::kIsWasmInterpretedFrame:
|
||||
// Wasm Frame:
|
||||
wasm_frame_.FromFrameArray(isolate_, array_, frame_ix_);
|
||||
return &wasm_frame_;
|
||||
case FrameArray::kIsAsmJsWasmFrame:
|
||||
// Asm.js Wasm Frame:
|
||||
asm_wasm_frame_.FromFrameArray(isolate_, array_, frame_ix_);
|
||||
return &asm_wasm_frame_;
|
||||
default:
|
||||
|
@ -88,8 +88,6 @@ static const char* ComputeMarker(const wasm::WasmCode* code) {
|
||||
switch (code->kind()) {
|
||||
case wasm::WasmCode::kFunction:
|
||||
return code->is_liftoff() ? "" : "*";
|
||||
case wasm::WasmCode::kInterpreterEntry:
|
||||
return "~";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
@ -2070,10 +2068,6 @@ void ExistingCodeLogger::LogCodeObject(Object object) {
|
||||
description = "A Wasm to JavaScript adapter";
|
||||
tag = CodeEventListener::STUB_TAG;
|
||||
break;
|
||||
case AbstractCode::WASM_INTERPRETER_ENTRY:
|
||||
description = "A Wasm to Interpreter adapter";
|
||||
tag = CodeEventListener::STUB_TAG;
|
||||
break;
|
||||
case AbstractCode::C_WASM_ENTRY:
|
||||
description = "A C to Wasm entry stub";
|
||||
tag = CodeEventListener::STUB_TAG;
|
||||
|
@ -47,7 +47,6 @@ class Code : public HeapObject {
|
||||
V(WASM_TO_JS_FUNCTION) \
|
||||
V(JS_TO_WASM_FUNCTION) \
|
||||
V(JS_TO_JS_FUNCTION) \
|
||||
V(WASM_INTERPRETER_ENTRY) \
|
||||
V(C_WASM_ENTRY)
|
||||
|
||||
enum Kind {
|
||||
|
@ -33,7 +33,7 @@ FRAME_ARRAY_FIELD_LIST(DEFINE_FRAME_ARRAY_ACCESSORS)
|
||||
#undef DEFINE_FRAME_ARRAY_ACCESSORS
|
||||
|
||||
bool FrameArray::IsWasmFrame(int frame_ix) const {
|
||||
return IsWasmCompiledFrame(frame_ix) || IsWasmInterpretedFrame(frame_ix);
|
||||
return IsWasmCompiledFrame(frame_ix);
|
||||
}
|
||||
|
||||
bool FrameArray::IsWasmCompiledFrame(int frame_ix) const {
|
||||
@ -41,19 +41,13 @@ bool FrameArray::IsWasmCompiledFrame(int frame_ix) const {
|
||||
return (flags & kIsWasmCompiledFrame) != 0;
|
||||
}
|
||||
|
||||
bool FrameArray::IsWasmInterpretedFrame(int frame_ix) const {
|
||||
const int flags = Flags(frame_ix).value();
|
||||
return (flags & kIsWasmInterpretedFrame) != 0;
|
||||
}
|
||||
|
||||
bool FrameArray::IsAsmJsWasmFrame(int frame_ix) const {
|
||||
const int flags = Flags(frame_ix).value();
|
||||
return (flags & kIsAsmJsWasmFrame) != 0;
|
||||
}
|
||||
|
||||
bool FrameArray::IsAnyWasmFrame(int frame_ix) const {
|
||||
return IsWasmFrame(frame_ix) || IsWasmInterpretedFrame(frame_ix) ||
|
||||
IsAsmJsWasmFrame(frame_ix);
|
||||
return IsWasmFrame(frame_ix) || IsAsmJsWasmFrame(frame_ix);
|
||||
}
|
||||
|
||||
int FrameArray::FrameCount() const {
|
||||
|
@ -38,8 +38,8 @@ class FrameArray : public FixedArray {
|
||||
#undef DECL_FRAME_ARRAY_ACCESSORS
|
||||
|
||||
inline bool IsWasmFrame(int frame_ix) const;
|
||||
// TODO(clemensb): Remove {IsWasmCompiledFrame}.
|
||||
inline bool IsWasmCompiledFrame(int frame_ix) const;
|
||||
inline bool IsWasmInterpretedFrame(int frame_ix) const;
|
||||
inline bool IsAsmJsWasmFrame(int frame_ix) const;
|
||||
inline bool IsAnyWasmFrame(int frame_ix) const;
|
||||
inline int FrameCount() const;
|
||||
@ -49,13 +49,12 @@ class FrameArray : public FixedArray {
|
||||
// Flags.
|
||||
enum Flag {
|
||||
kIsWasmCompiledFrame = 1 << 0,
|
||||
kIsWasmInterpretedFrame = 1 << 1,
|
||||
kIsAsmJsWasmFrame = 1 << 2,
|
||||
kIsStrict = 1 << 3,
|
||||
kIsConstructor = 1 << 4,
|
||||
kAsmJsAtNumberConversion = 1 << 5,
|
||||
kIsAsync = 1 << 6,
|
||||
kIsPromiseAll = 1 << 7
|
||||
kIsAsmJsWasmFrame = 1 << 1,
|
||||
kIsStrict = 1 << 2,
|
||||
kIsConstructor = 1 << 3,
|
||||
kAsmJsAtNumberConversion = 1 << 4,
|
||||
kIsAsync = 1 << 5,
|
||||
kIsPromiseAll = 1 << 6
|
||||
};
|
||||
|
||||
static Handle<FrameArray> AppendJSFrame(Handle<FrameArray> in,
|
||||
|
@ -4236,8 +4236,7 @@ Handle<FrameArray> FrameArray::AppendWasmFrame(
|
||||
int wasm_function_index, wasm::WasmCode* code, int offset, int flags) {
|
||||
// This must be either a compiled or interpreted wasm frame, or an asm.js
|
||||
// frame (which is always compiled).
|
||||
DCHECK_EQ(1, ((flags & kIsWasmInterpretedFrame) != 0) +
|
||||
((flags & kIsWasmCompiledFrame) != 0) +
|
||||
DCHECK_EQ(1, ((flags & kIsWasmCompiledFrame) != 0) +
|
||||
((flags & kIsAsmJsWasmFrame) != 0));
|
||||
Isolate* isolate = wasm_instance->GetIsolate();
|
||||
const int frame_count = in->FrameCount();
|
||||
|
@ -55,7 +55,6 @@ struct WasmCompilationResult {
|
||||
enum Kind : int8_t {
|
||||
kFunction,
|
||||
kWasmToJsWrapper,
|
||||
kInterpreterEntry,
|
||||
};
|
||||
|
||||
bool succeeded() const { return code_desc.buffer != nullptr; }
|
||||
|
@ -430,8 +430,6 @@ const char* GetWasmCodeKindAsString(WasmCode::Kind kind) {
|
||||
return "wasm-to-capi";
|
||||
case WasmCode::kWasmToJsWrapper:
|
||||
return "wasm-to-js";
|
||||
case WasmCode::kInterpreterEntry:
|
||||
return "interpreter entry";
|
||||
case WasmCode::kJumpTable:
|
||||
return "jump table";
|
||||
}
|
||||
@ -1064,8 +1062,6 @@ WasmCode::Kind GetCodeKind(const WasmCompilationResult& result) {
|
||||
switch (result.kind) {
|
||||
case WasmCompilationResult::kWasmToJsWrapper:
|
||||
return WasmCode::Kind::kWasmToJsWrapper;
|
||||
case WasmCompilationResult::kInterpreterEntry:
|
||||
return WasmCode::Kind::kInterpreterEntry;
|
||||
case WasmCompilationResult::kFunction:
|
||||
return WasmCode::Kind::kFunction;
|
||||
default:
|
||||
|
@ -118,7 +118,6 @@ class V8_EXPORT_PRIVATE WasmCode final {
|
||||
kFunction,
|
||||
kWasmToCapiWrapper,
|
||||
kWasmToJsWrapper,
|
||||
kInterpreterEntry,
|
||||
kJumpTable
|
||||
};
|
||||
|
||||
|
@ -199,13 +199,6 @@ class DebugEvaluatorProxy {
|
||||
|
||||
private:
|
||||
WasmValue LoadLocalValue(uint32_t local) {
|
||||
if (frame_->is_wasm_interpreter_entry()) {
|
||||
i::wasm::WasmInterpreter::FramePtr framePtr =
|
||||
debuggee_->debug_info().GetInterpretedFrame(frame_->fp(),
|
||||
inlined_frame_);
|
||||
return framePtr->GetLocalValue(local);
|
||||
}
|
||||
|
||||
DCHECK(frame_->is_wasm_compiled());
|
||||
wasm::DebugInfo* debug_info =
|
||||
WasmCompiledFrame::cast(frame_)->native_module()->GetDebugInfo();
|
||||
@ -247,7 +240,6 @@ class DebugEvaluatorProxy {
|
||||
|
||||
Isolate* isolate_;
|
||||
StandardFrame* frame_;
|
||||
int inlined_frame_ = 0;
|
||||
Handle<WasmInstanceObject> evaluator_;
|
||||
Handle<WasmInstanceObject> debuggee_;
|
||||
};
|
||||
|
@ -248,19 +248,6 @@ class InterpreterHandle {
|
||||
return frame_range.second - frame_range.first;
|
||||
}
|
||||
|
||||
WasmInterpreter::FramePtr GetInterpretedFrame(Address frame_pointer,
|
||||
int idx) {
|
||||
DCHECK_EQ(1, interpreter()->GetThreadCount());
|
||||
WasmInterpreter::Thread* thread = interpreter()->GetThread(0);
|
||||
|
||||
std::pair<uint32_t, uint32_t> frame_range =
|
||||
GetActivationFrameRange(thread, frame_pointer);
|
||||
DCHECK_LE(0, idx);
|
||||
DCHECK_GT(frame_range.second - frame_range.first, idx);
|
||||
|
||||
return thread->GetFrame(frame_range.first + idx);
|
||||
}
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(InterpreterHandle);
|
||||
};
|
||||
@ -897,18 +884,6 @@ void DebugInfo::RemoveDebugSideTables(Vector<WasmCode* const> code) {
|
||||
|
||||
} // namespace wasm
|
||||
|
||||
namespace {
|
||||
|
||||
// TODO(clemensb): This method is indirectly dead. It can be removed once the
|
||||
// WasmInterpreterEntryFrame is deleted.
|
||||
wasm::InterpreterHandle* GetInterpreterHandle(WasmDebugInfo debug_info) {
|
||||
Object handle_obj = debug_info.interpreter_handle();
|
||||
DCHECK(!handle_obj.IsUndefined());
|
||||
return Managed<wasm::InterpreterHandle>::cast(handle_obj).raw();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Handle<WasmDebugInfo> WasmDebugInfo::New(Handle<WasmInstanceObject> instance) {
|
||||
DCHECK(!instance->has_debug_info());
|
||||
Factory* factory = instance->GetIsolate()->factory();
|
||||
@ -936,20 +911,6 @@ wasm::WasmInterpreter* WasmDebugInfo::SetupForTesting(
|
||||
return interp_handle->raw()->interpreter();
|
||||
}
|
||||
|
||||
std::vector<std::pair<uint32_t, int>> WasmDebugInfo::GetInterpretedStack(
|
||||
Address frame_pointer) {
|
||||
return GetInterpreterHandle(*this)->GetInterpretedStack(frame_pointer);
|
||||
}
|
||||
|
||||
int WasmDebugInfo::NumberOfActiveFrames(Address frame_pointer) {
|
||||
return GetInterpreterHandle(*this)->NumberOfActiveFrames(frame_pointer);
|
||||
}
|
||||
|
||||
wasm::WasmInterpreter::FramePtr WasmDebugInfo::GetInterpretedFrame(
|
||||
Address frame_pointer, int idx) {
|
||||
return GetInterpreterHandle(*this)->GetInterpretedFrame(frame_pointer, idx);
|
||||
}
|
||||
|
||||
// static
|
||||
Handle<Code> WasmDebugInfo::GetCWasmEntry(Handle<WasmDebugInfo> debug_info,
|
||||
const wasm::FunctionSig* sig) {
|
||||
|
@ -4094,8 +4094,7 @@ class ThreadImpl {
|
||||
return CallExternalWasmFunction(isolate_, object_ref, code, signature);
|
||||
}
|
||||
|
||||
DCHECK(code->kind() == WasmCode::kInterpreterEntry ||
|
||||
code->kind() == WasmCode::kFunction);
|
||||
DCHECK_EQ(WasmCode::kFunction, code->kind());
|
||||
return {ExternalCallResult::INTERNAL, codemap()->GetCode(code->index())};
|
||||
}
|
||||
|
||||
|
@ -843,20 +843,6 @@ class WasmDebugInfo : public Struct {
|
||||
V8_EXPORT_PRIVATE static wasm::WasmInterpreter* SetupForTesting(
|
||||
Handle<WasmInstanceObject>);
|
||||
|
||||
// TODO(clemensb): The next three methods will become dead once the
|
||||
// WasmInterpreterEntryFrame is deleted.
|
||||
|
||||
// Get the stack of the wasm interpreter as pairs of <function index, byte
|
||||
// offset>. The list is ordered bottom-to-top, i.e. caller before callee.
|
||||
std::vector<std::pair<uint32_t, int>> GetInterpretedStack(
|
||||
Address frame_pointer);
|
||||
|
||||
int NumberOfActiveFrames(Address frame_pointer);
|
||||
|
||||
V8_EXPORT_PRIVATE
|
||||
std::unique_ptr<wasm::InterpretedFrame, wasm::InterpretedFrameDeleter>
|
||||
GetInterpretedFrame(Address frame_pointer, int frame_index);
|
||||
|
||||
V8_EXPORT_PRIVATE static Handle<Code> GetCWasmEntry(Handle<WasmDebugInfo>,
|
||||
const wasm::FunctionSig*);
|
||||
|
||||
|
@ -300,8 +300,7 @@ NativeModuleSerializer::NativeModuleSerializer(
|
||||
|
||||
size_t NativeModuleSerializer::MeasureCode(const WasmCode* code) const {
|
||||
if (code == nullptr) return sizeof(bool);
|
||||
DCHECK(code->kind() == WasmCode::kFunction ||
|
||||
code->kind() == WasmCode::kInterpreterEntry);
|
||||
DCHECK_EQ(WasmCode::kFunction, code->kind());
|
||||
return kCodeHeaderSize + code->instructions().size() +
|
||||
code->reloc_info().size() + code->source_positions().size() +
|
||||
code->protected_instructions_data().size();
|
||||
@ -329,8 +328,7 @@ void NativeModuleSerializer::WriteCode(const WasmCode* code, Writer* writer) {
|
||||
return;
|
||||
}
|
||||
writer->Write(true);
|
||||
DCHECK(code->kind() == WasmCode::kFunction ||
|
||||
code->kind() == WasmCode::kInterpreterEntry);
|
||||
DCHECK_EQ(WasmCode::kFunction, code->kind());
|
||||
// Write the size of the entire code section, followed by the code header.
|
||||
writer->Write(code->constant_pool_offset());
|
||||
writer->Write(code->safepoint_table_offset());
|
||||
|
@ -461,7 +461,6 @@ FRAME_MARKERS = (
|
||||
"WASM_COMPILED",
|
||||
"WASM_TO_JS",
|
||||
"JS_TO_WASM",
|
||||
"WASM_INTERPRETER_ENTRY",
|
||||
"WASM_DEBUG_BREAK",
|
||||
"C_WASM_ENTRY",
|
||||
"WASM_EXIT",
|
||||
|
Loading…
Reference in New Issue
Block a user