| 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 14 matching lines...) Expand all Loading... |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #ifndef V8_ARM_LITHIUM_ARM_H_ | 28 #ifndef V8_ARM_LITHIUM_ARM_H_ |
| 29 #define V8_ARM_LITHIUM_ARM_H_ | 29 #define V8_ARM_LITHIUM_ARM_H_ |
| 30 | 30 |
| 31 #include "hydrogen.h" | 31 #include "hydrogen.h" |
| 32 #include "lithium-allocator.h" | 32 #include "lithium-allocator.h" |
| 33 #include "lithium.h" | 33 #include "lithium.h" |
| 34 #include "safepoint-table.h" | 34 #include "safepoint-table.h" |
| 35 #include "utils.h" |
| 35 | 36 |
| 36 namespace v8 { | 37 namespace v8 { |
| 37 namespace internal { | 38 namespace internal { |
| 38 | 39 |
| 39 // Forward declarations. | 40 // Forward declarations. |
| 40 class LCodeGen; | 41 class LCodeGen; |
| 41 | 42 |
| 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ | 43 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ |
| 43 V(ControlInstruction) \ | 44 V(ControlInstruction) \ |
| 44 V(Call) \ | 45 V(Call) \ |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 private: | 279 private: |
| 279 LEnvironment* environment_; | 280 LEnvironment* environment_; |
| 280 SetOncePointer<LPointerMap> pointer_map_; | 281 SetOncePointer<LPointerMap> pointer_map_; |
| 281 HValue* hydrogen_value_; | 282 HValue* hydrogen_value_; |
| 282 SetOncePointer<LEnvironment> deoptimization_environment_; | 283 SetOncePointer<LEnvironment> deoptimization_environment_; |
| 283 bool is_call_; | 284 bool is_call_; |
| 284 bool is_save_doubles_; | 285 bool is_save_doubles_; |
| 285 }; | 286 }; |
| 286 | 287 |
| 287 | 288 |
| 288 template<typename ElementType, int NumElements> | |
| 289 class OperandContainer { | |
| 290 public: | |
| 291 OperandContainer() { | |
| 292 for (int i = 0; i < NumElements; i++) elems_[i] = NULL; | |
| 293 } | |
| 294 int length() { return NumElements; } | |
| 295 ElementType& operator[](int i) { | |
| 296 ASSERT(i < length()); | |
| 297 return elems_[i]; | |
| 298 } | |
| 299 void PrintOperandsTo(StringStream* stream); | |
| 300 | |
| 301 private: | |
| 302 ElementType elems_[NumElements]; | |
| 303 }; | |
| 304 | |
| 305 | |
| 306 template<typename ElementType> | |
| 307 class OperandContainer<ElementType, 0> { | |
| 308 public: | |
| 309 int length() { return 0; } | |
| 310 void PrintOperandsTo(StringStream* stream) { } | |
| 311 ElementType& operator[](int i) { | |
| 312 UNREACHABLE(); | |
| 313 static ElementType t = 0; | |
| 314 return t; | |
| 315 } | |
| 316 }; | |
| 317 | |
| 318 | |
| 319 // R = number of result operands (0 or 1). | 289 // R = number of result operands (0 or 1). |
| 320 // I = number of input operands. | 290 // I = number of input operands. |
| 321 // T = number of temporary operands. | 291 // T = number of temporary operands. |
| 322 template<int R, int I, int T> | 292 template<int R, int I, int T> |
| 323 class LTemplateInstruction: public LInstruction { | 293 class LTemplateInstruction: public LInstruction { |
| 324 public: | 294 public: |
| 325 // Allow 0 or 1 output operands. | 295 // Allow 0 or 1 output operands. |
| 326 STATIC_ASSERT(R == 0 || R == 1); | 296 STATIC_ASSERT(R == 0 || R == 1); |
| 327 virtual bool HasResult() const { return R != 0; } | 297 virtual bool HasResult() const { return R != 0; } |
| 328 void set_result(LOperand* operand) { results_[0] = operand; } | 298 void set_result(LOperand* operand) { results_[0] = operand; } |
| 329 LOperand* result() { return results_[0]; } | 299 LOperand* result() { return results_[0]; } |
| 330 | 300 |
| 331 int InputCount() { return I; } | 301 int InputCount() { return I; } |
| 332 LOperand* InputAt(int i) { return inputs_[i]; } | 302 LOperand* InputAt(int i) { return inputs_[i]; } |
| 333 | 303 |
| 334 int TempCount() { return T; } | 304 int TempCount() { return T; } |
| 335 LOperand* TempAt(int i) { return temps_[i]; } | 305 LOperand* TempAt(int i) { return temps_[i]; } |
| 336 | 306 |
| 337 virtual void PrintDataTo(StringStream* stream); | 307 virtual void PrintDataTo(StringStream* stream); |
| 338 virtual void PrintOutputOperandTo(StringStream* stream); | 308 virtual void PrintOutputOperandTo(StringStream* stream); |
| 339 | 309 |
| 340 protected: | 310 protected: |
| 341 OperandContainer<LOperand*, R> results_; | 311 EmbeddedContainer<LOperand*, R> results_; |
| 342 OperandContainer<LOperand*, I> inputs_; | 312 EmbeddedContainer<LOperand*, I> inputs_; |
| 343 OperandContainer<LOperand*, T> temps_; | 313 EmbeddedContainer<LOperand*, T> temps_; |
| 344 }; | 314 }; |
| 345 | 315 |
| 346 | 316 |
| 347 class LGap: public LTemplateInstruction<0, 0, 0> { | 317 class LGap: public LTemplateInstruction<0, 0, 0> { |
| 348 public: | 318 public: |
| 349 explicit LGap(HBasicBlock* block) | 319 explicit LGap(HBasicBlock* block) |
| 350 : block_(block) { | 320 : block_(block) { |
| 351 parallel_moves_[BEFORE] = NULL; | 321 parallel_moves_[BEFORE] = NULL; |
| 352 parallel_moves_[START] = NULL; | 322 parallel_moves_[START] = NULL; |
| 353 parallel_moves_[END] = NULL; | 323 parallel_moves_[END] = NULL; |
| (...skipping 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2319 | 2289 |
| 2320 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2290 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2321 }; | 2291 }; |
| 2322 | 2292 |
| 2323 #undef DECLARE_HYDROGEN_ACCESSOR | 2293 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2324 #undef DECLARE_CONCRETE_INSTRUCTION | 2294 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2325 | 2295 |
| 2326 } } // namespace v8::internal | 2296 } } // namespace v8::internal |
| 2327 | 2297 |
| 2328 #endif // V8_ARM_LITHIUM_ARM_H_ | 2298 #endif // V8_ARM_LITHIUM_ARM_H_ |
| OLD | NEW |