| 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/handles.h" | 9 #include "src/handles.h" |
| 10 #include "src/safepoint-table.h" | 10 #include "src/safepoint-table.h" |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 void IterateCompiledFrame(ObjectVisitor* v) const; | 537 void IterateCompiledFrame(ObjectVisitor* v) const; |
| 538 | 538 |
| 539 private: | 539 private: |
| 540 friend class StackFrame; | 540 friend class StackFrame; |
| 541 friend class SafeStackFrameIterator; | 541 friend class SafeStackFrameIterator; |
| 542 }; | 542 }; |
| 543 | 543 |
| 544 | 544 |
| 545 class FrameSummary BASE_EMBEDDED { | 545 class FrameSummary BASE_EMBEDDED { |
| 546 public: | 546 public: |
| 547 FrameSummary(Object* receiver, JSFunction* function, Code* code, int offset, | 547 FrameSummary(Object* receiver, JSFunction* function, |
| 548 AbstractCode* abstract_code, int code_offset, |
| 548 bool is_constructor); | 549 bool is_constructor); |
| 549 | 550 |
| 550 Handle<Object> receiver() { return receiver_; } | 551 Handle<Object> receiver() { return receiver_; } |
| 551 Handle<JSFunction> function() { return function_; } | 552 Handle<JSFunction> function() { return function_; } |
| 552 Handle<Code> code() { return code_; } | 553 Handle<AbstractCode> abstract_code() { return abstract_code_; } |
| 553 Address pc() { return code_->address() + offset_; } | 554 int code_offset() { return code_offset_; } |
| 554 int offset() { return offset_; } | |
| 555 bool is_constructor() { return is_constructor_; } | 555 bool is_constructor() { return is_constructor_; } |
| 556 | 556 |
| 557 void Print(); | 557 void Print(); |
| 558 | 558 |
| 559 private: | 559 private: |
| 560 Handle<Object> receiver_; | 560 Handle<Object> receiver_; |
| 561 Handle<JSFunction> function_; | 561 Handle<JSFunction> function_; |
| 562 Handle<Code> code_; | 562 Handle<AbstractCode> abstract_code_; |
| 563 int offset_; | 563 int code_offset_; |
| 564 bool is_constructor_; | 564 bool is_constructor_; |
| 565 }; | 565 }; |
| 566 | 566 |
| 567 | 567 |
| 568 class JavaScriptFrame: public StandardFrame { | 568 class JavaScriptFrame: public StandardFrame { |
| 569 public: | 569 public: |
| 570 Type type() const override { return JAVA_SCRIPT; } | 570 Type type() const override { return JAVA_SCRIPT; } |
| 571 | 571 |
| 572 // Accessors. | 572 // Accessors. |
| 573 inline JSFunction* function() const; | 573 inline JSFunction* function() const; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 int LookupExceptionHandlerInTable( | 725 int LookupExceptionHandlerInTable( |
| 726 int* stack_slots, HandlerTable::CatchPrediction* prediction) override; | 726 int* stack_slots, HandlerTable::CatchPrediction* prediction) override; |
| 727 | 727 |
| 728 // Returns the current offset into the bytecode stream. | 728 // Returns the current offset into the bytecode stream. |
| 729 int GetBytecodeOffset() const; | 729 int GetBytecodeOffset() const; |
| 730 | 730 |
| 731 // Updates the current offset into the bytecode stream, mainly used for stack | 731 // Updates the current offset into the bytecode stream, mainly used for stack |
| 732 // unwinding to continue execution at a different bytecode offset. | 732 // unwinding to continue execution at a different bytecode offset. |
| 733 void PatchBytecodeOffset(int new_offset); | 733 void PatchBytecodeOffset(int new_offset); |
| 734 | 734 |
| 735 // Build a list with summaries for this frame including all inlined frames. |
| 736 void Summarize(List<FrameSummary>* frames) override; |
| 737 |
| 735 protected: | 738 protected: |
| 736 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); | 739 inline explicit InterpretedFrame(StackFrameIteratorBase* iterator); |
| 737 | 740 |
| 738 private: | 741 private: |
| 739 friend class StackFrameIteratorBase; | 742 friend class StackFrameIteratorBase; |
| 740 }; | 743 }; |
| 741 | 744 |
| 742 | 745 |
| 743 // Arguments adaptor frames are automatically inserted below | 746 // Arguments adaptor frames are automatically inserted below |
| 744 // JavaScript frames when the actual number of parameters does not | 747 // JavaScript frames when the actual number of parameters does not |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 | 987 |
| 985 | 988 |
| 986 // Reads all frames on the current stack and copies them into the current | 989 // Reads all frames on the current stack and copies them into the current |
| 987 // zone memory. | 990 // zone memory. |
| 988 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 991 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
| 989 | 992 |
| 990 } // namespace internal | 993 } // namespace internal |
| 991 } // namespace v8 | 994 } // namespace v8 |
| 992 | 995 |
| 993 #endif // V8_FRAMES_H_ | 996 #endif // V8_FRAMES_H_ |
| OLD | NEW |