Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: src/x64/lithium-x64.h

Issue 13841003: Separate Math Lithium operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 V(LoadElements) \ 126 V(LoadElements) \
127 V(LoadExternalArrayPointer) \ 127 V(LoadExternalArrayPointer) \
128 V(LoadFunctionPrototype) \ 128 V(LoadFunctionPrototype) \
129 V(LoadGlobalCell) \ 129 V(LoadGlobalCell) \
130 V(LoadGlobalGeneric) \ 130 V(LoadGlobalGeneric) \
131 V(LoadKeyed) \ 131 V(LoadKeyed) \
132 V(LoadKeyedGeneric) \ 132 V(LoadKeyedGeneric) \
133 V(LoadNamedField) \ 133 V(LoadNamedField) \
134 V(LoadNamedFieldPolymorphic) \ 134 V(LoadNamedFieldPolymorphic) \
135 V(LoadNamedGeneric) \ 135 V(LoadNamedGeneric) \
136 V(MathAbs) \
137 V(MathCos) \
136 V(MathExp) \ 138 V(MathExp) \
139 V(MathFloor) \
137 V(MathFloorOfDiv) \ 140 V(MathFloorOfDiv) \
141 V(MathLog) \
138 V(MathMinMax) \ 142 V(MathMinMax) \
143 V(MathPowHalf) \
144 V(MathRound) \
145 V(MathSin) \
146 V(MathSqrt) \
147 V(MathTan) \
139 V(ModI) \ 148 V(ModI) \
140 V(MulI) \ 149 V(MulI) \
141 V(NumberTagD) \ 150 V(NumberTagD) \
142 V(NumberTagI) \ 151 V(NumberTagI) \
143 V(NumberTagU) \ 152 V(NumberTagU) \
144 V(NumberUntagD) \ 153 V(NumberUntagD) \
145 V(ObjectLiteral) \ 154 V(ObjectLiteral) \
146 V(OsrEntry) \ 155 V(OsrEntry) \
147 V(OuterContext) \ 156 V(OuterContext) \
148 V(Parameter) \ 157 V(Parameter) \
(...skipping 21 matching lines...) Expand all
170 V(StringLength) \ 179 V(StringLength) \
171 V(SubI) \ 180 V(SubI) \
172 V(TaggedToI) \ 181 V(TaggedToI) \
173 V(ThisFunction) \ 182 V(ThisFunction) \
174 V(Throw) \ 183 V(Throw) \
175 V(ToFastProperties) \ 184 V(ToFastProperties) \
176 V(TransitionElementsKind) \ 185 V(TransitionElementsKind) \
177 V(TrapAllocationMemento) \ 186 V(TrapAllocationMemento) \
178 V(Typeof) \ 187 V(Typeof) \
179 V(TypeofIsAndBranch) \ 188 V(TypeofIsAndBranch) \
180 V(UnaryMathOperation) \
181 V(UnknownOSRValue) \ 189 V(UnknownOSRValue) \
182 V(ValueOf) \ 190 V(ValueOf) \
183 V(ForInPrepareMap) \ 191 V(ForInPrepareMap) \
184 V(ForInCacheArray) \ 192 V(ForInCacheArray) \
185 V(CheckMapValue) \ 193 V(CheckMapValue) \
186 V(LoadFieldByIndex) \ 194 V(LoadFieldByIndex) \
187 V(DateField) \ 195 V(DateField) \
188 V(WrapReceiver) \ 196 V(WrapReceiver) \
189 V(Drop) \ 197 V(Drop) \
190 V(InnerAllocatedObject) 198 V(InnerAllocatedObject)
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 650
643 Token::Value op() const { return hydrogen()->token(); } 651 Token::Value op() const { return hydrogen()->token(); }
644 bool is_double() const { 652 bool is_double() const {
645 return hydrogen()->representation().IsDouble(); 653 return hydrogen()->representation().IsDouble();
646 } 654 }
647 655
648 virtual void PrintDataTo(StringStream* stream); 656 virtual void PrintDataTo(StringStream* stream);
649 }; 657 };
650 658
651 659
652 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> { 660 class LMathFloor: public LTemplateInstruction<1, 1, 0> {
653 public: 661 public:
654 explicit LUnaryMathOperation(LOperand* value) { 662 explicit LMathFloor(LOperand* value) {
655 inputs_[0] = value; 663 inputs_[0] = value;
656 } 664 }
657 665
658 LOperand* value() { return inputs_[0]; } 666 LOperand* value() { return inputs_[0]; }
659 667
660 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") 668 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
661 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 669 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
662
663 virtual void PrintDataTo(StringStream* stream);
664 BuiltinFunctionId op() const { return hydrogen()->op(); }
665 }; 670 };
666 671
667 672
673 class LMathRound: public LTemplateInstruction<1, 1, 0> {
674 public:
675 explicit LMathRound(LOperand* value) {
676 inputs_[0] = value;
677 }
678
679 LOperand* value() { return inputs_[0]; }
680
681 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
682 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
683 };
684
685
686 class LMathAbs: public LTemplateInstruction<1, 1, 0> {
687 public:
688 explicit LMathAbs(LOperand* value) {
689 inputs_[0] = value;
690 }
691
692 LOperand* value() { return inputs_[0]; }
693
694 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
695 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
696 };
697
698
699 class LMathLog: public LTemplateInstruction<1, 1, 0> {
700 public:
701 explicit LMathLog(LOperand* value) {
702 inputs_[0] = value;
703 }
704
705 LOperand* value() { return inputs_[0]; }
706
707 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
708 };
709
710
711 class LMathSin: public LTemplateInstruction<1, 1, 0> {
712 public:
713 explicit LMathSin(LOperand* value) {
714 inputs_[0] = value;
715 }
716
717 LOperand* value() { return inputs_[0]; }
718
719 DECLARE_CONCRETE_INSTRUCTION(MathSin, "math-sin")
720 };
721
722
723 class LMathCos: public LTemplateInstruction<1, 1, 0> {
724 public:
725 explicit LMathCos(LOperand* value) {
726 inputs_[0] = value;
727 }
728
729 LOperand* value() { return inputs_[0]; }
730
731 DECLARE_CONCRETE_INSTRUCTION(MathCos, "math-cos")
732 };
733
734
735 class LMathTan: public LTemplateInstruction<1, 1, 0> {
736 public:
737 explicit LMathTan(LOperand* value) {
738 inputs_[0] = value;
739 }
740
741 LOperand* value() { return inputs_[0]; }
742
743 DECLARE_CONCRETE_INSTRUCTION(MathTan, "math-tan")
744 };
745
746
668 class LMathExp: public LTemplateInstruction<1, 1, 2> { 747 class LMathExp: public LTemplateInstruction<1, 1, 2> {
669 public: 748 public:
670 LMathExp(LOperand* value, LOperand* temp1, LOperand* temp2) { 749 LMathExp(LOperand* value, LOperand* temp1, LOperand* temp2) {
671 inputs_[0] = value; 750 inputs_[0] = value;
672 temps_[0] = temp1; 751 temps_[0] = temp1;
673 temps_[1] = temp2; 752 temps_[1] = temp2;
674 ExternalReference::InitializeMathExpData(); 753 ExternalReference::InitializeMathExpData();
675 } 754 }
676 755
677 LOperand* value() { return inputs_[0]; } 756 LOperand* value() { return inputs_[0]; }
678 LOperand* temp1() { return temps_[0]; } 757 LOperand* temp1() { return temps_[0]; }
679 LOperand* temp2() { return temps_[1]; } 758 LOperand* temp2() { return temps_[1]; }
680 759
681 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") 760 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
682
683 virtual void PrintDataTo(StringStream* stream);
684 }; 761 };
685 762
686 763
764 class LMathSqrt: public LTemplateInstruction<1, 1, 0> {
765 public:
766 explicit LMathSqrt(LOperand* value) {
767 inputs_[0] = value;
768 }
769
770 LOperand* value() { return inputs_[0]; }
771
772 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
773 };
774
775
776 class LMathPowHalf: public LTemplateInstruction<1, 1, 0> {
777 public:
778 explicit LMathPowHalf(LOperand* value) {
779 inputs_[0] = value;
780 }
781
782 LOperand* value() { return inputs_[0]; }
783
784 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
785 };
786
787
687 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { 788 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> {
688 public: 789 public:
689 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { 790 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
690 inputs_[0] = left; 791 inputs_[0] = left;
691 inputs_[1] = right; 792 inputs_[1] = right;
692 } 793 }
693 794
694 LOperand* left() { return inputs_[0]; } 795 LOperand* left() { return inputs_[0]; }
695 LOperand* right() { return inputs_[1]; } 796 LOperand* right() { return inputs_[1]; }
696 797
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 class LMathMinMax: public LTemplateInstruction<1, 2, 0> { 1343 class LMathMinMax: public LTemplateInstruction<1, 2, 0> {
1243 public: 1344 public:
1244 LMathMinMax(LOperand* left, LOperand* right) { 1345 LMathMinMax(LOperand* left, LOperand* right) {
1245 inputs_[0] = left; 1346 inputs_[0] = left;
1246 inputs_[1] = right; 1347 inputs_[1] = right;
1247 } 1348 }
1248 1349
1249 LOperand* left() { return inputs_[0]; } 1350 LOperand* left() { return inputs_[0]; }
1250 LOperand* right() { return inputs_[1]; } 1351 LOperand* right() { return inputs_[1]; }
1251 1352
1252 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max") 1353 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
1253 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) 1354 DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
1254 }; 1355 };
1255 1356
1256 1357
1257 class LPower: public LTemplateInstruction<1, 2, 0> { 1358 class LPower: public LTemplateInstruction<1, 2, 0> {
1258 public: 1359 public:
1259 LPower(LOperand* left, LOperand* right) { 1360 LPower(LOperand* left, LOperand* right) {
1260 inputs_[0] = left; 1361 inputs_[0] = left;
1261 inputs_[1] = right; 1362 inputs_[1] = right;
1262 } 1363 }
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2490 LPlatformChunk* Build(); 2591 LPlatformChunk* Build();
2491 2592
2492 // Declare methods that deal with the individual node types. 2593 // Declare methods that deal with the individual node types.
2493 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 2594 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2494 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 2595 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2495 #undef DECLARE_DO 2596 #undef DECLARE_DO
2496 2597
2497 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val); 2598 static HValue* SimplifiedDividendForMathFloorOfDiv(HValue* val);
2498 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val); 2599 static HValue* SimplifiedDivisorForMathFloorOfDiv(HValue* val);
2499 2600
2601 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2602 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2603 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2604 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2605 LInstruction* DoMathSin(HUnaryMathOperation* instr);
2606 LInstruction* DoMathCos(HUnaryMathOperation* instr);
2607 LInstruction* DoMathTan(HUnaryMathOperation* instr);
2608 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2609 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2610 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2611
2500 private: 2612 private:
2501 enum Status { 2613 enum Status {
2502 UNUSED, 2614 UNUSED,
2503 BUILDING, 2615 BUILDING,
2504 DONE, 2616 DONE,
2505 ABORTED 2617 ABORTED
2506 }; 2618 };
2507 2619
2508 LPlatformChunk* chunk() const { return chunk_; } 2620 LPlatformChunk* chunk() const { return chunk_; }
2509 CompilationInfo* info() const { return info_; } 2621 CompilationInfo* info() const { return info_; }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2625 2737
2626 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2738 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2627 }; 2739 };
2628 2740
2629 #undef DECLARE_HYDROGEN_ACCESSOR 2741 #undef DECLARE_HYDROGEN_ACCESSOR
2630 #undef DECLARE_CONCRETE_INSTRUCTION 2742 #undef DECLARE_CONCRETE_INSTRUCTION
2631 2743
2632 } } // namespace v8::int 2744 } } // namespace v8::int
2633 2745
2634 #endif // V8_X64_LITHIUM_X64_H_ 2746 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698