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 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 return table->LookupReturn(pc_offset); | 1745 return table->LookupReturn(pc_offset); |
1746 } | 1746 } |
1747 | 1747 |
1748 void WasmInterpreterEntryFrame::Iterate(ObjectVisitor* v) const { | 1748 void WasmInterpreterEntryFrame::Iterate(ObjectVisitor* v) const { |
1749 IterateCompiledFrame(v); | 1749 IterateCompiledFrame(v); |
1750 } | 1750 } |
1751 | 1751 |
1752 void WasmInterpreterEntryFrame::Print(StringStream* accumulator, PrintMode mode, | 1752 void WasmInterpreterEntryFrame::Print(StringStream* accumulator, PrintMode mode, |
1753 int index) const { | 1753 int index) const { |
1754 PrintIndex(accumulator, mode, index); | 1754 PrintIndex(accumulator, mode, index); |
1755 accumulator->Add("WASM TO INTERPRETER ["); | 1755 accumulator->Add("WASM INTERPRETER ENTRY ["); |
1756 Script* script = this->script(); | 1756 Script* script = this->script(); |
1757 accumulator->PrintName(script->name()); | 1757 accumulator->PrintName(script->name()); |
1758 accumulator->Add("]"); | 1758 accumulator->Add("]"); |
1759 if (mode != OVERVIEW) accumulator->Add("\n"); | 1759 if (mode != OVERVIEW) accumulator->Add("\n"); |
1760 } | 1760 } |
1761 | 1761 |
1762 void WasmInterpreterEntryFrame::Summarize(List<FrameSummary>* functions, | 1762 void WasmInterpreterEntryFrame::Summarize(List<FrameSummary>* functions, |
1763 FrameSummary::Mode mode) const { | 1763 FrameSummary::Mode mode) const { |
1764 // TODO(clemensh): Implement this. | 1764 Handle<WasmInstanceObject> instance(wasm_instance(), isolate()); |
1765 UNIMPLEMENTED(); | 1765 Handle<WasmDebugInfo> debug_info = |
| 1766 WasmInstanceObject::GetOrCreateDebugInfo(instance); |
| 1767 std::vector<std::pair<uint32_t, int>> interpreted_stack = |
| 1768 WasmDebugInfo::GetInterpretedStack(debug_info, fp()); |
| 1769 |
| 1770 for (auto& e : interpreted_stack) { |
| 1771 FrameSummary::WasmInterpretedFrameSummary summary(isolate(), instance, |
| 1772 e.first, e.second); |
| 1773 functions->Add(summary); |
| 1774 } |
1766 } | 1775 } |
1767 | 1776 |
1768 Code* WasmInterpreterEntryFrame::unchecked_code() const { | 1777 Code* WasmInterpreterEntryFrame::unchecked_code() const { |
1769 return isolate()->FindCodeObject(pc()); | 1778 return isolate()->FindCodeObject(pc()); |
1770 } | 1779 } |
1771 | 1780 |
1772 WasmInstanceObject* WasmInterpreterEntryFrame::wasm_instance() const { | 1781 WasmInstanceObject* WasmInterpreterEntryFrame::wasm_instance() const { |
1773 WasmInstanceObject* ret = wasm::GetOwningWasmInstance(LookupCode()); | 1782 WasmInstanceObject* ret = wasm::GetOwningWasmInstance(LookupCode()); |
1774 // This is a live stack frame, there must be a live wasm instance available. | 1783 // This is a live stack frame, there must be a live wasm instance available. |
1775 DCHECK_NOT_NULL(ret); | 1784 DCHECK_NOT_NULL(ret); |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2219 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 2228 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
2220 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 2229 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
2221 list.Add(frame, zone); | 2230 list.Add(frame, zone); |
2222 } | 2231 } |
2223 return list.ToVector(); | 2232 return list.ToVector(); |
2224 } | 2233 } |
2225 | 2234 |
2226 | 2235 |
2227 } // namespace internal | 2236 } // namespace internal |
2228 } // namespace v8 | 2237 } // namespace v8 |
OLD | NEW |