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_MACRO_ASSEMBLER_H_ | 5 #ifndef V8_MACRO_ASSEMBLER_H_ |
6 #define V8_MACRO_ASSEMBLER_H_ | 6 #define V8_MACRO_ASSEMBLER_H_ |
7 | 7 |
8 #include "src/assembler-inl.h" | 8 #include "src/assembler-inl.h" |
9 | 9 |
10 // Helper types to make boolean flag easier to read at call-site. | 10 // Helper types to make boolean flag easier to read at call-site. |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 StackFrame::Type type_; | 141 StackFrame::Type type_; |
142 bool old_has_frame_; | 142 bool old_has_frame_; |
143 bool old_constant_pool_available_; | 143 bool old_constant_pool_available_; |
144 | 144 |
145 DISALLOW_IMPLICIT_CONSTRUCTORS(FrameAndConstantPoolScope); | 145 DISALLOW_IMPLICIT_CONSTRUCTORS(FrameAndConstantPoolScope); |
146 }; | 146 }; |
147 | 147 |
148 // Class for scoping the the unavailability of constant pool access. | 148 // Class for scoping the the unavailability of constant pool access. |
149 class ConstantPoolUnavailableScope { | 149 class ConstantPoolUnavailableScope { |
150 public: | 150 public: |
151 explicit ConstantPoolUnavailableScope(MacroAssembler* masm) | 151 explicit ConstantPoolUnavailableScope(Assembler* assembler) |
152 : masm_(masm), | 152 : assembler_(assembler), |
153 old_constant_pool_available_(FLAG_enable_embedded_constant_pool && | 153 old_constant_pool_available_(FLAG_enable_embedded_constant_pool && |
154 masm->is_constant_pool_available()) { | 154 assembler->is_constant_pool_available()) { |
155 if (FLAG_enable_embedded_constant_pool) { | 155 if (FLAG_enable_embedded_constant_pool) { |
156 masm_->set_constant_pool_available(false); | 156 assembler->set_constant_pool_available(false); |
157 } | 157 } |
158 } | 158 } |
159 ~ConstantPoolUnavailableScope() { | 159 ~ConstantPoolUnavailableScope() { |
160 if (FLAG_enable_embedded_constant_pool) { | 160 if (FLAG_enable_embedded_constant_pool) { |
161 masm_->set_constant_pool_available(old_constant_pool_available_); | 161 assembler_->set_constant_pool_available(old_constant_pool_available_); |
162 } | 162 } |
163 } | 163 } |
164 | 164 |
165 private: | 165 private: |
166 MacroAssembler* masm_; | 166 Assembler* assembler_; |
167 int old_constant_pool_available_; | 167 int old_constant_pool_available_; |
168 | 168 |
169 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantPoolUnavailableScope); | 169 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantPoolUnavailableScope); |
170 }; | 170 }; |
171 | 171 |
172 | 172 |
173 class AllowExternalCallThatCantCauseGC: public FrameScope { | 173 class AllowExternalCallThatCantCauseGC: public FrameScope { |
174 public: | 174 public: |
175 explicit AllowExternalCallThatCantCauseGC(MacroAssembler* masm) | 175 explicit AllowExternalCallThatCantCauseGC(MacroAssembler* masm) |
176 : FrameScope(masm, StackFrame::NONE) { } | 176 : FrameScope(masm, StackFrame::NONE) { } |
(...skipping 15 matching lines...) Expand all Loading... |
192 MacroAssembler* masm_; | 192 MacroAssembler* masm_; |
193 bool saved_; | 193 bool saved_; |
194 }; | 194 }; |
195 | 195 |
196 | 196 |
197 // Support for "structured" code comments. | 197 // Support for "structured" code comments. |
198 #ifdef DEBUG | 198 #ifdef DEBUG |
199 | 199 |
200 class Comment { | 200 class Comment { |
201 public: | 201 public: |
202 Comment(MacroAssembler* masm, const char* msg); | 202 Comment(Assembler* assembler, const char* msg); |
203 ~Comment(); | 203 ~Comment(); |
204 | 204 |
205 private: | 205 private: |
206 MacroAssembler* masm_; | 206 Assembler* assembler_; |
207 const char* msg_; | 207 const char* msg_; |
208 }; | 208 }; |
209 | 209 |
210 #else | 210 #else |
211 | 211 |
212 class Comment { | 212 class Comment { |
213 public: | 213 public: |
214 Comment(MacroAssembler*, const char*) {} | 214 Comment(Assembler*, const char*) {} |
215 }; | 215 }; |
216 | 216 |
217 #endif // DEBUG | 217 #endif // DEBUG |
218 | 218 |
219 | 219 |
220 // Wrapper class for passing expected and actual parameter counts as | 220 // Wrapper class for passing expected and actual parameter counts as |
221 // either registers or immediate values. Used to make sure that the | 221 // either registers or immediate values. Used to make sure that the |
222 // caller provides exactly the expected number of parameters to the | 222 // caller provides exactly the expected number of parameters to the |
223 // callee. | 223 // callee. |
224 class ParameterCount BASE_EMBEDDED { | 224 class ParameterCount BASE_EMBEDDED { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 } | 264 } |
265 return ExternalReference::new_space_allocation_limit_address(isolate); | 265 return ExternalReference::new_space_allocation_limit_address(isolate); |
266 } | 266 } |
267 }; | 267 }; |
268 | 268 |
269 | 269 |
270 } // namespace internal | 270 } // namespace internal |
271 } // namespace v8 | 271 } // namespace v8 |
272 | 272 |
273 #endif // V8_MACRO_ASSEMBLER_H_ | 273 #endif // V8_MACRO_ASSEMBLER_H_ |
OLD | NEW |