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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 H##type* hydrogen() const { \ | 205 H##type* hydrogen() const { \ |
206 return H##type::cast(hydrogen_value()); \ | 206 return H##type::cast(hydrogen_value()); \ |
207 } | 207 } |
208 | 208 |
209 | 209 |
210 class LInstruction: public ZoneObject { | 210 class LInstruction: public ZoneObject { |
211 public: | 211 public: |
212 LInstruction() | 212 LInstruction() |
213 : environment_(NULL), | 213 : environment_(NULL), |
214 hydrogen_value_(NULL), | 214 hydrogen_value_(NULL), |
215 is_call_(false) { } | 215 is_call_(false), |
216 position_(RelocInfo::kNoPosition) { } | |
216 virtual ~LInstruction() { } | 217 virtual ~LInstruction() { } |
217 | 218 |
218 virtual void CompileToNative(LCodeGen* generator) = 0; | 219 virtual void CompileToNative(LCodeGen* generator) = 0; |
219 virtual const char* Mnemonic() const = 0; | 220 virtual const char* Mnemonic() const = 0; |
220 virtual void PrintTo(StringStream* stream); | 221 virtual void PrintTo(StringStream* stream); |
221 virtual void PrintDataTo(StringStream* stream); | 222 virtual void PrintDataTo(StringStream* stream); |
222 virtual void PrintOutputOperandTo(StringStream* stream); | 223 virtual void PrintOutputOperandTo(StringStream* stream); |
223 | 224 |
224 enum Opcode { | 225 enum Opcode { |
225 // Declare a unique enum value for each instruction. | 226 // Declare a unique enum value for each instruction. |
(...skipping 18 matching lines...) Expand all Loading... | |
244 virtual bool IsControl() const { return false; } | 245 virtual bool IsControl() const { return false; } |
245 | 246 |
246 void set_environment(LEnvironment* env) { environment_ = env; } | 247 void set_environment(LEnvironment* env) { environment_ = env; } |
247 LEnvironment* environment() const { return environment_; } | 248 LEnvironment* environment() const { return environment_; } |
248 bool HasEnvironment() const { return environment_ != NULL; } | 249 bool HasEnvironment() const { return environment_ != NULL; } |
249 | 250 |
250 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 251 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
251 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 252 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
252 bool HasPointerMap() const { return pointer_map_.is_set(); } | 253 bool HasPointerMap() const { return pointer_map_.is_set(); } |
253 | 254 |
255 void set_position(int pos) { position_ = pos; } | |
256 int position() { return position_; } | |
254 | 257 |
255 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 258 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
256 HValue* hydrogen_value() const { return hydrogen_value_; } | 259 HValue* hydrogen_value() const { return hydrogen_value_; } |
257 | 260 |
258 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 261 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } |
259 | 262 |
260 void MarkAsCall() { is_call_ = true; } | 263 void MarkAsCall() { is_call_ = true; } |
261 | 264 |
262 // Interface to the register allocator and iterators. | 265 // Interface to the register allocator and iterators. |
263 bool ClobbersTemps() const { return is_call_; } | 266 bool ClobbersTemps() const { return is_call_; } |
(...skipping 29 matching lines...) Expand all Loading... | |
293 virtual LOperand* InputAt(int i) = 0; | 296 virtual LOperand* InputAt(int i) = 0; |
294 | 297 |
295 friend class TempIterator; | 298 friend class TempIterator; |
296 virtual int TempCount() = 0; | 299 virtual int TempCount() = 0; |
297 virtual LOperand* TempAt(int i) = 0; | 300 virtual LOperand* TempAt(int i) = 0; |
298 | 301 |
299 LEnvironment* environment_; | 302 LEnvironment* environment_; |
300 SetOncePointer<LPointerMap> pointer_map_; | 303 SetOncePointer<LPointerMap> pointer_map_; |
301 HValue* hydrogen_value_; | 304 HValue* hydrogen_value_; |
302 bool is_call_; | 305 bool is_call_; |
306 int position_; | |
danno
2013/07/29 12:29:01
Please turn this into a bit field with is_call usi
| |
303 }; | 307 }; |
304 | 308 |
305 | 309 |
306 // R = number of result operands (0 or 1). | 310 // R = number of result operands (0 or 1). |
307 // I = number of input operands. | 311 // I = number of input operands. |
308 // T = number of temporary operands. | 312 // T = number of temporary operands. |
309 template<int R, int I, int T> | 313 template<int R, int I, int T> |
310 class LTemplateInstruction: public LInstruction { | 314 class LTemplateInstruction: public LInstruction { |
311 public: | 315 public: |
312 // Allow 0 or 1 output operands. | 316 // Allow 0 or 1 output operands. |
(...skipping 2627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2940 | 2944 |
2941 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2945 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2942 }; | 2946 }; |
2943 | 2947 |
2944 #undef DECLARE_HYDROGEN_ACCESSOR | 2948 #undef DECLARE_HYDROGEN_ACCESSOR |
2945 #undef DECLARE_CONCRETE_INSTRUCTION | 2949 #undef DECLARE_CONCRETE_INSTRUCTION |
2946 | 2950 |
2947 } } // namespace v8::internal | 2951 } } // namespace v8::internal |
2948 | 2952 |
2949 #endif // V8_IA32_LITHIUM_IA32_H_ | 2953 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |