OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); | 129 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); |
130 }; | 130 }; |
131 | 131 |
132 | 132 |
133 #define STACK_FRAME_TYPE_LIST(V) \ | 133 #define STACK_FRAME_TYPE_LIST(V) \ |
134 V(ENTRY, EntryFrame) \ | 134 V(ENTRY, EntryFrame) \ |
135 V(ENTRY_CONSTRUCT, EntryConstructFrame) \ | 135 V(ENTRY_CONSTRUCT, EntryConstructFrame) \ |
136 V(EXIT, ExitFrame) \ | 136 V(EXIT, ExitFrame) \ |
137 V(JAVA_SCRIPT, JavaScriptFrame) \ | 137 V(JAVA_SCRIPT, JavaScriptFrame) \ |
138 V(OPTIMIZED, OptimizedFrame) \ | 138 V(OPTIMIZED, OptimizedFrame) \ |
| 139 V(STUB, StubFrame) \ |
139 V(INTERNAL, InternalFrame) \ | 140 V(INTERNAL, InternalFrame) \ |
140 V(CONSTRUCT, ConstructFrame) \ | 141 V(CONSTRUCT, ConstructFrame) \ |
141 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) | 142 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) |
142 | 143 |
143 | 144 |
144 // Abstract base class for all stack frames. | 145 // Abstract base class for all stack frames. |
145 class StackFrame BASE_EMBEDDED { | 146 class StackFrame BASE_EMBEDDED { |
146 public: | 147 public: |
147 #define DECLARE_TYPE(type, ignore) type, | 148 #define DECLARE_TYPE(type, ignore) type, |
148 enum Type { | 149 enum Type { |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 void IterateArguments(ObjectVisitor* v) const; | 549 void IterateArguments(ObjectVisitor* v) const; |
549 | 550 |
550 private: | 551 private: |
551 inline Object* function_slot_object() const; | 552 inline Object* function_slot_object() const; |
552 | 553 |
553 friend class StackFrameIterator; | 554 friend class StackFrameIterator; |
554 friend class StackTracer; | 555 friend class StackTracer; |
555 }; | 556 }; |
556 | 557 |
557 | 558 |
558 class OptimizedFrame : public JavaScriptFrame { | 559 class CompiledFrame : public JavaScriptFrame { |
| 560 public: |
| 561 virtual Type type() const = 0; |
| 562 |
| 563 // GC support. |
| 564 virtual void Iterate(ObjectVisitor* v) const; |
| 565 |
| 566 protected: |
| 567 inline explicit CompiledFrame(StackFrameIterator* iterator); |
| 568 }; |
| 569 |
| 570 |
| 571 class StubFrame : public CompiledFrame { |
| 572 public: |
| 573 virtual Type type() const { return STUB; } |
| 574 |
| 575 // GC support. |
| 576 virtual void Iterate(ObjectVisitor* v) const; |
| 577 |
| 578 protected: |
| 579 inline explicit StubFrame(StackFrameIterator* iterator); |
| 580 |
| 581 friend class StackFrameIterator; |
| 582 }; |
| 583 |
| 584 |
| 585 class OptimizedFrame : public CompiledFrame { |
559 public: | 586 public: |
560 virtual Type type() const { return OPTIMIZED; } | 587 virtual Type type() const { return OPTIMIZED; } |
561 | 588 |
562 // GC support. | 589 // GC support. |
563 virtual void Iterate(ObjectVisitor* v) const; | 590 virtual void Iterate(ObjectVisitor* v) const; |
564 | 591 |
565 virtual int GetInlineCount(); | 592 virtual int GetInlineCount(); |
566 | 593 |
567 // Return a list with JSFunctions of this frame. | 594 // Return a list with JSFunctions of this frame. |
568 // The functions are ordered bottom-to-top (i.e. functions.last() | 595 // The functions are ordered bottom-to-top (i.e. functions.last() |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 }; | 920 }; |
894 | 921 |
895 | 922 |
896 // Reads all frames on the current stack and copies them into the current | 923 // Reads all frames on the current stack and copies them into the current |
897 // zone memory. | 924 // zone memory. |
898 Vector<StackFrame*> CreateStackMap(Zone* zone); | 925 Vector<StackFrame*> CreateStackMap(Zone* zone); |
899 | 926 |
900 } } // namespace v8::internal | 927 } } // namespace v8::internal |
901 | 928 |
902 #endif // V8_FRAMES_H_ | 929 #endif // V8_FRAMES_H_ |
OLD | NEW |