OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_FRAMES_H_ | 5 #ifndef V8_FRAMES_H_ |
6 #define V8_FRAMES_H_ | 6 #define V8_FRAMES_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/handles.h" | 9 #include "src/handles.h" |
10 #include "src/safepoint-table.h" | 10 #include "src/safepoint-table.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 static const int kInnerPointerToCodeCacheSize = 1024; | 62 static const int kInnerPointerToCodeCacheSize = 1024; |
63 InnerPointerToCodeCacheEntry cache_[kInnerPointerToCodeCacheSize]; | 63 InnerPointerToCodeCacheEntry cache_[kInnerPointerToCodeCacheSize]; |
64 | 64 |
65 DISALLOW_COPY_AND_ASSIGN(InnerPointerToCodeCache); | 65 DISALLOW_COPY_AND_ASSIGN(InnerPointerToCodeCache); |
66 }; | 66 }; |
67 | 67 |
68 | 68 |
69 class StackHandlerConstants : public AllStatic { | 69 class StackHandlerConstants : public AllStatic { |
70 public: | 70 public: |
71 static const int kNextOffset = 0 * kPointerSize; | 71 static const int kNextOffset = 0 * kPointerSize; |
72 static const int kCodeOffset = 1 * kPointerSize; | 72 static const int kStateOffset = 1 * kPointerSize; |
73 static const int kStateOffset = 2 * kPointerSize; | |
74 #if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT | 73 #if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT |
75 static const int kStateIntOffset = kStateOffset; | 74 static const int kStateIntOffset = kStateOffset; |
76 #else | 75 #else |
77 static const int kStateIntOffset = kStateOffset + kIntSize; | 76 static const int kStateIntOffset = kStateOffset + kIntSize; |
78 #endif | 77 #endif |
79 static const int kContextOffset = 3 * kPointerSize; | 78 static const int kContextOffset = 2 * kPointerSize; |
80 static const int kFPOffset = 4 * kPointerSize; | 79 static const int kFPOffset = 3 * kPointerSize; |
81 | 80 |
82 static const int kSize = kFPOffset + kFPOnStackSize; | 81 static const int kSize = kFPOffset + kFPOnStackSize; |
83 static const int kSlotCount = kSize >> kPointerSizeLog2; | 82 static const int kSlotCount = kSize >> kPointerSizeLog2; |
84 }; | 83 }; |
85 | 84 |
86 | 85 |
87 class StackHandler BASE_EMBEDDED { | 86 class StackHandler BASE_EMBEDDED { |
88 public: | 87 public: |
89 enum Kind { | 88 enum Kind { |
90 JS_ENTRY, | 89 JS_ENTRY, |
(...skipping 18 matching lines...) Expand all Loading... |
109 inline bool includes(Address address) const; | 108 inline bool includes(Address address) const; |
110 | 109 |
111 // Garbage collection support. | 110 // Garbage collection support. |
112 inline void Iterate(ObjectVisitor* v, Code* holder) const; | 111 inline void Iterate(ObjectVisitor* v, Code* holder) const; |
113 | 112 |
114 // Conversion support. | 113 // Conversion support. |
115 static inline StackHandler* FromAddress(Address address); | 114 static inline StackHandler* FromAddress(Address address); |
116 | 115 |
117 // Accessors. | 116 // Accessors. |
118 inline Context* context() const; | 117 inline Context* context() const; |
119 inline Code* code() const; | |
120 inline Kind kind() const; | 118 inline Kind kind() const; |
121 inline unsigned index() const; | 119 inline unsigned index() const; |
122 inline Address frame_pointer() const; | 120 inline Address frame_pointer() const; |
123 | 121 |
124 // Testers. | 122 // Testers. |
125 inline bool is_js_entry() const; | 123 inline bool is_js_entry() const; |
126 inline bool is_catch() const; | 124 inline bool is_catch() const; |
127 inline bool is_finally() const; | 125 inline bool is_finally() const; |
128 | 126 |
129 // Generator support to preserve stack handlers. | 127 // Generator support to preserve stack handlers. |
130 void Unwind(Isolate* isolate, FixedArray* array, int offset, | 128 void Unwind(Isolate* isolate, FixedArray* array, int offset, |
131 int previous_handler_offset) const; | 129 int previous_handler_offset) const; |
132 int Rewind(Isolate* isolate, FixedArray* array, int offset, Address fp); | 130 int Rewind(Isolate* isolate, FixedArray* array, int offset, Address fp); |
133 | 131 |
134 private: | 132 private: |
135 inline Object** context_address() const; | 133 inline Object** context_address() const; |
136 inline Object** code_address() const; | |
137 inline void SetFp(Address slot, Address fp); | 134 inline void SetFp(Address slot, Address fp); |
138 | 135 |
139 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); | 136 DISALLOW_IMPLICIT_CONSTRUCTORS(StackHandler); |
140 }; | 137 }; |
141 | 138 |
142 | 139 |
143 #define STACK_FRAME_TYPE_LIST(V) \ | 140 #define STACK_FRAME_TYPE_LIST(V) \ |
144 V(ENTRY, EntryFrame) \ | 141 V(ENTRY, EntryFrame) \ |
145 V(ENTRY_CONSTRUCT, EntryConstructFrame) \ | 142 V(ENTRY_CONSTRUCT, EntryConstructFrame) \ |
146 V(EXIT, ExitFrame) \ | 143 V(EXIT, ExitFrame) \ |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 }; | 935 }; |
939 | 936 |
940 | 937 |
941 // Reads all frames on the current stack and copies them into the current | 938 // Reads all frames on the current stack and copies them into the current |
942 // zone memory. | 939 // zone memory. |
943 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); | 940 Vector<StackFrame*> CreateStackMap(Isolate* isolate, Zone* zone); |
944 | 941 |
945 } } // namespace v8::internal | 942 } } // namespace v8::internal |
946 | 943 |
947 #endif // V8_FRAMES_H_ | 944 #endif // V8_FRAMES_H_ |
OLD | NEW |