| OLD | NEW |
| 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 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 } | 650 } |
| 651 | 651 |
| 652 Handle<Object> WasmStackFrame::GetFunction() const { | 652 Handle<Object> WasmStackFrame::GetFunction() const { |
| 653 Handle<Object> obj(Smi::FromInt(wasm_func_index_), isolate_); | 653 Handle<Object> obj(Smi::FromInt(wasm_func_index_), isolate_); |
| 654 return obj; | 654 return obj; |
| 655 } | 655 } |
| 656 | 656 |
| 657 Handle<Object> WasmStackFrame::GetFunctionName() { | 657 Handle<Object> WasmStackFrame::GetFunctionName() { |
| 658 Handle<Object> name; | 658 Handle<Object> name; |
| 659 Handle<WasmCompiledModule> compiled_module( | 659 Handle<WasmCompiledModule> compiled_module( |
| 660 Handle<WasmInstanceObject>::cast(wasm_instance_)->get_compiled_module(), | 660 Handle<WasmInstanceObject>::cast(wasm_instance_)->compiled_module(), |
| 661 isolate_); | 661 isolate_); |
| 662 if (!WasmCompiledModule::GetFunctionNameOrNull(isolate_, compiled_module, | 662 if (!WasmCompiledModule::GetFunctionNameOrNull(isolate_, compiled_module, |
| 663 wasm_func_index_) | 663 wasm_func_index_) |
| 664 .ToHandle(&name)) { | 664 .ToHandle(&name)) { |
| 665 name = isolate_->factory()->null_value(); | 665 name = isolate_->factory()->null_value(); |
| 666 } | 666 } |
| 667 return name; | 667 return name; |
| 668 } | 668 } |
| 669 | 669 |
| 670 MaybeHandle<String> WasmStackFrame::ToString() { | 670 MaybeHandle<String> WasmStackFrame::ToString() { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 697 return (offset_ < 0) ? (-1 - offset_) : code_->SourcePosition(offset_); | 697 return (offset_ < 0) ? (-1 - offset_) : code_->SourcePosition(offset_); |
| 698 } | 698 } |
| 699 | 699 |
| 700 Handle<Object> WasmStackFrame::Null() const { | 700 Handle<Object> WasmStackFrame::Null() const { |
| 701 return isolate_->factory()->null_value(); | 701 return isolate_->factory()->null_value(); |
| 702 } | 702 } |
| 703 | 703 |
| 704 bool WasmStackFrame::HasScript() const { return true; } | 704 bool WasmStackFrame::HasScript() const { return true; } |
| 705 | 705 |
| 706 Handle<Script> WasmStackFrame::GetScript() const { | 706 Handle<Script> WasmStackFrame::GetScript() const { |
| 707 return WasmInstanceObject::cast(*wasm_instance_) | 707 return handle( |
| 708 ->get_compiled_module() | 708 WasmInstanceObject::cast(*wasm_instance_)->compiled_module()->script(), |
| 709 ->script(); | 709 isolate_); |
| 710 } | 710 } |
| 711 | 711 |
| 712 AsmJsWasmStackFrame::AsmJsWasmStackFrame() {} | 712 AsmJsWasmStackFrame::AsmJsWasmStackFrame() {} |
| 713 | 713 |
| 714 void AsmJsWasmStackFrame::FromFrameArray(Isolate* isolate, | 714 void AsmJsWasmStackFrame::FromFrameArray(Isolate* isolate, |
| 715 Handle<FrameArray> array, | 715 Handle<FrameArray> array, |
| 716 int frame_ix) { | 716 int frame_ix) { |
| 717 DCHECK(array->IsAsmJsWasmFrame(frame_ix)); | 717 DCHECK(array->IsAsmJsWasmFrame(frame_ix)); |
| 718 WasmStackFrame::FromFrameArray(isolate, array, frame_ix); | 718 WasmStackFrame::FromFrameArray(isolate, array, frame_ix); |
| 719 is_at_number_conversion_ = | 719 is_at_number_conversion_ = |
| (...skipping 20 matching lines...) Expand all Loading... |
| 740 Handle<Script> script = | 740 Handle<Script> script = |
| 741 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_)); | 741 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_)); |
| 742 DCHECK_EQ(Script::TYPE_NORMAL, script->type()); | 742 DCHECK_EQ(Script::TYPE_NORMAL, script->type()); |
| 743 return ScriptNameOrSourceUrl(script, isolate_); | 743 return ScriptNameOrSourceUrl(script, isolate_); |
| 744 } | 744 } |
| 745 | 745 |
| 746 int AsmJsWasmStackFrame::GetPosition() const { | 746 int AsmJsWasmStackFrame::GetPosition() const { |
| 747 DCHECK_LE(0, offset_); | 747 DCHECK_LE(0, offset_); |
| 748 int byte_offset = code_->SourcePosition(offset_); | 748 int byte_offset = code_->SourcePosition(offset_); |
| 749 Handle<WasmCompiledModule> compiled_module( | 749 Handle<WasmCompiledModule> compiled_module( |
| 750 WasmInstanceObject::cast(*wasm_instance_)->get_compiled_module(), | 750 WasmInstanceObject::cast(*wasm_instance_)->compiled_module(), isolate_); |
| 751 isolate_); | |
| 752 DCHECK_LE(0, byte_offset); | 751 DCHECK_LE(0, byte_offset); |
| 753 return WasmCompiledModule::GetAsmJsSourcePosition( | 752 return WasmCompiledModule::GetAsmJsSourcePosition( |
| 754 compiled_module, wasm_func_index_, static_cast<uint32_t>(byte_offset), | 753 compiled_module, wasm_func_index_, static_cast<uint32_t>(byte_offset), |
| 755 is_at_number_conversion_); | 754 is_at_number_conversion_); |
| 756 } | 755 } |
| 757 | 756 |
| 758 int AsmJsWasmStackFrame::GetLineNumber() { | 757 int AsmJsWasmStackFrame::GetLineNumber() { |
| 759 DCHECK_LE(0, GetPosition()); | 758 DCHECK_LE(0, GetPosition()); |
| 760 Handle<Script> script = | 759 Handle<Script> script = |
| 761 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_)); | 760 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_)); |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1232 DCHECK(mode != SKIP_UNTIL_SEEN); | 1231 DCHECK(mode != SKIP_UNTIL_SEEN); |
| 1233 | 1232 |
| 1234 Handle<Object> no_caller; | 1233 Handle<Object> no_caller; |
| 1235 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2); | 1234 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2); |
| 1236 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode, | 1235 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode, |
| 1237 no_caller, false); | 1236 no_caller, false); |
| 1238 } | 1237 } |
| 1239 | 1238 |
| 1240 } // namespace internal | 1239 } // namespace internal |
| 1241 } // namespace v8 | 1240 } // namespace v8 |
| OLD | NEW |