| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ | 43 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ |
| 44 V(ControlInstruction) \ | 44 V(ControlInstruction) \ |
| 45 V(Call) \ | 45 V(Call) \ |
| 46 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) | 46 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) |
| 47 | 47 |
| 48 | 48 |
| 49 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ | 49 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ |
| 50 V(AccessArgumentsAt) \ | 50 V(AccessArgumentsAt) \ |
| 51 V(AddI) \ | 51 V(AddI) \ |
| 52 V(Allocate) \ | 52 V(Allocate) \ |
| 53 V(AllocateObject) \ |
| 53 V(ApplyArguments) \ | 54 V(ApplyArguments) \ |
| 54 V(ArgumentsElements) \ | 55 V(ArgumentsElements) \ |
| 55 V(ArgumentsLength) \ | 56 V(ArgumentsLength) \ |
| 56 V(ArithmeticD) \ | 57 V(ArithmeticD) \ |
| 57 V(ArithmeticT) \ | 58 V(ArithmeticT) \ |
| 58 V(BitI) \ | 59 V(BitI) \ |
| 59 V(BitNotI) \ | 60 V(BitNotI) \ |
| 60 V(BoundsCheck) \ | 61 V(BoundsCheck) \ |
| 61 V(Branch) \ | 62 V(Branch) \ |
| 62 V(CallConstantFunction) \ | 63 V(CallConstantFunction) \ |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 } | 346 } |
| 346 | 347 |
| 347 Label* FalseLabel(LChunk* chunk) { | 348 Label* FalseLabel(LChunk* chunk) { |
| 348 if (false_label_ == NULL) { | 349 if (false_label_ == NULL) { |
| 349 false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk)); | 350 false_label_ = chunk->GetAssemblyLabel(FalseDestination(chunk)); |
| 350 } | 351 } |
| 351 return false_label_; | 352 return false_label_; |
| 352 } | 353 } |
| 353 | 354 |
| 354 protected: | 355 protected: |
| 355 int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); } | 356 int true_block_id() { return SuccessorAt(0)->block_id(); } |
| 356 int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); } | 357 int false_block_id() { return SuccessorAt(1)->block_id(); } |
| 357 | 358 |
| 358 private: | 359 private: |
| 359 DECLARE_HYDROGEN_ACCESSOR(ControlInstruction); | 360 DECLARE_HYDROGEN_ACCESSOR(ControlInstruction); |
| 360 | 361 |
| 361 Label* false_label_; | 362 Label* false_label_; |
| 362 Label* true_label_; | 363 Label* true_label_; |
| 363 }; | 364 }; |
| 364 | 365 |
| 365 | 366 |
| 366 class LGap: public LTemplateInstruction<0, 0, 0> { | 367 class LGap: public LTemplateInstruction<0, 0, 0> { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 bool HasReplacement() const { return replacement_ != NULL; } | 510 bool HasReplacement() const { return replacement_ != NULL; } |
| 510 | 511 |
| 511 private: | 512 private: |
| 512 Label label_; | 513 Label label_; |
| 513 LLabel* replacement_; | 514 LLabel* replacement_; |
| 514 }; | 515 }; |
| 515 | 516 |
| 516 | 517 |
| 517 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { | 518 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { |
| 518 public: | 519 public: |
| 519 LOsrEntry(); | 520 LOsrEntry() {} |
| 520 | 521 |
| 521 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } | 522 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 522 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 523 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
| 523 | |
| 524 LOperand** SpilledRegisterArray() { return register_spills_; } | |
| 525 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } | |
| 526 | |
| 527 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand) { | |
| 528 UNIMPLEMENTED(); | |
| 529 } | |
| 530 void MarkSpilledDoubleRegister(int allocation_index, | |
| 531 LOperand* spill_operand) { | |
| 532 UNIMPLEMENTED(); | |
| 533 } | |
| 534 | |
| 535 private: | |
| 536 // Arrays of spill slot operands for registers with an assigned spill | |
| 537 // slot, i.e., that must also be restored to the spill slot on OSR entry. | |
| 538 // NULL if the register has no assigned spill slot. Indexed by allocation | |
| 539 // index. | |
| 540 LOperand* register_spills_[Register::kMaxNumAllocatableRegisters]; | |
| 541 LOperand* | |
| 542 double_register_spills_[DoubleRegister::kMaxNumAllocatableRegisters]; | |
| 543 }; | 524 }; |
| 544 | 525 |
| 545 | 526 |
| 546 class LOuterContext: public LTemplateInstruction<1, 1, 0> { | 527 class LOuterContext: public LTemplateInstruction<1, 1, 0> { |
| 547 public: | 528 public: |
| 548 explicit LOuterContext(LOperand* context) { | 529 explicit LOuterContext(LOperand* context) { |
| 549 inputs_[0] = context; | 530 inputs_[0] = context; |
| 550 } | 531 } |
| 551 | 532 |
| 552 LOperand* context() { return inputs_[0]; } | 533 LOperand* context() { return inputs_[0]; } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 | 587 |
| 607 LOperand* size() { return inputs_[0]; } | 588 LOperand* size() { return inputs_[0]; } |
| 608 LOperand* temp1() { return temps_[0]; } | 589 LOperand* temp1() { return temps_[0]; } |
| 609 LOperand* temp2() { return temps_[1]; } | 590 LOperand* temp2() { return temps_[1]; } |
| 610 | 591 |
| 611 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") | 592 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") |
| 612 DECLARE_HYDROGEN_ACCESSOR(Allocate) | 593 DECLARE_HYDROGEN_ACCESSOR(Allocate) |
| 613 }; | 594 }; |
| 614 | 595 |
| 615 | 596 |
| 616 class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> { | 597 class LAllocateObject: public LTemplateInstruction<1, 0, 2> { |
| 617 public: | 598 public: |
| 618 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") | 599 // TODO(jbramley): On ia32, this takes a context, and it is used by the |
| 619 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) | 600 // deferred code. On ARM, an LOperand is allocated for another input, but it |
| 601 // is never used, and the deferred code doesn't need the context. Why? |
| 602 LAllocateObject(LOperand* temp1, LOperand* temp2) { |
| 603 temps_[0] = temp1; |
| 604 temps_[1] = temp2; |
| 605 } |
| 606 |
| 607 LOperand* temp1() { return temps_[0]; } |
| 608 LOperand* temp2() { return temps_[1]; } |
| 609 |
| 610 DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object") |
| 611 DECLARE_HYDROGEN_ACCESSOR(AllocateObject) |
| 620 }; | 612 }; |
| 621 | 613 |
| 622 | 614 |
| 623 class LApplyArguments: public LTemplateInstruction<1, 4, 0> { | 615 class LApplyArguments: public LTemplateInstruction<1, 4, 0> { |
| 624 public: | 616 public: |
| 625 LApplyArguments(LOperand* function, | 617 LApplyArguments(LOperand* function, |
| 626 LOperand* receiver, | 618 LOperand* receiver, |
| 627 LOperand* length, | 619 LOperand* length, |
| 628 LOperand* elements) { | 620 LOperand* elements) { |
| 629 inputs_[0] = function; | 621 inputs_[0] = function; |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 | 944 |
| 953 class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { | 945 class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { |
| 954 public: | 946 public: |
| 955 explicit LCheckNonSmi(LOperand* value) { | 947 explicit LCheckNonSmi(LOperand* value) { |
| 956 inputs_[0] = value; | 948 inputs_[0] = value; |
| 957 } | 949 } |
| 958 | 950 |
| 959 LOperand* value() { return inputs_[0]; } | 951 LOperand* value() { return inputs_[0]; } |
| 960 | 952 |
| 961 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") | 953 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") |
| 954 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) |
| 962 }; | 955 }; |
| 963 | 956 |
| 964 | 957 |
| 965 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 2> { | 958 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 2> { |
| 966 public: | 959 public: |
| 967 explicit LCheckPrototypeMaps(LOperand* temp1, LOperand* temp2) { | 960 explicit LCheckPrototypeMaps(LOperand* temp1, LOperand* temp2) { |
| 968 temps_[0] = temp1; | 961 temps_[0] = temp1; |
| 969 temps_[1] = temp2; | 962 temps_[1] = temp2; |
| 970 } | 963 } |
| 971 | 964 |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2050 explicit LPushArgument(LOperand* value) { | 2043 explicit LPushArgument(LOperand* value) { |
| 2051 inputs_[0] = value; | 2044 inputs_[0] = value; |
| 2052 } | 2045 } |
| 2053 | 2046 |
| 2054 LOperand* value() { return inputs_[0]; } | 2047 LOperand* value() { return inputs_[0]; } |
| 2055 | 2048 |
| 2056 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") | 2049 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") |
| 2057 }; | 2050 }; |
| 2058 | 2051 |
| 2059 | 2052 |
| 2053 class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> { |
| 2054 public: |
| 2055 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") |
| 2056 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) |
| 2057 }; |
| 2058 |
| 2059 |
| 2060 class LReturn: public LTemplateInstruction<0, 2, 0> { | 2060 class LReturn: public LTemplateInstruction<0, 2, 0> { |
| 2061 public: | 2061 public: |
| 2062 LReturn(LOperand* value, LOperand* parameter_count) { | 2062 LReturn(LOperand* value, LOperand* parameter_count) { |
| 2063 inputs_[0] = value; | 2063 inputs_[0] = value; |
| 2064 inputs_[1] = parameter_count; | 2064 inputs_[1] = parameter_count; |
| 2065 } | 2065 } |
| 2066 | 2066 |
| 2067 LOperand* value() { return inputs_[0]; } | 2067 LOperand* value() { return inputs_[0]; } |
| 2068 LOperand* parameter_count() { return inputs_[1]; } | 2068 LOperand* parameter_count() { return inputs_[1]; } |
| 2069 | 2069 |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2843 | 2843 |
| 2844 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2844 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2845 }; | 2845 }; |
| 2846 | 2846 |
| 2847 #undef DECLARE_HYDROGEN_ACCESSOR | 2847 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2848 #undef DECLARE_CONCRETE_INSTRUCTION | 2848 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2849 | 2849 |
| 2850 } } // namespace v8::internal | 2850 } } // namespace v8::internal |
| 2851 | 2851 |
| 2852 #endif // V8_A64_LITHIUM_A64_H_ | 2852 #endif // V8_A64_LITHIUM_A64_H_ |
| OLD | NEW |