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

Unified Diff: src/messages.cc

Issue 2493823003: [wasm] Allocate a single script per wasm module (Closed)
Patch Set: rebase 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/messages.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index 141a9ad315edf7dc64db1c30824115a8ca4bb880..eea77e34d88a404d727da16bcdd8eadaddd3bd94 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -12,6 +12,7 @@
#include "src/keys.h"
#include "src/string-builder.h"
#include "src/wasm/wasm-module.h"
+#include "src/wasm/wasm-objects.h"
namespace v8 {
namespace internal {
@@ -635,8 +636,15 @@ Handle<Object> WasmStackFrame::GetFunction() const {
}
Handle<Object> WasmStackFrame::GetFunctionName() {
- return wasm::GetWasmFunctionNameOrNull(isolate_, wasm_instance_,
- wasm_func_index_);
+ Handle<Object> name;
+ Handle<WasmCompiledModule> compiled_module(
+ Handle<WasmInstanceObject>::cast(wasm_instance_)->get_compiled_module(),
+ isolate_);
+ if (!WasmCompiledModule::GetFunctionName(compiled_module, wasm_func_index_)
+ .ToHandle(&name)) {
+ name = isolate_->factory()->null_value();
+ }
+ return name;
}
MaybeHandle<String> WasmStackFrame::ToString() {
@@ -683,18 +691,15 @@ Handle<Object> AsmJsWasmStackFrame::GetFunction() const {
Handle<Object> AsmJsWasmStackFrame::GetFileName() {
Handle<Script> script =
- wasm::GetAsmWasmScript(Handle<JSObject>::cast(wasm_instance_));
+ wasm::GetScript(Handle<JSObject>::cast(wasm_instance_));
+ DCHECK_EQ(Script::TYPE_NORMAL, script->type());
return handle(script->name(), isolate_);
}
-Handle<Object> AsmJsWasmStackFrame::GetFunctionName() {
- return wasm::GetWasmFunctionNameOrNull(isolate_, wasm_instance_,
- wasm_func_index_);
-}
-
Handle<Object> AsmJsWasmStackFrame::GetScriptNameOrSourceUrl() {
Handle<Script> script =
- wasm::GetAsmWasmScript(Handle<JSObject>::cast(wasm_instance_));
+ wasm::GetScript(Handle<JSObject>::cast(wasm_instance_));
+ DCHECK_EQ(Script::TYPE_NORMAL, script->type());
return ScriptNameOrSourceUrl(script, isolate_);
}
@@ -708,14 +713,16 @@ int AsmJsWasmStackFrame::GetPosition() const {
int AsmJsWasmStackFrame::GetLineNumber() {
DCHECK_LE(0, GetPosition());
Handle<Script> script =
- wasm::GetAsmWasmScript(Handle<JSObject>::cast(wasm_instance_));
+ wasm::GetScript(Handle<JSObject>::cast(wasm_instance_));
+ DCHECK_EQ(Script::TYPE_NORMAL, script->type());
return Script::GetLineNumber(script, GetPosition()) + 1;
}
int AsmJsWasmStackFrame::GetColumnNumber() {
DCHECK_LE(0, GetPosition());
Handle<Script> script =
- wasm::GetAsmWasmScript(Handle<JSObject>::cast(wasm_instance_));
+ wasm::GetScript(Handle<JSObject>::cast(wasm_instance_));
+ DCHECK_EQ(Script::TYPE_NORMAL, script->type());
return Script::GetColumnNumber(script, GetPosition()) + 1;
}
« no previous file with comments | « src/messages.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698