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" |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1348 Object* func_index_obj = deopt_data->get(1); | 1348 Object* func_index_obj = deopt_data->get(1); |
1349 if (func_index_obj->IsUndefined()) return static_cast<uint32_t>(-1); | 1349 if (func_index_obj->IsUndefined()) return static_cast<uint32_t>(-1); |
1350 if (func_index_obj->IsSmi()) return Smi::cast(func_index_obj)->value(); | 1350 if (func_index_obj->IsSmi()) return Smi::cast(func_index_obj)->value(); |
1351 DCHECK(func_index_obj->IsHeapNumber()); | 1351 DCHECK(func_index_obj->IsHeapNumber()); |
1352 uint32_t val = static_cast<uint32_t>(-1); | 1352 uint32_t val = static_cast<uint32_t>(-1); |
1353 func_index_obj->ToUint32(&val); | 1353 func_index_obj->ToUint32(&val); |
1354 DCHECK(val != static_cast<uint32_t>(-1)); | 1354 DCHECK(val != static_cast<uint32_t>(-1)); |
1355 return val; | 1355 return val; |
1356 } | 1356 } |
1357 | 1357 |
1358 Object* WasmFrame::function_name() { | 1358 String* WasmFrame::function_name() { |
1359 Object* wasm_object = wasm_obj(); | 1359 Object* wasm_object = wasm_obj(); |
1360 if (wasm_object->IsUndefined()) return wasm_object; | 1360 if (wasm_object->IsUndefined()) return nullptr; |
1361 Handle<JSObject> wasm = handle(JSObject::cast(wasm_object)); | 1361 Handle<JSObject> wasm = handle(JSObject::cast(wasm_object)); |
1362 return *wasm::GetWasmFunctionName(wasm, function_index()); | 1362 MaybeHandle<String> name = wasm::GetWasmFunctionName(wasm, function_index()); |
1363 return name.is_null() ? nullptr : *name.ToHandleChecked(); | |
Yang
2016/05/18 13:38:48
This whole method seems to have only one user. Why
Clemens Hammacher
2016/05/18 17:44:06
Makes sense. Done.
| |
1363 } | 1364 } |
1364 | 1365 |
1365 namespace { | 1366 namespace { |
1366 | 1367 |
1367 | 1368 |
1368 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared, | 1369 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared, |
1369 Code* code) { | 1370 Code* code) { |
1370 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) { | 1371 if (FLAG_max_stack_trace_source_length != 0 && code != NULL) { |
1371 std::ostringstream os; | 1372 std::ostringstream os; |
1372 os << "--------- s o u r c e c o d e ---------\n" | 1373 os << "--------- s o u r c e c o d e ---------\n" |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1792 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1793 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1793 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1794 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1794 list.Add(frame, zone); | 1795 list.Add(frame, zone); |
1795 } | 1796 } |
1796 return list.ToVector(); | 1797 return list.ToVector(); |
1797 } | 1798 } |
1798 | 1799 |
1799 | 1800 |
1800 } // namespace internal | 1801 } // namespace internal |
1801 } // namespace v8 | 1802 } // namespace v8 |
OLD | NEW |