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

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

Issue 425943002: Inline Math.fround in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: arm64 port Created 6 years, 4 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 | « no previous file | src/arm/lithium-arm.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_ARM_LITHIUM_ARM_H_ 5 #ifndef V8_ARM_LITHIUM_ARM_H_
6 #define V8_ARM_LITHIUM_ARM_H_ 6 #define V8_ARM_LITHIUM_ARM_H_
7 7
8 #include "src/hydrogen.h" 8 #include "src/hydrogen.h"
9 #include "src/lithium.h" 9 #include "src/lithium.h"
10 #include "src/lithium-allocator.h" 10 #include "src/lithium-allocator.h"
11 #include "src/safepoint-table.h" 11 #include "src/safepoint-table.h"
12 #include "src/utils.h" 12 #include "src/utils.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 16
17 // Forward declarations. 17 // Forward declarations.
18 class LCodeGen; 18 class LCodeGen;
19 19
20 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ 20 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
21 V(AccessArgumentsAt) \ 21 V(AccessArgumentsAt) \
22 V(AddI) \ 22 V(AddI) \
23 V(Allocate) \ 23 V(Allocate) \
24 V(AllocateBlockContext) \ 24 V(AllocateBlockContext) \
25 V(ApplyArguments) \ 25 V(ApplyArguments) \
26 V(ArgumentsElements) \ 26 V(ArgumentsElements) \
27 V(ArgumentsLength) \ 27 V(ArgumentsLength) \
28 V(ArithmeticD) \ 28 V(ArithmeticD) \
29 V(ArithmeticT) \ 29 V(ArithmeticT) \
30 V(BitI) \ 30 V(BitI) \
31 V(BoundsCheck) \ 31 V(BoundsCheck) \
32 V(Branch) \ 32 V(Branch) \
33 V(CallJSFunction) \ 33 V(CallJSFunction) \
34 V(CallWithDescriptor) \ 34 V(CallWithDescriptor) \
35 V(CallFunction) \ 35 V(CallFunction) \
36 V(CallNew) \ 36 V(CallNew) \
37 V(CallNewArray) \ 37 V(CallNewArray) \
38 V(CallRuntime) \ 38 V(CallRuntime) \
39 V(CallStub) \ 39 V(CallStub) \
40 V(CheckInstanceType) \ 40 V(CheckInstanceType) \
41 V(CheckNonSmi) \ 41 V(CheckNonSmi) \
42 V(CheckMaps) \ 42 V(CheckMaps) \
43 V(CheckMapValue) \ 43 V(CheckMapValue) \
44 V(CheckSmi) \ 44 V(CheckSmi) \
45 V(CheckValue) \ 45 V(CheckValue) \
46 V(ClampDToUint8) \ 46 V(ClampDToUint8) \
47 V(ClampIToUint8) \ 47 V(ClampIToUint8) \
48 V(ClampTToUint8) \ 48 V(ClampTToUint8) \
49 V(ClassOfTestAndBranch) \ 49 V(ClassOfTestAndBranch) \
50 V(CompareMinusZeroAndBranch) \ 50 V(CompareMinusZeroAndBranch) \
51 V(CompareNumericAndBranch) \ 51 V(CompareNumericAndBranch) \
52 V(CmpObjectEqAndBranch) \ 52 V(CmpObjectEqAndBranch) \
53 V(CmpHoleAndBranch) \ 53 V(CmpHoleAndBranch) \
54 V(CmpMapAndBranch) \ 54 V(CmpMapAndBranch) \
55 V(CmpT) \ 55 V(CmpT) \
56 V(ConstantD) \ 56 V(ConstantD) \
57 V(ConstantE) \ 57 V(ConstantE) \
58 V(ConstantI) \ 58 V(ConstantI) \
59 V(ConstantS) \ 59 V(ConstantS) \
60 V(ConstantT) \ 60 V(ConstantT) \
61 V(ConstructDouble) \ 61 V(ConstructDouble) \
62 V(Context) \ 62 V(Context) \
63 V(DateField) \ 63 V(DateField) \
64 V(DebugBreak) \ 64 V(DebugBreak) \
65 V(DeclareGlobals) \ 65 V(DeclareGlobals) \
66 V(Deoptimize) \ 66 V(Deoptimize) \
67 V(DivByConstI) \ 67 V(DivByConstI) \
68 V(DivByPowerOf2I) \ 68 V(DivByPowerOf2I) \
69 V(DivI) \ 69 V(DivI) \
70 V(DoubleBits) \ 70 V(DoubleBits) \
71 V(DoubleToI) \ 71 V(DoubleToI) \
72 V(DoubleToSmi) \ 72 V(DoubleToSmi) \
73 V(Drop) \ 73 V(Drop) \
74 V(Dummy) \ 74 V(Dummy) \
75 V(DummyUse) \ 75 V(DummyUse) \
76 V(FlooringDivByConstI) \ 76 V(FlooringDivByConstI) \
77 V(FlooringDivByPowerOf2I) \ 77 V(FlooringDivByPowerOf2I) \
78 V(FlooringDivI) \ 78 V(FlooringDivI) \
79 V(ForInCacheArray) \ 79 V(ForInCacheArray) \
80 V(ForInPrepareMap) \ 80 V(ForInPrepareMap) \
81 V(FunctionLiteral) \ 81 V(FunctionLiteral) \
82 V(GetCachedArrayIndex) \ 82 V(GetCachedArrayIndex) \
83 V(Goto) \ 83 V(Goto) \
84 V(HasCachedArrayIndexAndBranch) \ 84 V(HasCachedArrayIndexAndBranch) \
85 V(HasInstanceTypeAndBranch) \ 85 V(HasInstanceTypeAndBranch) \
86 V(InnerAllocatedObject) \ 86 V(InnerAllocatedObject) \
87 V(InstanceOf) \ 87 V(InstanceOf) \
88 V(InstanceOfKnownGlobal) \ 88 V(InstanceOfKnownGlobal) \
89 V(InstructionGap) \ 89 V(InstructionGap) \
90 V(Integer32ToDouble) \ 90 V(Integer32ToDouble) \
91 V(InvokeFunction) \ 91 V(InvokeFunction) \
92 V(IsConstructCallAndBranch) \ 92 V(IsConstructCallAndBranch) \
93 V(IsObjectAndBranch) \ 93 V(IsObjectAndBranch) \
94 V(IsStringAndBranch) \ 94 V(IsStringAndBranch) \
95 V(IsSmiAndBranch) \ 95 V(IsSmiAndBranch) \
96 V(IsUndetectableAndBranch) \ 96 V(IsUndetectableAndBranch) \
97 V(Label) \ 97 V(Label) \
98 V(LazyBailout) \ 98 V(LazyBailout) \
99 V(LoadContextSlot) \ 99 V(LoadContextSlot) \
100 V(LoadRoot) \ 100 V(LoadRoot) \
101 V(LoadFieldByIndex) \ 101 V(LoadFieldByIndex) \
102 V(LoadFunctionPrototype) \ 102 V(LoadFunctionPrototype) \
103 V(LoadGlobalCell) \ 103 V(LoadGlobalCell) \
104 V(LoadGlobalGeneric) \ 104 V(LoadGlobalGeneric) \
105 V(LoadKeyed) \ 105 V(LoadKeyed) \
106 V(LoadKeyedGeneric) \ 106 V(LoadKeyedGeneric) \
107 V(LoadNamedField) \ 107 V(LoadNamedField) \
108 V(LoadNamedGeneric) \ 108 V(LoadNamedGeneric) \
109 V(MapEnumLength) \ 109 V(MapEnumLength) \
110 V(MathAbs) \ 110 V(MathAbs) \
111 V(MathClz32) \ 111 V(MathClz32) \
112 V(MathExp) \ 112 V(MathExp) \
113 V(MathFloor) \ 113 V(MathFloor) \
114 V(MathLog) \ 114 V(MathFround) \
115 V(MathMinMax) \ 115 V(MathLog) \
116 V(MathPowHalf) \ 116 V(MathMinMax) \
117 V(MathRound) \ 117 V(MathPowHalf) \
118 V(MathSqrt) \ 118 V(MathRound) \
119 V(ModByConstI) \ 119 V(MathSqrt) \
120 V(ModByPowerOf2I) \ 120 V(ModByConstI) \
121 V(ModI) \ 121 V(ModByPowerOf2I) \
122 V(MulI) \ 122 V(ModI) \
123 V(MultiplyAddD) \ 123 V(MulI) \
124 V(MultiplySubD) \ 124 V(MultiplyAddD) \
125 V(NumberTagD) \ 125 V(MultiplySubD) \
126 V(NumberTagI) \ 126 V(NumberTagD) \
127 V(NumberTagU) \ 127 V(NumberTagI) \
128 V(NumberUntagD) \ 128 V(NumberTagU) \
129 V(OsrEntry) \ 129 V(NumberUntagD) \
130 V(Parameter) \ 130 V(OsrEntry) \
131 V(Power) \ 131 V(Parameter) \
132 V(PushArgument) \ 132 V(Power) \
133 V(RegExpLiteral) \ 133 V(PushArgument) \
134 V(Return) \ 134 V(RegExpLiteral) \
135 V(SeqStringGetChar) \ 135 V(Return) \
136 V(SeqStringSetChar) \ 136 V(SeqStringGetChar) \
137 V(ShiftI) \ 137 V(SeqStringSetChar) \
138 V(SmiTag) \ 138 V(ShiftI) \
139 V(SmiUntag) \ 139 V(SmiTag) \
140 V(StackCheck) \ 140 V(SmiUntag) \
141 V(StoreCodeEntry) \ 141 V(StackCheck) \
142 V(StoreContextSlot) \ 142 V(StoreCodeEntry) \
143 V(StoreFrameContext) \ 143 V(StoreContextSlot) \
144 V(StoreGlobalCell) \ 144 V(StoreFrameContext) \
145 V(StoreKeyed) \ 145 V(StoreGlobalCell) \
146 V(StoreKeyedGeneric) \ 146 V(StoreKeyed) \
147 V(StoreNamedField) \ 147 V(StoreKeyedGeneric) \
148 V(StoreNamedGeneric) \ 148 V(StoreNamedField) \
149 V(StringAdd) \ 149 V(StoreNamedGeneric) \
150 V(StringCharCodeAt) \ 150 V(StringAdd) \
151 V(StringCharFromCode) \ 151 V(StringCharCodeAt) \
152 V(StringCompareAndBranch) \ 152 V(StringCharFromCode) \
153 V(SubI) \ 153 V(StringCompareAndBranch) \
154 V(RSubI) \ 154 V(SubI) \
155 V(TaggedToI) \ 155 V(RSubI) \
156 V(ThisFunction) \ 156 V(TaggedToI) \
157 V(ToFastProperties) \ 157 V(ThisFunction) \
158 V(TransitionElementsKind) \ 158 V(ToFastProperties) \
159 V(TrapAllocationMemento) \ 159 V(TransitionElementsKind) \
160 V(Typeof) \ 160 V(TrapAllocationMemento) \
161 V(TypeofIsAndBranch) \ 161 V(Typeof) \
162 V(Uint32ToDouble) \ 162 V(TypeofIsAndBranch) \
163 V(UnknownOSRValue) \ 163 V(Uint32ToDouble) \
164 V(UnknownOSRValue) \
164 V(WrapReceiver) 165 V(WrapReceiver)
165 166
166 167
167 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ 168 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
168 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ 169 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \
169 return LInstruction::k##type; \ 170 return LInstruction::k##type; \
170 } \ 171 } \
171 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ 172 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \
172 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ 173 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \
173 return mnemonic; \ 174 return mnemonic; \
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 } 869 }
869 870
870 LOperand* value() { return inputs_[0]; } 871 LOperand* value() { return inputs_[0]; }
871 LOperand* temp() { return temps_[0]; } 872 LOperand* temp() { return temps_[0]; }
872 873
873 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") 874 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
874 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 875 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
875 }; 876 };
876 877
877 878
879 class LMathFround V8_FINAL : public LTemplateInstruction<1, 1, 0> {
880 public:
881 explicit LMathFround(LOperand* value) { inputs_[0] = value; }
882
883 LOperand* value() { return inputs_[0]; }
884
885 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-fround")
886 };
887
888
878 class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> { 889 class LMathAbs V8_FINAL : public LTemplateInstruction<1, 2, 0> {
879 public: 890 public:
880 LMathAbs(LOperand* context, LOperand* value) { 891 LMathAbs(LOperand* context, LOperand* value) {
881 inputs_[1] = context; 892 inputs_[1] = context;
882 inputs_[0] = value; 893 inputs_[0] = value;
883 } 894 }
884 895
885 LOperand* context() { return inputs_[1]; } 896 LOperand* context() { return inputs_[1]; }
886 LOperand* value() { return inputs_[0]; } 897 LOperand* value() { return inputs_[0]; }
887 898
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 #undef DECLARE_DO 2755 #undef DECLARE_DO
2745 2756
2746 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); 2757 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend);
2747 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); 2758 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul);
2748 LInstruction* DoRSub(HSub* instr); 2759 LInstruction* DoRSub(HSub* instr);
2749 2760
2750 static bool HasMagicNumberForDivisor(int32_t divisor); 2761 static bool HasMagicNumberForDivisor(int32_t divisor);
2751 2762
2752 LInstruction* DoMathFloor(HUnaryMathOperation* instr); 2763 LInstruction* DoMathFloor(HUnaryMathOperation* instr);
2753 LInstruction* DoMathRound(HUnaryMathOperation* instr); 2764 LInstruction* DoMathRound(HUnaryMathOperation* instr);
2765 LInstruction* DoMathFround(HUnaryMathOperation* instr);
2754 LInstruction* DoMathAbs(HUnaryMathOperation* instr); 2766 LInstruction* DoMathAbs(HUnaryMathOperation* instr);
2755 LInstruction* DoMathLog(HUnaryMathOperation* instr); 2767 LInstruction* DoMathLog(HUnaryMathOperation* instr);
2756 LInstruction* DoMathExp(HUnaryMathOperation* instr); 2768 LInstruction* DoMathExp(HUnaryMathOperation* instr);
2757 LInstruction* DoMathSqrt(HUnaryMathOperation* instr); 2769 LInstruction* DoMathSqrt(HUnaryMathOperation* instr);
2758 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr); 2770 LInstruction* DoMathPowHalf(HUnaryMathOperation* instr);
2759 LInstruction* DoMathClz32(HUnaryMathOperation* instr); 2771 LInstruction* DoMathClz32(HUnaryMathOperation* instr);
2760 LInstruction* DoDivByPowerOf2I(HDiv* instr); 2772 LInstruction* DoDivByPowerOf2I(HDiv* instr);
2761 LInstruction* DoDivByConstI(HDiv* instr); 2773 LInstruction* DoDivByConstI(HDiv* instr);
2762 LInstruction* DoDivI(HDiv* instr); 2774 LInstruction* DoDivI(HDiv* instr);
2763 LInstruction* DoModByPowerOf2I(HMod* instr); 2775 LInstruction* DoModByPowerOf2I(HMod* instr);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2881 2893
2882 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2894 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2883 }; 2895 };
2884 2896
2885 #undef DECLARE_HYDROGEN_ACCESSOR 2897 #undef DECLARE_HYDROGEN_ACCESSOR
2886 #undef DECLARE_CONCRETE_INSTRUCTION 2898 #undef DECLARE_CONCRETE_INSTRUCTION
2887 2899
2888 } } // namespace v8::internal 2900 } } // namespace v8::internal
2889 2901
2890 #endif // V8_ARM_LITHIUM_ARM_H_ 2902 #endif // V8_ARM_LITHIUM_ARM_H_
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698