| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 class StackHandlerConstants : public AllStatic { | 87 class StackHandlerConstants : public AllStatic { |
| 88 public: | 88 public: |
| 89 static const int kNextOffset = 0 * kPointerSize; | 89 static const int kNextOffset = 0 * kPointerSize; |
| 90 static const int kCodeOffset = 1 * kPointerSize; | 90 static const int kCodeOffset = 1 * kPointerSize; |
| 91 static const int kStateOffset = 2 * kPointerSize; | 91 static const int kStateOffset = 2 * kPointerSize; |
| 92 static const int kContextOffset = 3 * kPointerSize; | 92 static const int kContextOffset = 3 * kPointerSize; |
| 93 static const int kFPOffset = 4 * kPointerSize; | 93 static const int kFPOffset = 4 * kPointerSize; |
| 94 | 94 |
| 95 static const int kSize = kFPOffset + kPointerSize; | 95 static const int kSize = kFPOffset + kPointerSize; |
| 96 static const int kSlotCount = kSize >> kPointerSizeLog2; |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 | 99 |
| 99 class StackHandler BASE_EMBEDDED { | 100 class StackHandler BASE_EMBEDDED { |
| 100 public: | 101 public: |
| 101 enum Kind { | 102 enum Kind { |
| 102 JS_ENTRY, | 103 JS_ENTRY, |
| 103 CATCH, | 104 CATCH, |
| 104 FINALLY, | 105 FINALLY, |
| 105 LAST_KIND = FINALLY | 106 LAST_KIND = FINALLY |
| (...skipping 18 matching lines...) Expand all Loading... |
| 124 inline void Iterate(ObjectVisitor* v, Code* holder) const; | 125 inline void Iterate(ObjectVisitor* v, Code* holder) const; |
| 125 | 126 |
| 126 // Conversion support. | 127 // Conversion support. |
| 127 static inline StackHandler* FromAddress(Address address); | 128 static inline StackHandler* FromAddress(Address address); |
| 128 | 129 |
| 129 // Testers | 130 // Testers |
| 130 inline bool is_js_entry() const; | 131 inline bool is_js_entry() const; |
| 131 inline bool is_catch() const; | 132 inline bool is_catch() const; |
| 132 inline bool is_finally() const; | 133 inline bool is_finally() const; |
| 133 | 134 |
| 135 // Generator support to preserve stack handlers. |
| 136 void Unwind(Isolate* isolate, FixedArray* array, int offset, |
| 137 int previous_handler_offset) const; |
| 138 int Rewind(Isolate* isolate, FixedArray* array, int offset, Address fp); |
| 139 |
| 134 private: | 140 private: |
| 135 // Accessors. | 141 // Accessors. |
| 136 inline Kind kind() const; | 142 inline Kind kind() const; |
| 143 inline unsigned index() const; |
| 137 | 144 |
| 138 inline Object** context_address() const; | 145 inline Object** context_address() const; |
| 139 inline Object** code_address() const; | 146 inline Object** code_address() const; |
| 140 | 147 |
| 141 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); | 148 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); |
| 142 }; | 149 }; |
| 143 | 150 |
| 144 | 151 |
| 145 #define STACK_FRAME_TYPE_LIST(V) \ | 152 #define STACK_FRAME_TYPE_LIST(V) \ |
| 146 V(ENTRY, EntryFrame) \ | 153 V(ENTRY, EntryFrame) \ |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 inline Object* GetParameter(int index) const; | 541 inline Object* GetParameter(int index) const; |
| 535 inline int ComputeParametersCount() const { | 542 inline int ComputeParametersCount() const { |
| 536 return GetNumberOfIncomingArguments(); | 543 return GetNumberOfIncomingArguments(); |
| 537 } | 544 } |
| 538 | 545 |
| 539 // Access the operand stack. | 546 // Access the operand stack. |
| 540 inline Address GetOperandSlot(int index) const; | 547 inline Address GetOperandSlot(int index) const; |
| 541 inline Object* GetOperand(int index) const; | 548 inline Object* GetOperand(int index) const; |
| 542 inline int ComputeOperandsCount() const; | 549 inline int ComputeOperandsCount() const; |
| 543 | 550 |
| 551 // Generator support to preserve operand stack and stack handlers. |
| 552 void SaveOperandStack(FixedArray* store, int* stack_handler_index) const; |
| 553 void RestoreOperandStack(FixedArray* store, int stack_handler_index); |
| 554 |
| 544 // Debugger access. | 555 // Debugger access. |
| 545 void SetParameterValue(int index, Object* value) const; | 556 void SetParameterValue(int index, Object* value) const; |
| 546 | 557 |
| 547 // Check if this frame is a constructor frame invoked through 'new'. | 558 // Check if this frame is a constructor frame invoked through 'new'. |
| 548 bool IsConstructor() const; | 559 bool IsConstructor() const; |
| 549 | 560 |
| 550 // Check if this frame has "adapted" arguments in the sense that the | 561 // Check if this frame has "adapted" arguments in the sense that the |
| 551 // actual passed arguments are available in an arguments adaptor | 562 // actual passed arguments are available in an arguments adaptor |
| 552 // frame below it on the stack. | 563 // frame below it on the stack. |
| 553 inline bool has_adapted_arguments() const; | 564 inline bool has_adapted_arguments() const; |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 989 }; | 1000 }; |
| 990 | 1001 |
| 991 | 1002 |
| 992 // Reads all frames on the current stack and copies them into the current | 1003 // Reads all frames on the current stack and copies them into the current |
| 993 // zone memory. | 1004 // zone memory. |
| 994 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 1005 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
| 995 | 1006 |
| 996 } } // namespace v8::internal | 1007 } } // namespace v8::internal |
| 997 | 1008 |
| 998 #endif // V8_FRAMES_H_ | 1009 #endif // V8_FRAMES_H_ |
| OLD | NEW |