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 <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1454 return static_cast<Code*>(isolate()->FindCodeObject(pc())); | 1454 return static_cast<Code*>(isolate()->FindCodeObject(pc())); |
1455 } | 1455 } |
1456 | 1456 |
1457 void WasmFrame::Iterate(ObjectVisitor* v) const { IterateCompiledFrame(v); } | 1457 void WasmFrame::Iterate(ObjectVisitor* v) const { IterateCompiledFrame(v); } |
1458 | 1458 |
1459 Address WasmFrame::GetCallerStackPointer() const { | 1459 Address WasmFrame::GetCallerStackPointer() const { |
1460 return fp() + ExitFrameConstants::kCallerSPOffset; | 1460 return fp() + ExitFrameConstants::kCallerSPOffset; |
1461 } | 1461 } |
1462 | 1462 |
1463 Object* WasmFrame::wasm_obj() const { | 1463 Object* WasmFrame::wasm_obj() const { |
1464 return wasm::GetOwningWasmInstance(*isolate()->factory()->undefined_value(), | 1464 Object* ret = wasm::GetOwningWasmInstance(LookupCode()); |
1465 LookupCode()); | 1465 if (ret == nullptr) ret = *(isolate()->factory()->undefined_value()); |
| 1466 return ret; |
1466 } | 1467 } |
1467 | 1468 |
1468 uint32_t WasmFrame::function_index() const { | 1469 uint32_t WasmFrame::function_index() const { |
1469 FixedArray* deopt_data = LookupCode()->deoptimization_data(); | 1470 FixedArray* deopt_data = LookupCode()->deoptimization_data(); |
1470 DCHECK(deopt_data->length() == 2); | 1471 DCHECK(deopt_data->length() == 2); |
1471 return Smi::cast(deopt_data->get(1))->value(); | 1472 return Smi::cast(deopt_data->get(1))->value(); |
1472 } | 1473 } |
1473 | 1474 |
1474 Script* WasmFrame::script() const { | 1475 Script* WasmFrame::script() const { |
1475 Handle<JSObject> wasm(JSObject::cast(wasm_obj()), isolate()); | 1476 Handle<JSObject> wasm(JSObject::cast(wasm_obj()), isolate()); |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1917 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1918 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1918 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1919 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1919 list.Add(frame, zone); | 1920 list.Add(frame, zone); |
1920 } | 1921 } |
1921 return list.ToVector(); | 1922 return list.ToVector(); |
1922 } | 1923 } |
1923 | 1924 |
1924 | 1925 |
1925 } // namespace internal | 1926 } // namespace internal |
1926 } // namespace v8 | 1927 } // namespace v8 |
OLD | NEW |