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

Side by Side Diff: src/messages.cc

Issue 2563613003: Revert of [wasm] Fix location for error in asm.js ToNumber conversion (Closed)
Patch Set: 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/messages.h ('k') | src/objects.h » ('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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
692 Handle<Object> AsmJsWasmStackFrame::GetReceiver() const { 683 Handle<Object> AsmJsWasmStackFrame::GetReceiver() const {
693 return isolate_->global_proxy(); 684 return isolate_->global_proxy();
694 } 685 }
695 686
696 Handle<Object> AsmJsWasmStackFrame::GetFunction() const { 687 Handle<Object> AsmJsWasmStackFrame::GetFunction() const {
697 // TODO(clemensh): Return lazily created JSFunction. 688 // TODO(clemensh): Return lazily created JSFunction.
698 return Null(); 689 return Null();
699 } 690 }
700 691
701 Handle<Object> AsmJsWasmStackFrame::GetFileName() { 692 Handle<Object> AsmJsWasmStackFrame::GetFileName() {
(...skipping 11 matching lines...) Expand all
713 } 704 }
714 705
715 int AsmJsWasmStackFrame::GetPosition() const { 706 int AsmJsWasmStackFrame::GetPosition() const {
716 DCHECK_LE(0, offset_); 707 DCHECK_LE(0, offset_);
717 int byte_offset = code_->SourcePosition(offset_); 708 int byte_offset = code_->SourcePosition(offset_);
718 Handle<WasmCompiledModule> compiled_module( 709 Handle<WasmCompiledModule> compiled_module(
719 WasmInstanceObject::cast(*wasm_instance_)->get_compiled_module(), 710 WasmInstanceObject::cast(*wasm_instance_)->get_compiled_module(),
720 isolate_); 711 isolate_);
721 DCHECK_LE(0, byte_offset); 712 DCHECK_LE(0, byte_offset);
722 return WasmCompiledModule::GetAsmJsSourcePosition( 713 return WasmCompiledModule::GetAsmJsSourcePosition(
723 compiled_module, wasm_func_index_, static_cast<uint32_t>(byte_offset), 714 compiled_module, wasm_func_index_, static_cast<uint32_t>(byte_offset));
724 is_at_number_conversion_);
725 } 715 }
726 716
727 int AsmJsWasmStackFrame::GetLineNumber() { 717 int AsmJsWasmStackFrame::GetLineNumber() {
728 DCHECK_LE(0, GetPosition()); 718 DCHECK_LE(0, GetPosition());
729 Handle<Script> script = 719 Handle<Script> script =
730 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_)); 720 wasm::GetScript(Handle<JSObject>::cast(wasm_instance_));
731 DCHECK_EQ(Script::TYPE_NORMAL, script->type()); 721 DCHECK_EQ(Script::TYPE_NORMAL, script->type());
732 return Script::GetLineNumber(script, GetPosition()) + 1; 722 return Script::GetLineNumber(script, GetPosition()) + 1;
733 } 723 }
734 724
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 DCHECK(mode != SKIP_UNTIL_SEEN); 1191 DCHECK(mode != SKIP_UNTIL_SEEN);
1202 1192
1203 Handle<Object> no_caller; 1193 Handle<Object> no_caller;
1204 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2); 1194 Handle<String> msg = FormatMessage(isolate, template_index, arg0, arg1, arg2);
1205 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode, 1195 return ErrorUtils::Construct(isolate, constructor, constructor, msg, mode,
1206 no_caller, false); 1196 no_caller, false);
1207 } 1197 }
1208 1198
1209 } // namespace internal 1199 } // namespace internal
1210 } // namespace v8 1200 } // namespace v8
OLDNEW
« 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