OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/compiler/wasm-compiler.h" | 9 #include "src/compiler/wasm-compiler.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 FrameArray::cast(JSArray::cast(*stack_trace_obj)->elements())); | 92 FrameArray::cast(JSArray::cast(*stack_trace_obj)->elements())); |
93 DCHECK(stack_elements->Code(0)->kind() == AbstractCode::WASM_FUNCTION); | 93 DCHECK(stack_elements->Code(0)->kind() == AbstractCode::WASM_FUNCTION); |
94 DCHECK(stack_elements->Offset(0)->value() >= 0); | 94 DCHECK(stack_elements->Offset(0)->value() >= 0); |
95 stack_elements->SetOffset(0, Smi::FromInt(-1 - byte_offset)); | 95 stack_elements->SetOffset(0, Smi::FromInt(-1 - byte_offset)); |
96 } | 96 } |
97 | 97 |
98 // Patch the detailed stack trace (array of JSObjects with various | 98 // Patch the detailed stack trace (array of JSObjects with various |
99 // properties). | 99 // properties). |
100 Handle<Object> detailed_stack_trace_obj = JSReceiver::GetDataProperty( | 100 Handle<Object> detailed_stack_trace_obj = JSReceiver::GetDataProperty( |
101 error, isolate->factory()->detailed_stack_trace_symbol()); | 101 error, isolate->factory()->detailed_stack_trace_symbol()); |
102 if (detailed_stack_trace_obj->IsJSArray()) { | 102 if (detailed_stack_trace_obj->IsFixedArray()) { |
103 Handle<FixedArray> stack_elements( | 103 Handle<FixedArray> stack_elements( |
104 FixedArray::cast(JSArray::cast(*detailed_stack_trace_obj)->elements())); | 104 FixedArray::cast(*detailed_stack_trace_obj)); |
105 DCHECK_GE(stack_elements->length(), 1); | 105 DCHECK_GE(stack_elements->length(), 1); |
106 Handle<StackFrameInfo> top_frame( | 106 Handle<StackFrameInfo> top_frame( |
107 StackFrameInfo::cast(stack_elements->get(0))); | 107 StackFrameInfo::cast(stack_elements->get(0))); |
108 if (top_frame->column_number()) { | 108 if (top_frame->column_number()) { |
109 top_frame->set_column_number(byte_offset + 1); | 109 top_frame->set_column_number(byte_offset + 1); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 return isolate->Throw(*error_obj); | 113 return isolate->Throw(*error_obj); |
114 } | 114 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 RUNTIME_FUNCTION(Runtime_WasmCompileLazy) { | 245 RUNTIME_FUNCTION(Runtime_WasmCompileLazy) { |
246 DCHECK(args.length() == 0); | 246 DCHECK(args.length() == 0); |
247 HandleScope scope(isolate); | 247 HandleScope scope(isolate); |
248 | 248 |
249 return *wasm::CompileLazy(isolate); | 249 return *wasm::CompileLazy(isolate); |
250 } | 250 } |
251 | 251 |
252 } // namespace internal | 252 } // namespace internal |
253 } // namespace v8 | 253 } // namespace v8 |
OLD | NEW |