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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 673 } |
674 | 674 |
675 int WasmStackFrame::GetPosition() const { | 675 int WasmStackFrame::GetPosition() const { |
676 return (offset_ < 0) ? (-1 - offset_) : code_->SourcePosition(offset_); | 676 return (offset_ < 0) ? (-1 - offset_) : code_->SourcePosition(offset_); |
677 } | 677 } |
678 | 678 |
679 Handle<Object> WasmStackFrame::Null() const { | 679 Handle<Object> WasmStackFrame::Null() const { |
680 return isolate_->factory()->null_value(); | 680 return isolate_->factory()->null_value(); |
681 } | 681 } |
682 | 682 |
| 683 void AsmJsWasmStackFrame::FromFrameArray(Isolate* isolate, |
| 684 Handle<FrameArray> array, |
| 685 int frame_ix) { |
| 686 DCHECK(array->IsAsmJsWasmFrame(frame_ix)); |
| 687 WasmStackFrame::FromFrameArray(isolate, array, frame_ix); |
| 688 is_at_number_conversion_ = |
| 689 array->Flags(frame_ix)->value() & FrameArray::kAsmJsAtNumberConversion; |
| 690 } |
| 691 |
683 Handle<Object> AsmJsWasmStackFrame::GetReceiver() const { | 692 Handle<Object> AsmJsWasmStackFrame::GetReceiver() const { |
684 return isolate_->global_proxy(); | 693 return isolate_->global_proxy(); |
685 } | 694 } |
686 | 695 |
687 Handle<Object> AsmJsWasmStackFrame::GetFunction() const { | 696 Handle<Object> AsmJsWasmStackFrame::GetFunction() const { |
688 // TODO(clemensh): Return lazily created JSFunction. | 697 // TODO(clemensh): Return lazily created JSFunction. |
689 return Null(); | 698 return Null(); |
690 } | 699 } |
691 | 700 |
692 Handle<Object> AsmJsWasmStackFrame::GetFileName() { | 701 Handle<Object> AsmJsWasmStackFrame::GetFileName() { |
(...skipping 11 matching lines...) Expand all Loading... |
704 } | 713 } |
705 | 714 |
706 int AsmJsWasmStackFrame::GetPosition() const { | 715 int AsmJsWasmStackFrame::GetPosition() const { |
707 DCHECK_LE(0, offset_); | 716 DCHECK_LE(0, offset_); |
708 int byte_offset = code_->SourcePosition(offset_); | 717 int byte_offset = code_->SourcePosition(offset_); |
709 Handle<WasmCompiledModule> compiled_module( | 718 Handle<WasmCompiledModule> compiled_module( |
710 WasmInstanceObject::cast(*wasm_instance_)->get_compiled_module(), | 719 WasmInstanceObject::cast(*wasm_instance_)->get_compiled_module(), |
711 isolate_); | 720 isolate_); |
712 DCHECK_LE(0, byte_offset); | 721 DCHECK_LE(0, byte_offset); |
713 return WasmCompiledModule::GetAsmJsSourcePosition( | 722 return WasmCompiledModule::GetAsmJsSourcePosition( |
714 compiled_module, wasm_func_index_, static_cast<uint32_t>(byte_offset)); | 723 compiled_module, wasm_func_index_, static_cast<uint32_t>(byte_offset), |
| 724 is_at_number_conversion_); |
715 } | 725 } |
716 | 726 |
717 int AsmJsWasmStackFrame::GetLineNumber() { | 727 int AsmJsWasmStackFrame::GetLineNumber() { |
718 DCHECK_LE(0, GetPosition()); | 728 DCHECK_LE(0, GetPosition()); |
719 Handle<Script> script = | 729 Handle<Script> script = |
720 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_)); | 730 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_)); |
721 DCHECK_EQ(Script::TYPE_NORMAL, script->type()); | 731 DCHECK_EQ(Script::TYPE_NORMAL, script->type()); |
722 return Script::GetLineNumber(script, GetPosition()) + 1; | 732 return Script::GetLineNumber(script, GetPosition()) + 1; |
723 } | 733 } |
724 | 734 |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 DCHECK(mode != SKIP_UNTIL_SEEN); | 1201 DCHECK(mode != SKIP_UNTIL_SEEN); |
1192 | 1202 |
1193 Handle<Object> no_caller; | 1203 Handle<Object> no_caller; |
1194 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2); | 1204 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2); |
1195 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode, | 1205 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode, |
1196 no_caller, false); | 1206 no_caller, false); |
1197 } | 1207 } |
1198 | 1208 |
1199 } // namespace internal | 1209 } // namespace internal |
1200 } // namespace v8 | 1210 } // namespace v8 |
OLD | NEW |