OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/frames.h" | 5 #include "src/frames.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopeinfo.h" | 10 #include "src/ast/scopeinfo.h" |
11 #include "src/base/bits.h" | 11 #include "src/base/bits.h" |
12 #include "src/deoptimizer.h" | 12 #include "src/deoptimizer.h" |
13 #include "src/frames-inl.h" | 13 #include "src/frames-inl.h" |
14 #include "src/full-codegen/full-codegen.h" | 14 #include "src/full-codegen/full-codegen.h" |
15 #include "src/register-configuration.h" | 15 #include "src/register-configuration.h" |
16 #include "src/safepoint-table.h" | 16 #include "src/safepoint-table.h" |
17 #include "src/string-stream.h" | 17 #include "src/string-stream.h" |
18 #include "src/vm-state-inl.h" | 18 #include "src/vm-state-inl.h" |
19 #include "src/wasm/wasm-module.h" | |
20 | 19 |
21 namespace v8 { | 20 namespace v8 { |
22 namespace internal { | 21 namespace internal { |
23 | 22 |
24 ReturnAddressLocationResolver | 23 ReturnAddressLocationResolver |
25 StackFrame::return_address_location_resolver_ = NULL; | 24 StackFrame::return_address_location_resolver_ = NULL; |
26 | 25 |
27 | 26 |
28 // Iterator that supports traversing the stack handlers of a | 27 // Iterator that supports traversing the stack handlers of a |
29 // particular frame. Needs to know the top of the handler chain. | 28 // particular frame. Needs to know the top of the handler chain. |
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 Object* func_index_obj = deopt_data->get(1); | 1347 Object* func_index_obj = deopt_data->get(1); |
1349 if (func_index_obj->IsUndefined()) return static_cast<uint32_t>(-1); | 1348 if (func_index_obj->IsUndefined()) return static_cast<uint32_t>(-1); |
1350 if (func_index_obj->IsSmi()) return Smi::cast(func_index_obj)->value(); | 1349 if (func_index_obj->IsSmi()) return Smi::cast(func_index_obj)->value(); |
1351 DCHECK(func_index_obj->IsHeapNumber()); | 1350 DCHECK(func_index_obj->IsHeapNumber()); |
1352 uint32_t val = static_cast<uint32_t>(-1); | 1351 uint32_t val = static_cast<uint32_t>(-1); |
1353 func_index_obj->ToUint32(&val); | 1352 func_index_obj->ToUint32(&val); |
1354 DCHECK(val != static_cast<uint32_t>(-1)); | 1353 DCHECK(val != static_cast<uint32_t>(-1)); |
1355 return val; | 1354 return val; |
1356 } | 1355 } |
1357 | 1356 |
1358 Object* WasmFrame::function_name() { | |
1359 Object* wasm_object = wasm_obj(); | |
1360 if (wasm_object->IsUndefined()) return wasm_object; | |
1361 Handle<JSObject> wasm = handle(JSObject::cast(wasm_object)); | |
1362 return *wasm::GetWasmFunctionName(wasm, function_index()); | |
1363 } | |
1364 | |
1365 namespace { | 1357 namespace { |
1366 | 1358 |
1367 | 1359 |
1368 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared, | 1360 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared, |
1369 Code* code) { | 1361 Code* code) { |
1370 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) { | 1362 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) { |
1371 std::ostringstream os; | 1363 std::ostringstream os; |
1372 os << "--------- s o u r c e c o d e ---------\n" | 1364 os << "--------- s o u r c e c o d e ---------\n" |
1373 << SourceCodeOf(shared, FLAG_max_stack_trace_source_length) | 1365 << SourceCodeOf(shared, FLAG_max_stack_trace_source_length) |
1374 << "\n-----------------------------------------\n"; | 1366 << "\n-----------------------------------------\n"; |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1792 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1784 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1793 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1785 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1794 list.Add(frame, zone); | 1786 list.Add(frame, zone); |
1795 } | 1787 } |
1796 return list.ToVector(); | 1788 return list.ToVector(); |
1797 } | 1789 } |
1798 | 1790 |
1799 | 1791 |
1800 } // namespace internal | 1792 } // namespace internal |
1801 } // namespace v8 | 1793 } // namespace v8 |
OLD | NEW |