| 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 #ifndef V8_FRAMES_H_ | 5 #ifndef V8_FRAMES_H_ |
| 6 #define V8_FRAMES_H_ | 6 #define V8_FRAMES_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/flags.h" | 9 #include "src/flags.h" |
| 10 #include "src/handles.h" | 10 #include "src/handles.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 V(EXIT, ExitFrame) \ | 104 V(EXIT, ExitFrame) \ |
| 105 V(JAVA_SCRIPT, JavaScriptFrame) \ | 105 V(JAVA_SCRIPT, JavaScriptFrame) \ |
| 106 V(OPTIMIZED, OptimizedFrame) \ | 106 V(OPTIMIZED, OptimizedFrame) \ |
| 107 V(WASM_COMPILED, WasmCompiledFrame) \ | 107 V(WASM_COMPILED, WasmCompiledFrame) \ |
| 108 V(WASM_TO_JS, WasmToJsFrame) \ | 108 V(WASM_TO_JS, WasmToJsFrame) \ |
| 109 V(JS_TO_WASM, JsToWasmFrame) \ | 109 V(JS_TO_WASM, JsToWasmFrame) \ |
| 110 V(WASM_INTERPRETER_ENTRY, WasmInterpreterEntryFrame) \ | 110 V(WASM_INTERPRETER_ENTRY, WasmInterpreterEntryFrame) \ |
| 111 V(INTERPRETED, InterpretedFrame) \ | 111 V(INTERPRETED, InterpretedFrame) \ |
| 112 V(STUB, StubFrame) \ | 112 V(STUB, StubFrame) \ |
| 113 V(STUB_FAILURE_TRAMPOLINE, StubFailureTrampolineFrame) \ | 113 V(STUB_FAILURE_TRAMPOLINE, StubFailureTrampolineFrame) \ |
| 114 V(BUILTIN_CONTINUATION, BuiltinContinuationFrame) \ |
| 114 V(INTERNAL, InternalFrame) \ | 115 V(INTERNAL, InternalFrame) \ |
| 115 V(CONSTRUCT, ConstructFrame) \ | 116 V(CONSTRUCT, ConstructFrame) \ |
| 116 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) \ | 117 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) \ |
| 117 V(BUILTIN, BuiltinFrame) \ | 118 V(BUILTIN, BuiltinFrame) \ |
| 118 V(BUILTIN_EXIT, BuiltinExitFrame) | 119 V(BUILTIN_EXIT, BuiltinExitFrame) |
| 119 | 120 |
| 120 // Every pointer in a frame has a slot id. On 32-bit platforms, doubles consume | 121 // Every pointer in a frame has a slot id. On 32-bit platforms, doubles consume |
| 121 // two slots. | 122 // two slots. |
| 122 // | 123 // |
| 123 // Stack slot indices >= 0 access the callee stack with slot 0 corresponding to | 124 // Stack slot indices >= 0 access the callee stack with slot 0 corresponding to |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 bool is_js_to_wasm() const { return type() == JS_TO_WASM; } | 519 bool is_js_to_wasm() const { return type() == JS_TO_WASM; } |
| 519 bool is_wasm_interpreter_entry() const { | 520 bool is_wasm_interpreter_entry() const { |
| 520 return type() == WASM_INTERPRETER_ENTRY; | 521 return type() == WASM_INTERPRETER_ENTRY; |
| 521 } | 522 } |
| 522 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } | 523 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } |
| 523 bool is_builtin() const { return type() == BUILTIN; } | 524 bool is_builtin() const { return type() == BUILTIN; } |
| 524 bool is_internal() const { return type() == INTERNAL; } | 525 bool is_internal() const { return type() == INTERNAL; } |
| 525 bool is_stub_failure_trampoline() const { | 526 bool is_stub_failure_trampoline() const { |
| 526 return type() == STUB_FAILURE_TRAMPOLINE; | 527 return type() == STUB_FAILURE_TRAMPOLINE; |
| 527 } | 528 } |
| 529 bool is_builtin_continuation() const { |
| 530 return type() == BUILTIN_CONTINUATION; |
| 531 } |
| 528 bool is_construct() const { return type() == CONSTRUCT; } | 532 bool is_construct() const { return type() == CONSTRUCT; } |
| 529 bool is_builtin_exit() const { return type() == BUILTIN_EXIT; } | 533 bool is_builtin_exit() const { return type() == BUILTIN_EXIT; } |
| 530 virtual bool is_standard() const { return false; } | 534 virtual bool is_standard() const { return false; } |
| 531 | 535 |
| 532 bool is_java_script() const { | 536 bool is_java_script() const { |
| 533 Type type = this->type(); | 537 Type type = this->type(); |
| 534 return (type == JAVA_SCRIPT) || (type == OPTIMIZED) || | 538 return (type == JAVA_SCRIPT) || (type == OPTIMIZED) || |
| 535 (type == INTERPRETED) || (type == BUILTIN); | 539 (type == INTERPRETED) || (type == BUILTIN); |
| 536 } | 540 } |
| 537 bool is_wasm() const { | 541 bool is_wasm() const { |
| (...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 return static_cast<ConstructFrame*>(frame); | 1457 return static_cast<ConstructFrame*>(frame); |
| 1454 } | 1458 } |
| 1455 | 1459 |
| 1456 protected: | 1460 protected: |
| 1457 inline explicit ConstructFrame(StackFrameIteratorBase* iterator); | 1461 inline explicit ConstructFrame(StackFrameIteratorBase* iterator); |
| 1458 | 1462 |
| 1459 private: | 1463 private: |
| 1460 friend class StackFrameIteratorBase; | 1464 friend class StackFrameIteratorBase; |
| 1461 }; | 1465 }; |
| 1462 | 1466 |
| 1467 class BuiltinContinuationFrame : public InternalFrame { |
| 1468 public: |
| 1469 Type type() const override { return BUILTIN_CONTINUATION; } |
| 1470 |
| 1471 static BuiltinContinuationFrame* cast(StackFrame* frame) { |
| 1472 DCHECK(frame->is_builtin_continuation()); |
| 1473 return static_cast<BuiltinContinuationFrame*>(frame); |
| 1474 } |
| 1475 |
| 1476 protected: |
| 1477 inline explicit BuiltinContinuationFrame(StackFrameIteratorBase* iterator); |
| 1478 |
| 1479 private: |
| 1480 friend class StackFrameIteratorBase; |
| 1481 }; |
| 1463 | 1482 |
| 1464 class StackFrameIteratorBase BASE_EMBEDDED { | 1483 class StackFrameIteratorBase BASE_EMBEDDED { |
| 1465 public: | 1484 public: |
| 1466 Isolate* isolate() const { return isolate_; } | 1485 Isolate* isolate() const { return isolate_; } |
| 1467 | 1486 |
| 1468 bool done() const { return frame_ == NULL; } | 1487 bool done() const { return frame_ == NULL; } |
| 1469 | 1488 |
| 1470 protected: | 1489 protected: |
| 1471 // An iterator that iterates over a given thread's stack. | 1490 // An iterator that iterates over a given thread's stack. |
| 1472 StackFrameIteratorBase(Isolate* isolate, bool can_access_heap_objects); | 1491 StackFrameIteratorBase(Isolate* isolate, bool can_access_heap_objects); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1605 | 1624 |
| 1606 | 1625 |
| 1607 // Reads all frames on the current stack and copies them into the current | 1626 // Reads all frames on the current stack and copies them into the current |
| 1608 // zone memory. | 1627 // zone memory. |
| 1609 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 1628 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
| 1610 | 1629 |
| 1611 } // namespace internal | 1630 } // namespace internal |
| 1612 } // namespace v8 | 1631 } // namespace v8 |
| 1613 | 1632 |
| 1614 #endif // V8_FRAMES_H_ | 1633 #endif // V8_FRAMES_H_ |
| OLD | NEW |