OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 bool is_exit_debug() const { return type() == EXIT_DEBUG; } | 122 bool is_exit_debug() const { return type() == EXIT_DEBUG; } |
123 bool is_java_script() const { return type() == JAVA_SCRIPT; } | 123 bool is_java_script() const { return type() == JAVA_SCRIPT; } |
124 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } | 124 bool is_arguments_adaptor() const { return type() == ARGUMENTS_ADAPTOR; } |
125 bool is_internal() const { return type() == INTERNAL; } | 125 bool is_internal() const { return type() == INTERNAL; } |
126 bool is_construct() const { return type() == CONSTRUCT; } | 126 bool is_construct() const { return type() == CONSTRUCT; } |
127 virtual bool is_standard() const { return false; } | 127 virtual bool is_standard() const { return false; } |
128 | 128 |
129 // Accessors. | 129 // Accessors. |
130 Address sp() const { return state_.sp; } | 130 Address sp() const { return state_.sp; } |
131 Address fp() const { return state_.fp; } | 131 Address fp() const { return state_.fp; } |
132 Address pp() const { return GetCallerStackPointer(); } | 132 Address caller_sp() const { return GetCallerStackPointer(); } |
133 | 133 |
134 Address pc() const { return *pc_address(); } | 134 Address pc() const { return *pc_address(); } |
135 void set_pc(Address pc) { *pc_address() = pc; } | 135 void set_pc(Address pc) { *pc_address() = pc; } |
136 | 136 |
137 Address* pc_address() const { return state_.pc_address; } | 137 Address* pc_address() const { return state_.pc_address; } |
138 | 138 |
139 // Get the id of this stack frame. | 139 // Get the id of this stack frame. |
140 Id id() const { return static_cast<Id>(OffsetFrom(pp())); } | 140 Id id() const { return static_cast<Id>(OffsetFrom(caller_sp())); } |
141 | 141 |
142 // Checks if this frame includes any stack handlers. | 142 // Checks if this frame includes any stack handlers. |
143 bool HasHandler() const; | 143 bool HasHandler() const; |
144 | 144 |
145 // Get the type of this frame. | 145 // Get the type of this frame. |
146 virtual Type type() const = 0; | 146 virtual Type type() const = 0; |
147 | 147 |
148 // Get the code associated with this frame. | 148 // Get the code associated with this frame. |
149 virtual Code* code() const = 0; | 149 virtual Code* code() const = 0; |
150 | 150 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 return static_cast<StandardFrame*>(frame); | 327 return static_cast<StandardFrame*>(frame); |
328 } | 328 } |
329 | 329 |
330 protected: | 330 protected: |
331 explicit StandardFrame(StackFrameIterator* iterator) | 331 explicit StandardFrame(StackFrameIterator* iterator) |
332 : StackFrame(iterator) { } | 332 : StackFrame(iterator) { } |
333 | 333 |
334 virtual void ComputeCallerState(State* state) const; | 334 virtual void ComputeCallerState(State* state) const; |
335 | 335 |
336 // Accessors. | 336 // Accessors. |
337 inline Address caller_sp() const; | |
338 inline Address caller_fp() const; | 337 inline Address caller_fp() const; |
339 inline Address caller_pc() const; | 338 inline Address caller_pc() const; |
340 | 339 |
341 // Computes the address of the PC field in the standard frame given | 340 // Computes the address of the PC field in the standard frame given |
342 // by the provided frame pointer. | 341 // by the provided frame pointer. |
343 static inline Address ComputePCAddress(Address fp); | 342 static inline Address ComputePCAddress(Address fp); |
344 | 343 |
345 // Iterate over expression stack including stack handlers, locals, | 344 // Iterate over expression stack including stack handlers, locals, |
346 // and parts of the fixed part including context and code fields. | 345 // and parts of the fixed part including context and code fields. |
347 void IterateExpressions(ObjectVisitor* v) const; | 346 void IterateExpressions(ObjectVisitor* v) const; |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 JavaScriptFrame* FindJavaScriptFrame(int n); | 678 JavaScriptFrame* FindJavaScriptFrame(int n); |
680 | 679 |
681 private: | 680 private: |
682 StackFrameIterator iterator_; | 681 StackFrameIterator iterator_; |
683 }; | 682 }; |
684 | 683 |
685 | 684 |
686 } } // namespace v8::internal | 685 } } // namespace v8::internal |
687 | 686 |
688 #endif // V8_FRAMES_H_ | 687 #endif // V8_FRAMES_H_ |
OLD | NEW |