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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 return H##type::cast(hydrogen_value()); \ | 208 return H##type::cast(hydrogen_value()); \ |
209 } | 209 } |
210 | 210 |
211 | 211 |
212 class LInstruction : public ZoneObject { | 212 class LInstruction : public ZoneObject { |
213 public: | 213 public: |
214 LInstruction() | 214 LInstruction() |
215 : environment_(NULL), | 215 : environment_(NULL), |
216 hydrogen_value_(NULL), | 216 hydrogen_value_(NULL), |
217 bit_field_(IsCallBits::encode(false)) { | 217 bit_field_(IsCallBits::encode(false)) { |
218 set_position(RelocInfo::kNoPosition); | |
219 } | 218 } |
220 | 219 |
221 virtual ~LInstruction() {} | 220 virtual ~LInstruction() {} |
222 | 221 |
223 virtual void CompileToNative(LCodeGen* generator) = 0; | 222 virtual void CompileToNative(LCodeGen* generator) = 0; |
224 virtual const char* Mnemonic() const = 0; | 223 virtual const char* Mnemonic() const = 0; |
225 virtual void PrintTo(StringStream* stream); | 224 virtual void PrintTo(StringStream* stream); |
226 virtual void PrintDataTo(StringStream* stream); | 225 virtual void PrintDataTo(StringStream* stream); |
227 virtual void PrintOutputOperandTo(StringStream* stream); | 226 virtual void PrintOutputOperandTo(StringStream* stream); |
228 | 227 |
(...skipping 20 matching lines...) Expand all Loading... |
249 virtual bool IsControl() const { return false; } | 248 virtual bool IsControl() const { return false; } |
250 | 249 |
251 void set_environment(LEnvironment* env) { environment_ = env; } | 250 void set_environment(LEnvironment* env) { environment_ = env; } |
252 LEnvironment* environment() const { return environment_; } | 251 LEnvironment* environment() const { return environment_; } |
253 bool HasEnvironment() const { return environment_ != NULL; } | 252 bool HasEnvironment() const { return environment_ != NULL; } |
254 | 253 |
255 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 254 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
256 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 255 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
257 bool HasPointerMap() const { return pointer_map_.is_set(); } | 256 bool HasPointerMap() const { return pointer_map_.is_set(); } |
258 | 257 |
259 // The 31 bits PositionBits is used to store the int position value. And the | |
260 // position value may be RelocInfo::kNoPosition (-1). The accessor always | |
261 // +1/-1 so that the encoded value of position in bit_field_ is always >= 0 | |
262 // and can fit into the 31 bits PositionBits. | |
263 void set_position(int pos) { | |
264 bit_field_ = PositionBits::update(bit_field_, pos + 1); | |
265 } | |
266 int position() { return PositionBits::decode(bit_field_) - 1; } | |
267 | |
268 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 258 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
269 HValue* hydrogen_value() const { return hydrogen_value_; } | 259 HValue* hydrogen_value() const { return hydrogen_value_; } |
270 | 260 |
271 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 261 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
272 | 262 |
273 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 263 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
274 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 264 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
275 | 265 |
276 // Interface to the register allocator and iterators. | 266 // Interface to the register allocator and iterators. |
277 bool ClobbersTemps() const { return IsCall(); } | 267 bool ClobbersTemps() const { return IsCall(); } |
(...skipping 19 matching lines...) Expand all Loading... |
297 // Iterator support. | 287 // Iterator support. |
298 friend class InputIterator; | 288 friend class InputIterator; |
299 virtual int InputCount() = 0; | 289 virtual int InputCount() = 0; |
300 virtual LOperand* InputAt(int i) = 0; | 290 virtual LOperand* InputAt(int i) = 0; |
301 | 291 |
302 friend class TempIterator; | 292 friend class TempIterator; |
303 virtual int TempCount() = 0; | 293 virtual int TempCount() = 0; |
304 virtual LOperand* TempAt(int i) = 0; | 294 virtual LOperand* TempAt(int i) = 0; |
305 | 295 |
306 class IsCallBits: public BitField<bool, 0, 1> {}; | 296 class IsCallBits: public BitField<bool, 0, 1> {}; |
307 class PositionBits: public BitField<int, 1, 31> {}; | |
308 | 297 |
309 LEnvironment* environment_; | 298 LEnvironment* environment_; |
310 SetOncePointer<LPointerMap> pointer_map_; | 299 SetOncePointer<LPointerMap> pointer_map_; |
311 HValue* hydrogen_value_; | 300 HValue* hydrogen_value_; |
312 int bit_field_; | 301 int bit_field_; |
313 }; | 302 }; |
314 | 303 |
315 | 304 |
316 // R = number of result operands (0 or 1). | 305 // R = number of result operands (0 or 1). |
317 // I = number of input operands. | 306 // I = number of input operands. |
(...skipping 2579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2897 | 2886 |
2898 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2887 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2899 }; | 2888 }; |
2900 | 2889 |
2901 #undef DECLARE_HYDROGEN_ACCESSOR | 2890 #undef DECLARE_HYDROGEN_ACCESSOR |
2902 #undef DECLARE_CONCRETE_INSTRUCTION | 2891 #undef DECLARE_CONCRETE_INSTRUCTION |
2903 | 2892 |
2904 } } // namespace v8::internal | 2893 } } // namespace v8::internal |
2905 | 2894 |
2906 #endif // V8_ARM_LITHIUM_ARM_H_ | 2895 #endif // V8_ARM_LITHIUM_ARM_H_ |
OLD | NEW |