OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 LInstruction() | 185 LInstruction() |
186 : environment_(NULL), | 186 : environment_(NULL), |
187 hydrogen_value_(NULL), | 187 hydrogen_value_(NULL), |
188 is_call_(false), | 188 is_call_(false), |
189 is_save_doubles_(false) { } | 189 is_save_doubles_(false) { } |
190 virtual ~LInstruction() { } | 190 virtual ~LInstruction() { } |
191 | 191 |
192 virtual void CompileToNative(LCodeGen* generator) = 0; | 192 virtual void CompileToNative(LCodeGen* generator) = 0; |
193 virtual const char* Mnemonic() const = 0; | 193 virtual const char* Mnemonic() const = 0; |
194 virtual void PrintTo(StringStream* stream); | 194 virtual void PrintTo(StringStream* stream); |
195 virtual void PrintDataTo(StringStream* stream) = 0; | 195 virtual void PrintDataTo(StringStream* stream); |
196 virtual void PrintOutputOperandTo(StringStream* stream) = 0; | 196 virtual void PrintOutputOperandTo(StringStream* stream); |
197 | 197 |
198 enum Opcode { | 198 enum Opcode { |
199 // Declare a unique enum value for each instruction. | 199 // Declare a unique enum value for each instruction. |
200 #define DECLARE_OPCODE(type) k##type, | 200 #define DECLARE_OPCODE(type) k##type, |
201 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE) | 201 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE) |
202 kNumberOfInstructions | 202 kNumberOfInstructions |
203 #undef DECLARE_OPCODE | 203 #undef DECLARE_OPCODE |
204 }; | 204 }; |
205 | 205 |
206 virtual Opcode opcode() const = 0; | 206 virtual Opcode opcode() const = 0; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 virtual bool HasResult() const { return R != 0; } | 282 virtual bool HasResult() const { return R != 0; } |
283 void set_result(LOperand* operand) { results_[0] = operand; } | 283 void set_result(LOperand* operand) { results_[0] = operand; } |
284 LOperand* result() { return results_[0]; } | 284 LOperand* result() { return results_[0]; } |
285 | 285 |
286 int InputCount() { return I; } | 286 int InputCount() { return I; } |
287 LOperand* InputAt(int i) { return inputs_[i]; } | 287 LOperand* InputAt(int i) { return inputs_[i]; } |
288 | 288 |
289 int TempCount() { return T; } | 289 int TempCount() { return T; } |
290 LOperand* TempAt(int i) { return temps_[i]; } | 290 LOperand* TempAt(int i) { return temps_[i]; } |
291 | 291 |
292 virtual void PrintDataTo(StringStream* stream); | |
293 virtual void PrintOutputOperandTo(StringStream* stream); | |
294 | |
295 protected: | 292 protected: |
296 EmbeddedContainer<LOperand*, R> results_; | 293 EmbeddedContainer<LOperand*, R> results_; |
297 EmbeddedContainer<LOperand*, I> inputs_; | 294 EmbeddedContainer<LOperand*, I> inputs_; |
298 EmbeddedContainer<LOperand*, T> temps_; | 295 EmbeddedContainer<LOperand*, T> temps_; |
299 }; | 296 }; |
300 | 297 |
301 | 298 |
302 class LGap: public LTemplateInstruction<0, 0, 0> { | 299 class LGap: public LTemplateInstruction<0, 0, 0> { |
303 public: | 300 public: |
304 explicit LGap(HBasicBlock* block) : block_(block) { | 301 explicit LGap(HBasicBlock* block) : block_(block) { |
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2321 | 2318 |
2322 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2319 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2323 }; | 2320 }; |
2324 | 2321 |
2325 #undef DECLARE_HYDROGEN_ACCESSOR | 2322 #undef DECLARE_HYDROGEN_ACCESSOR |
2326 #undef DECLARE_CONCRETE_INSTRUCTION | 2323 #undef DECLARE_CONCRETE_INSTRUCTION |
2327 | 2324 |
2328 } } // namespace v8::internal | 2325 } } // namespace v8::internal |
2329 | 2326 |
2330 #endif // V8_IA32_LITHIUM_IA32_H_ | 2327 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |