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

Unified Diff: src/isolate.cc

Issue 2493823003: [wasm] Allocate a single script per wasm module (Closed)
Patch Set: Fix signed/unsigned issues Created 4 years, 1 month 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/inspector/v8-debugger.cc ('k') | src/messages.h » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index b0139a70a68e4fc4f32bdf94c4833cc233087986..7e87b28b7f5921ccce62ecc2f63dc153ee8cdffa 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -701,9 +701,17 @@ class CaptureStackTraceHelper {
factory()->NewJSObject(isolate_->object_function());
if (!function_key_.is_null()) {
- Handle<String> name = wasm::GetWasmFunctionName(
- isolate_, handle(frame->wasm_instance(), isolate_),
- frame->function_index());
+ // TODO(wasm): We should always have a wasm instance available (bug 5620).
+ Handle<Object> instance(frame->wasm_instance(), isolate_);
+ Handle<Object> compiled_module;
+ if (instance->IsUndefined(isolate_)) {
+ compiled_module = instance; // undefined
+ } else {
+ compiled_module = handle(
+ wasm::GetCompiledModule(JSObject::cast(*instance)), isolate_);
+ }
+ Handle<String> name = wasm::GetWasmFunctionName(isolate_, compiled_module,
+ frame->function_index());
JSObject::AddProperty(stack_frame, function_key_, name, NONE);
}
// Encode the function index as line number.
« no previous file with comments | « src/inspector/v8-debugger.cc ('k') | src/messages.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698