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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 H##type* hydrogen() const { \ | 203 H##type* hydrogen() const { \ |
204 return H##type::cast(hydrogen_value()); \ | 204 return H##type::cast(hydrogen_value()); \ |
205 } | 205 } |
206 | 206 |
207 | 207 |
208 class LInstruction: public ZoneObject { | 208 class LInstruction: public ZoneObject { |
209 public: | 209 public: |
210 LInstruction() | 210 LInstruction() |
211 : environment_(NULL), | 211 : environment_(NULL), |
212 hydrogen_value_(NULL), | 212 hydrogen_value_(NULL), |
213 is_call_(false) { } | 213 is_call_(false), |
| 214 position_(RelocInfo::kNoPosition) { } |
214 | 215 |
215 virtual ~LInstruction() { } | 216 virtual ~LInstruction() { } |
216 | 217 |
217 virtual void CompileToNative(LCodeGen* generator) = 0; | 218 virtual void CompileToNative(LCodeGen* generator) = 0; |
218 virtual const char* Mnemonic() const = 0; | 219 virtual const char* Mnemonic() const = 0; |
219 virtual void PrintTo(StringStream* stream); | 220 virtual void PrintTo(StringStream* stream); |
220 virtual void PrintDataTo(StringStream* stream); | 221 virtual void PrintDataTo(StringStream* stream); |
221 virtual void PrintOutputOperandTo(StringStream* stream); | 222 virtual void PrintOutputOperandTo(StringStream* stream); |
222 | 223 |
223 enum Opcode { | 224 enum Opcode { |
(...skipping 19 matching lines...) Expand all Loading... |
243 virtual bool IsControl() const { return false; } | 244 virtual bool IsControl() const { return false; } |
244 | 245 |
245 void set_environment(LEnvironment* env) { environment_ = env; } | 246 void set_environment(LEnvironment* env) { environment_ = env; } |
246 LEnvironment* environment() const { return environment_; } | 247 LEnvironment* environment() const { return environment_; } |
247 bool HasEnvironment() const { return environment_ != NULL; } | 248 bool HasEnvironment() const { return environment_ != NULL; } |
248 | 249 |
249 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 250 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
250 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 251 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
251 bool HasPointerMap() const { return pointer_map_.is_set(); } | 252 bool HasPointerMap() const { return pointer_map_.is_set(); } |
252 | 253 |
| 254 void set_position(int pos) { position_ = pos; } |
| 255 int position() { return position_; } |
| 256 |
253 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 257 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
254 HValue* hydrogen_value() const { return hydrogen_value_; } | 258 HValue* hydrogen_value() const { return hydrogen_value_; } |
255 | 259 |
256 void MarkAsCall() { is_call_ = true; } | 260 void MarkAsCall() { is_call_ = true; } |
257 | 261 |
258 // Interface to the register allocator and iterators. | 262 // Interface to the register allocator and iterators. |
259 bool ClobbersTemps() const { return is_call_; } | 263 bool ClobbersTemps() const { return is_call_; } |
260 bool ClobbersRegisters() const { return is_call_; } | 264 bool ClobbersRegisters() const { return is_call_; } |
261 bool ClobbersDoubleRegisters() const { return is_call_; } | 265 bool ClobbersDoubleRegisters() const { return is_call_; } |
262 | 266 |
(...skipping 21 matching lines...) Expand all Loading... |
284 virtual LOperand* InputAt(int i) = 0; | 288 virtual LOperand* InputAt(int i) = 0; |
285 | 289 |
286 friend class TempIterator; | 290 friend class TempIterator; |
287 virtual int TempCount() = 0; | 291 virtual int TempCount() = 0; |
288 virtual LOperand* TempAt(int i) = 0; | 292 virtual LOperand* TempAt(int i) = 0; |
289 | 293 |
290 LEnvironment* environment_; | 294 LEnvironment* environment_; |
291 SetOncePointer<LPointerMap> pointer_map_; | 295 SetOncePointer<LPointerMap> pointer_map_; |
292 HValue* hydrogen_value_; | 296 HValue* hydrogen_value_; |
293 bool is_call_; | 297 bool is_call_; |
| 298 int position_; |
294 }; | 299 }; |
295 | 300 |
296 | 301 |
297 // R = number of result operands (0 or 1). | 302 // R = number of result operands (0 or 1). |
298 // I = number of input operands. | 303 // I = number of input operands. |
299 // T = number of temporary operands. | 304 // T = number of temporary operands. |
300 template<int R, int I, int T> | 305 template<int R, int I, int T> |
301 class LTemplateInstruction: public LInstruction { | 306 class LTemplateInstruction: public LInstruction { |
302 public: | 307 public: |
303 // Allow 0 or 1 output operands. | 308 // Allow 0 or 1 output operands. |
(...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2706 | 2711 |
2707 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2712 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2708 }; | 2713 }; |
2709 | 2714 |
2710 #undef DECLARE_HYDROGEN_ACCESSOR | 2715 #undef DECLARE_HYDROGEN_ACCESSOR |
2711 #undef DECLARE_CONCRETE_INSTRUCTION | 2716 #undef DECLARE_CONCRETE_INSTRUCTION |
2712 | 2717 |
2713 } } // namespace v8::int | 2718 } } // namespace v8::int |
2714 | 2719 |
2715 #endif // V8_X64_LITHIUM_X64_H_ | 2720 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |