| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // Accessors. | 123 // Accessors. |
| 124 inline Kind kind() const; | 124 inline Kind kind() const; |
| 125 | 125 |
| 126 inline Object** context_address() const; | 126 inline Object** context_address() const; |
| 127 inline Object** code_address() const; | 127 inline Object** code_address() const; |
| 128 | 128 |
| 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(STUB, StubFrame) \ |
| 140 V(INTERNAL, InternalFrame) \ | 140 V(STUB_FAILURE_TRAMPOLINE, StubFailureTrampolineFrame) \ |
| 141 V(CONSTRUCT, ConstructFrame) \ | 141 V(INTERNAL, InternalFrame) \ |
| 142 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) | 142 V(CONSTRUCT, ConstructFrame) \ |
| 143 V(ARGUMENTS_ADAPTOR, ArgumentsAdaptorFrame) |
| 143 | 144 |
| 144 | 145 |
| 145 // Abstract base class for all stack frames. | 146 // Abstract base class for all stack frames. |
| 146 class StackFrame BASE_EMBEDDED { | 147 class StackFrame BASE_EMBEDDED { |
| 147 public: | 148 public: |
| 148 #define DECLARE_TYPE(type, ignore) type, | 149 #define DECLARE_TYPE(type, ignore) type, |
| 149 enum Type { | 150 enum Type { |
| 150 NONE = 0, | 151 NONE = 0, |
| 151 STACK_FRAME_TYPE_LIST(DECLARE_TYPE) | 152 STACK_FRAME_TYPE_LIST(DECLARE_TYPE) |
| 152 NUMBER_OF_TYPES, | 153 NUMBER_OF_TYPES, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 this->isolate_ = original.isolate_; | 188 this->isolate_ = original.isolate_; |
| 188 } | 189 } |
| 189 | 190 |
| 190 // Type testers. | 191 // Type testers. |
| 191 bool is_entry() const { return type() == ENTRY; } | 192 bool is_entry() const { return type() == ENTRY; } |
| 192 bool is_entry_construct() const { return type() == ENTRY_CONSTRUCT; } | 193 bool is_entry_construct() const { return type() == ENTRY_CONSTRUCT; } |
| 193 bool is_exit() const { return type() == EXIT; } | 194 bool is_exit() const { return type() == EXIT; } |
| 194 bool is_optimized() const { return type() == OPTIMIZED; } | 195 bool is_optimized() const { return type() == OPTIMIZED; } |
| 195 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } | 196 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } |
| 196 bool is_internal() const { return type() == INTERNAL; } | 197 bool is_internal() const { return type() == INTERNAL; } |
| 198 bool is_stub_failure_trampoline() const { |
| 199 return type() == STUB_FAILURE_TRAMPOLINE; |
| 200 } |
| 197 bool is_construct() const { return type() == CONSTRUCT; } | 201 bool is_construct() const { return type() == CONSTRUCT; } |
| 198 virtual bool is_standard() const { return false; } | 202 virtual bool is_standard() const { return false; } |
| 199 | 203 |
| 200 bool is_java_script() const { | 204 bool is_java_script() const { |
| 201 Type type = this->type(); | 205 Type type = this->type(); |
| 202 return (type == JAVA_SCRIPT) || (type == OPTIMIZED); | 206 return (type == JAVA_SCRIPT) || (type == OPTIMIZED); |
| 203 } | 207 } |
| 204 | 208 |
| 205 // Accessors. | 209 // Accessors. |
| 206 Address sp() const { return state_.sp; } | 210 Address sp() const { return state_.sp; } |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 protected: | 665 protected: |
| 662 inline explicit InternalFrame(StackFrameIterator* iterator); | 666 inline explicit InternalFrame(StackFrameIterator* iterator); |
| 663 | 667 |
| 664 virtual Address GetCallerStackPointer() const; | 668 virtual Address GetCallerStackPointer() const; |
| 665 | 669 |
| 666 private: | 670 private: |
| 667 friend class StackFrameIterator; | 671 friend class StackFrameIterator; |
| 668 }; | 672 }; |
| 669 | 673 |
| 670 | 674 |
| 675 class StubFailureTrampolineFrame: public InternalFrame { |
| 676 public: |
| 677 virtual Type type() const { return STUB_FAILURE_TRAMPOLINE; } |
| 678 |
| 679 virtual void Iterate(ObjectVisitor* v) const; |
| 680 |
| 681 protected: |
| 682 inline explicit StubFailureTrampolineFrame( |
| 683 StackFrameIterator* iterator); |
| 684 |
| 685 private: |
| 686 friend class StackFrameIterator; |
| 687 }; |
| 688 |
| 689 |
| 671 // Construct frames are special trampoline frames introduced to handle | 690 // Construct frames are special trampoline frames introduced to handle |
| 672 // function invocations through 'new'. | 691 // function invocations through 'new'. |
| 673 class ConstructFrame: public InternalFrame { | 692 class ConstructFrame: public InternalFrame { |
| 674 public: | 693 public: |
| 675 virtual Type type() const { return CONSTRUCT; } | 694 virtual Type type() const { return CONSTRUCT; } |
| 676 | 695 |
| 677 static ConstructFrame* cast(StackFrame* frame) { | 696 static ConstructFrame* cast(StackFrame* frame) { |
| 678 ASSERT(frame->is_construct()); | 697 ASSERT(frame->is_construct()); |
| 679 return static_cast<ConstructFrame*>(frame); | 698 return static_cast<ConstructFrame*>(frame); |
| 680 } | 699 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 }; | 940 }; |
| 922 | 941 |
| 923 | 942 |
| 924 // Reads all frames on the current stack and copies them into the current | 943 // Reads all frames on the current stack and copies them into the current |
| 925 // zone memory. | 944 // zone memory. |
| 926 Vector<StackFrame*> CreateStackMap(Zone* zone); | 945 Vector<StackFrame*> CreateStackMap(Zone* zone); |
| 927 | 946 |
| 928 } } // namespace v8::internal | 947 } } // namespace v8::internal |
| 929 | 948 |
| 930 #endif // V8_FRAMES_H_ | 949 #endif // V8_FRAMES_H_ |
| OLD | NEW |