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) \ | |
140 V(INTERNAL, InternalFrame) \ | 139 V(INTERNAL, InternalFrame) \ |
141 V(CONSTRUCT, ConstructFrame) \ | 140 V(CONSTRUCT, ConstructFrame) \ |
142 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) | 141 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) |
143 | 142 |
144 | 143 |
145 // Abstract base class for all stack frames. | 144 // Abstract base class for all stack frames. |
146 class StackFrame BASE_EMBEDDED { | 145 class StackFrame BASE_EMBEDDED { |
147 public: | 146 public: |
148 #define DECLARE_TYPE(type, ignore) type, | 147 #define DECLARE_TYPE(type, ignore) type, |
149 enum Type { | 148 enum Type { |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 void IterateArguments(ObjectVisitor* v) const; | 548 void IterateArguments(ObjectVisitor* v) const; |
550 | 549 |
551 private: | 550 private: |
552 inline Object* function_slot_object() const; | 551 inline Object* function_slot_object() const; |
553 | 552 |
554 friend class StackFrameIterator; | 553 friend class StackFrameIterator; |
555 friend class StackTracer; | 554 friend class StackTracer; |
556 }; | 555 }; |
557 | 556 |
558 | 557 |
559 class CompiledFrame : public JavaScriptFrame { | 558 class OptimizedFrame : 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 { | |
586 public: | 559 public: |
587 virtual Type type() const { return OPTIMIZED; } | 560 virtual Type type() const { return OPTIMIZED; } |
588 | 561 |
589 // GC support. | 562 // GC support. |
590 virtual void Iterate(ObjectVisitor* v) const; | 563 virtual void Iterate(ObjectVisitor* v) const; |
591 | 564 |
592 virtual int GetInlineCount(); | 565 virtual int GetInlineCount(); |
593 | 566 |
594 // Return a list with JSFunctions of this frame. | 567 // Return a list with JSFunctions of this frame. |
595 // The functions are ordered bottom-to-top (i.e. functions.last() | 568 // The functions are ordered bottom-to-top (i.e. functions.last() |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 }; | 893 }; |
921 | 894 |
922 | 895 |
923 // Reads all frames on the current stack and copies them into the current | 896 // Reads all frames on the current stack and copies them into the current |
924 // zone memory. | 897 // zone memory. |
925 Vector<StackFrame*> CreateStackMap(Zone* zone); | 898 Vector<StackFrame*> CreateStackMap(Zone* zone); |
926 | 899 |
927 } } // namespace v8::internal | 900 } } // namespace v8::internal |
928 | 901 |
929 #endif // V8_FRAMES_H_ | 902 #endif // V8_FRAMES_H_ |
OLD | NEW |