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

Side by Side Diff: src/messages.cc

Issue 2522953002: [wasm] Move asm.js offset table to compiled module (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 unified diff | Download patch
« no previous file with comments | « src/frames.cc ('k') | src/wasm/wasm-debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/messages.h" 5 #include "src/messages.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/execution.h" 10 #include "src/execution.h"
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 Handle<Object> AsmJsWasmStackFrame::GetScriptNameOrSourceUrl() { 699 Handle<Object> AsmJsWasmStackFrame::GetScriptNameOrSourceUrl() {
700 Handle<Script> script = 700 Handle<Script> script =
701 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_)); 701 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_));
702 DCHECK_EQ(Script::TYPE_NORMAL, script->type()); 702 DCHECK_EQ(Script::TYPE_NORMAL, script->type());
703 return ScriptNameOrSourceUrl(script, isolate_); 703 return ScriptNameOrSourceUrl(script, isolate_);
704 } 704 }
705 705
706 int AsmJsWasmStackFrame::GetPosition() const { 706 int AsmJsWasmStackFrame::GetPosition() const {
707 DCHECK_LE(0, offset_); 707 DCHECK_LE(0, offset_);
708 int byte_offset = code_->SourcePosition(offset_); 708 int byte_offset = code_->SourcePosition(offset_);
709 return wasm::GetAsmWasmSourcePosition(Handle<JSObject>::cast(wasm_instance_), 709 Handle<WasmCompiledModule> compiled_module(
710 wasm_func_index_, byte_offset); 710 WasmInstanceObject::cast(*wasm_instance_)->get_compiled_module(),
711 isolate_);
712 DCHECK_LE(0, byte_offset);
713 return WasmCompiledModule::GetAsmJsSourcePosition(
714 compiled_module, wasm_func_index_, static_cast<uint32_t>(byte_offset));
711 } 715 }
712 716
713 int AsmJsWasmStackFrame::GetLineNumber() { 717 int AsmJsWasmStackFrame::GetLineNumber() {
714 DCHECK_LE(0, GetPosition()); 718 DCHECK_LE(0, GetPosition());
715 Handle<Script> script = 719 Handle<Script> script =
716 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_)); 720 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_));
717 DCHECK_EQ(Script::TYPE_NORMAL, script->type()); 721 DCHECK_EQ(Script::TYPE_NORMAL, script->type());
718 return Script::GetLineNumber(script, GetPosition()) + 1; 722 return Script::GetLineNumber(script, GetPosition()) + 1;
719 } 723 }
720 724
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 DCHECK(mode != SKIP_UNTIL_SEEN); 1191 DCHECK(mode != SKIP_UNTIL_SEEN);
1188 1192
1189 Handle<Object> no_caller; 1193 Handle<Object> no_caller;
1190 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2); 1194 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2);
1191 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode, 1195 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode,
1192 no_caller, false); 1196 no_caller, false);
1193 } 1197 }
1194 1198
1195 } // namespace internal 1199 } // namespace internal
1196 } // namespace v8 1200 } // namespace v8
OLDNEW
« no previous file with comments | « src/frames.cc ('k') | src/wasm/wasm-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698