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 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 return table->LookupReturn(pc_offset); | 1756 return table->LookupReturn(pc_offset); |
1757 } | 1757 } |
1758 | 1758 |
1759 void WasmInterpreterEntryFrame::Iterate(ObjectVisitor* v) const { | 1759 void WasmInterpreterEntryFrame::Iterate(ObjectVisitor* v) const { |
1760 IterateCompiledFrame(v); | 1760 IterateCompiledFrame(v); |
1761 } | 1761 } |
1762 | 1762 |
1763 void WasmInterpreterEntryFrame::Print(StringStream* accumulator, PrintMode mode, | 1763 void WasmInterpreterEntryFrame::Print(StringStream* accumulator, PrintMode mode, |
1764 int index) const { | 1764 int index) const { |
1765 PrintIndex(accumulator, mode, index); | 1765 PrintIndex(accumulator, mode, index); |
1766 accumulator->Add("WASM TO INTERPRETER ["); | 1766 accumulator->Add("WASM INTERPRETER ENTRY ["); |
1767 Script* script = this->script(); | 1767 Script* script = this->script(); |
1768 accumulator->PrintName(script->name()); | 1768 accumulator->PrintName(script->name()); |
1769 accumulator->Add("]"); | 1769 accumulator->Add("]"); |
1770 if (mode != OVERVIEW) accumulator->Add("\n"); | 1770 if (mode != OVERVIEW) accumulator->Add("\n"); |
1771 } | 1771 } |
1772 | 1772 |
1773 void WasmInterpreterEntryFrame::Summarize(List<FrameSummary>* functions, | 1773 void WasmInterpreterEntryFrame::Summarize(List<FrameSummary>* functions, |
1774 FrameSummary::Mode mode) const { | 1774 FrameSummary::Mode mode) const { |
1775 // TODO(clemensh): Implement this. | 1775 Handle<WasmInstanceObject> instance(wasm_instance(), isolate()); |
1776 UNIMPLEMENTED(); | 1776 std::vector<std::pair<uint32_t, int>> interpreted_stack = |
| 1777 instance->debug_info()->GetInterpretedStack(fp()); |
| 1778 |
| 1779 for (auto& e : interpreted_stack) { |
| 1780 FrameSummary::WasmInterpretedFrameSummary summary(isolate(), instance, |
| 1781 e.first, e.second); |
| 1782 functions->Add(summary); |
| 1783 } |
1777 } | 1784 } |
1778 | 1785 |
1779 Code* WasmInterpreterEntryFrame::unchecked_code() const { | 1786 Code* WasmInterpreterEntryFrame::unchecked_code() const { |
1780 return isolate()->FindCodeObject(pc()); | 1787 return isolate()->FindCodeObject(pc()); |
1781 } | 1788 } |
1782 | 1789 |
1783 WasmInstanceObject* WasmInterpreterEntryFrame::wasm_instance() const { | 1790 WasmInstanceObject* WasmInterpreterEntryFrame::wasm_instance() const { |
1784 WasmInstanceObject* ret = wasm::GetOwningWasmInstance(LookupCode()); | 1791 WasmInstanceObject* ret = wasm::GetOwningWasmInstance(LookupCode()); |
1785 // This is a live stack frame, there must be a live wasm instance available. | 1792 // This is a live stack frame, there must be a live wasm instance available. |
1786 DCHECK_NOT_NULL(ret); | 1793 DCHECK_NOT_NULL(ret); |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2230 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 2237 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
2231 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 2238 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
2232 list.Add(frame, zone); | 2239 list.Add(frame, zone); |
2233 } | 2240 } |
2234 return list.ToVector(); | 2241 return list.ToVector(); |
2235 } | 2242 } |
2236 | 2243 |
2237 | 2244 |
2238 } // namespace internal | 2245 } // namespace internal |
2239 } // namespace v8 | 2246 } // namespace v8 |
OLD | NEW |