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

Side by Side Diff: src/runtime/runtime-internal.cc

Issue 2071563002: [wasm] Make reported "column number" 1-based (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@decode-function-offsets-table
Patch Set: Created 4 years, 6 months 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/isolate.cc ('k') | test/cctest/wasm/test-wasm-stack.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/ast/prettyprinter.h" 8 #include "src/ast/prettyprinter.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/conversions.h" 10 #include "src/conversions.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 FixedArray::cast(JSArray::cast(*detailed_stack_trace_obj)->elements())); 134 FixedArray::cast(JSArray::cast(*detailed_stack_trace_obj)->elements()));
135 DCHECK_GE(stack_elements->length(), 1); 135 DCHECK_GE(stack_elements->length(), 1);
136 Handle<JSObject> top_frame(JSObject::cast(stack_elements->get(0))); 136 Handle<JSObject> top_frame(JSObject::cast(stack_elements->get(0)));
137 Handle<String> wasm_offset_key = 137 Handle<String> wasm_offset_key =
138 isolate->factory()->InternalizeOneByteString( 138 isolate->factory()->InternalizeOneByteString(
139 STATIC_CHAR_VECTOR("column")); 139 STATIC_CHAR_VECTOR("column"));
140 LookupIterator it(top_frame, wasm_offset_key, top_frame, 140 LookupIterator it(top_frame, wasm_offset_key, top_frame,
141 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR); 141 LookupIterator::PROTOTYPE_CHAIN_SKIP_INTERCEPTOR);
142 if (it.IsFound()) { 142 if (it.IsFound()) {
143 DCHECK(JSReceiver::GetDataProperty(&it)->IsSmi()); 143 DCHECK(JSReceiver::GetDataProperty(&it)->IsSmi());
144 // Make column number 1-based here.
144 Maybe<bool> data_set = JSReceiver::SetDataProperty( 145 Maybe<bool> data_set = JSReceiver::SetDataProperty(
145 &it, handle(Smi::FromInt(byte_offset), isolate)); 146 &it, handle(Smi::FromInt(byte_offset + 1), isolate));
146 DCHECK(data_set.IsJust() && data_set.FromJust() == true); 147 DCHECK(data_set.IsJust() && data_set.FromJust() == true);
147 USE(data_set); 148 USE(data_set);
148 } 149 }
149 } 150 }
150 151
151 return isolate->Throw(*error_obj); 152 return isolate->Throw(*error_obj);
152 } 153 }
153 154
154 RUNTIME_FUNCTION(Runtime_UnwindAndFindExceptionHandler) { 155 RUNTIME_FUNCTION(Runtime_UnwindAndFindExceptionHandler) {
155 SealHandleScope shs(isolate); 156 SealHandleScope shs(isolate);
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 HandleScope scope(isolate); 620 HandleScope scope(isolate);
620 DCHECK_EQ(1, args.length()); 621 DCHECK_EQ(1, args.length());
621 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); 622 CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
622 bool is_wasm_object = object->IsJSObject() && 623 bool is_wasm_object = object->IsJSObject() &&
623 wasm::IsWasmObject(Handle<JSObject>::cast(object)); 624 wasm::IsWasmObject(Handle<JSObject>::cast(object));
624 return *isolate->factory()->ToBoolean(is_wasm_object); 625 return *isolate->factory()->ToBoolean(is_wasm_object);
625 } 626 }
626 627
627 } // namespace internal 628 } // namespace internal
628 } // namespace v8 629 } // namespace v8
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | test/cctest/wasm/test-wasm-stack.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698