Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: src/frames.cc

Issue 2551053002: [wasm] Always provide a wasm instance object at runtime (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/frames.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index b171a33eacd3bf001797526c8ee5959ed2b34e22..eb06ac23b6a36ed1b0d9a726e7651760a9377924 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1558,10 +1558,11 @@ Address WasmFrame::GetCallerStackPointer() const {
return fp() + ExitFrameConstants::kCallerSPOffset;
}
-Object* WasmFrame::wasm_instance() const {
+WasmInstanceObject* WasmFrame::wasm_instance() const {
Object* ret = wasm::GetOwningWasmInstance(LookupCode());
- if (ret == nullptr) ret = isolate()->heap()->undefined_value();
- return ret;
+ // This is a live stack frame, there must be a live wasm instance available.
+ DCHECK_NOT_NULL(ret);
+ return WasmInstanceObject::cast(ret);
}
uint32_t WasmFrame::function_index() const {
@@ -1577,7 +1578,7 @@ Script* WasmFrame::script() const {
int WasmFrame::position() const {
int position = StandardFrame::position();
- if (wasm::WasmIsAsmJs(wasm_instance(), isolate())) {
+ if (wasm_instance()->get_compiled_module()->is_asm_js()) {
Handle<WasmCompiledModule> compiled_module(
WasmInstanceObject::cast(wasm_instance())->get_compiled_module(),
isolate());
« no previous file with comments | « src/frames.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698