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 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 | 1326 |
1327 JSFunction* WasmFrame::function() const { | 1327 JSFunction* WasmFrame::function() const { |
1328 // TODO(clemensh): generate the right JSFunctions once per wasm function and | 1328 // TODO(clemensh): generate the right JSFunctions once per wasm function and |
1329 // cache them | 1329 // cache them |
1330 Factory* factory = isolate()->factory(); | 1330 Factory* factory = isolate()->factory(); |
1331 Handle<JSFunction> fun = | 1331 Handle<JSFunction> fun = |
1332 factory->NewFunction(factory->NewStringFromAsciiChecked("<WASM>")); | 1332 factory->NewFunction(factory->NewStringFromAsciiChecked("<WASM>")); |
1333 return *fun; | 1333 return *fun; |
1334 } | 1334 } |
1335 | 1335 |
| 1336 void WasmFrame::Summarize(List<FrameSummary>* functions) const { |
| 1337 DCHECK(functions->length() == 0); |
| 1338 Code* code = LookupCode(); |
| 1339 int offset = static_cast<int>(pc() - code->instruction_start()); |
| 1340 AbstractCode* abstract_code = AbstractCode::cast(code); |
| 1341 Handle<JSFunction> fun(function(), isolate()); |
| 1342 FrameSummary summary(receiver(), *fun, abstract_code, offset, false); |
| 1343 functions->Add(summary); |
| 1344 } |
| 1345 |
1336 void WasmFrame::Iterate(ObjectVisitor* v) const { IterateCompiledFrame(v); } | 1346 void WasmFrame::Iterate(ObjectVisitor* v) const { IterateCompiledFrame(v); } |
1337 | 1347 |
1338 Address WasmFrame::GetCallerStackPointer() const { | 1348 Address WasmFrame::GetCallerStackPointer() const { |
1339 return fp() + ExitFrameConstants::kCallerSPOffset; | 1349 return fp() + ExitFrameConstants::kCallerSPOffset; |
1340 } | 1350 } |
1341 | 1351 |
1342 namespace { | 1352 namespace { |
1343 | 1353 |
1344 | 1354 |
1345 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared, | 1355 void PrintFunctionSource(StringStream* accumulator, SharedFunctionInfo* shared, |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1763 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { | 1773 for (StackFrameIterator it(isolate); !it.done(); it.Advance()) { |
1764 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); | 1774 StackFrame* frame = AllocateFrameCopy(it.frame(), zone); |
1765 list.Add(frame, zone); | 1775 list.Add(frame, zone); |
1766 } | 1776 } |
1767 return list.ToVector(); | 1777 return list.ToVector(); |
1768 } | 1778 } |
1769 | 1779 |
1770 | 1780 |
1771 } // namespace internal | 1781 } // namespace internal |
1772 } // namespace v8 | 1782 } // namespace v8 |
OLD | NEW |