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

Side by Side Diff: src/hydrogen-instructions.h

Issue 5640004: Allow the optimizing code generator to call Math.pow with untagged doubles. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years 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/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.h » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // HShl 70 // HShl
71 // HShr 71 // HShr
72 // HBoundsCheck 72 // HBoundsCheck
73 // HCompare 73 // HCompare
74 // HCompareJSObjectEq 74 // HCompareJSObjectEq
75 // HInstanceOf 75 // HInstanceOf
76 // HLoadKeyed 76 // HLoadKeyed
77 // HLoadKeyedFastElement 77 // HLoadKeyedFastElement
78 // HLoadKeyedGeneric 78 // HLoadKeyedGeneric
79 // HLoadNamedGeneric 79 // HLoadNamedGeneric
80 // HPower
80 // HStoreNamed 81 // HStoreNamed
81 // HStoreNamedField 82 // HStoreNamedField
82 // HStoreNamedGeneric 83 // HStoreNamedGeneric
83 // HBlockEntry 84 // HBlockEntry
84 // HCall 85 // HCall
85 // HCallConstantFunction 86 // HCallConstantFunction
86 // HCallFunction 87 // HCallFunction
87 // HCallGlobal 88 // HCallGlobal
88 // HCallKeyed 89 // HCallKeyed
89 // HCallKnownGlobal 90 // HCallKnownGlobal
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 V(LoadGlobal) \ 217 V(LoadGlobal) \
217 V(LoadKeyedFastElement) \ 218 V(LoadKeyedFastElement) \
218 V(LoadKeyedGeneric) \ 219 V(LoadKeyedGeneric) \
219 V(LoadNamedField) \ 220 V(LoadNamedField) \
220 V(LoadNamedGeneric) \ 221 V(LoadNamedGeneric) \
221 V(Mod) \ 222 V(Mod) \
222 V(Mul) \ 223 V(Mul) \
223 V(ObjectLiteral) \ 224 V(ObjectLiteral) \
224 V(OsrEntry) \ 225 V(OsrEntry) \
225 V(Parameter) \ 226 V(Parameter) \
227 V(Power) \
226 V(PushArgument) \ 228 V(PushArgument) \
227 V(RegExpLiteral) \ 229 V(RegExpLiteral) \
228 V(Return) \ 230 V(Return) \
229 V(Sar) \ 231 V(Sar) \
230 V(Shl) \ 232 V(Shl) \
231 V(Shr) \ 233 V(Shr) \
232 V(Simulate) \ 234 V(Simulate) \
233 V(StackCheck) \ 235 V(StackCheck) \
234 V(StoreGlobal) \ 236 V(StoreGlobal) \
235 V(StoreKeyedFastElement) \ 237 V(StoreKeyedFastElement) \
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 case kMathFloor: 1372 case kMathFloor:
1371 case kMathRound: 1373 case kMathRound:
1372 case kMathCeil: 1374 case kMathCeil:
1373 set_representation(Representation::Integer32()); 1375 set_representation(Representation::Integer32());
1374 break; 1376 break;
1375 case kMathAbs: 1377 case kMathAbs:
1376 set_representation(Representation::Tagged()); 1378 set_representation(Representation::Tagged());
1377 SetFlag(kFlexibleRepresentation); 1379 SetFlag(kFlexibleRepresentation);
1378 break; 1380 break;
1379 case kMathSqrt: 1381 case kMathSqrt:
1382 case kMathPowHalf:
1380 default: 1383 default:
1381 set_representation(Representation::Double()); 1384 set_representation(Representation::Double());
1382 } 1385 }
1383 SetFlag(kUseGVN); 1386 SetFlag(kUseGVN);
1384 } 1387 }
1385 1388
1386 virtual void PrintDataTo(StringStream* stream) const; 1389 virtual void PrintDataTo(StringStream* stream) const;
1387 1390
1388 virtual HType CalculateInferredType() const; 1391 virtual HType CalculateInferredType() const;
1389 1392
1390 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); 1393 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited);
1391 1394
1392 virtual Representation RequiredInputRepresentation(int index) const { 1395 virtual Representation RequiredInputRepresentation(int index) const {
1393 switch (op_) { 1396 switch (op_) {
1394 case kMathFloor: 1397 case kMathFloor:
1395 case kMathRound: 1398 case kMathRound:
1396 case kMathCeil: 1399 case kMathCeil:
1397 case kMathSqrt: 1400 case kMathSqrt:
1401 case kMathPowHalf:
1398 return Representation::Double(); 1402 return Representation::Double();
1399 break; 1403 break;
1400 case kMathAbs: 1404 case kMathAbs:
1401 return representation(); 1405 return representation();
1402 break; 1406 break;
1403 default: 1407 default:
1404 return Representation::None(); 1408 return Representation::None();
1405 } 1409 }
1406 } 1410 }
1407 1411
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 virtual bool EmitAtUses() const { return uses()->length() <= 1; } 2181 virtual bool EmitAtUses() const { return uses()->length() <= 1; }
2178 2182
2179 virtual Representation RequiredInputRepresentation(int index) const { 2183 virtual Representation RequiredInputRepresentation(int index) const {
2180 return Representation::Tagged(); 2184 return Representation::Tagged();
2181 } 2185 }
2182 2186
2183 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of") 2187 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance_of")
2184 }; 2188 };
2185 2189
2186 2190
2191 class HPower: public HBinaryOperation {
2192 public:
2193 HPower(HValue* left, HValue* right)
2194 : HBinaryOperation(left, right) {
2195 set_representation(Representation::Double());
2196 SetFlag(kUseGVN);
2197 }
2198
2199 virtual Representation RequiredInputRepresentation(int index) const {
2200 return (index == 1) ? Representation::None() : Representation::Double();
2201 }
2202
2203 DECLARE_CONCRETE_INSTRUCTION(Power, "power")
2204 };
2205
2206
2187 class HAdd: public HArithmeticBinaryOperation { 2207 class HAdd: public HArithmeticBinaryOperation {
2188 public: 2208 public:
2189 HAdd(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) { 2209 HAdd(HValue* left, HValue* right) : HArithmeticBinaryOperation(left, right) {
2190 SetFlag(kCanOverflow); 2210 SetFlag(kCanOverflow);
2191 } 2211 }
2192 2212
2193 // Add is only commutative if two integer values are added and not if two 2213 // Add is only commutative if two integer values are added and not if two
2194 // tagged values are added (because it might be a String concatenation). 2214 // tagged values are added (because it might be a String concatenation).
2195 virtual bool IsCommutative() const { 2215 virtual bool IsCommutative() const {
2196 return !representation().IsTagged(); 2216 return !representation().IsTagged();
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 HValue* object() const { return left(); } 2896 HValue* object() const { return left(); }
2877 HValue* key() const { return right(); } 2897 HValue* key() const { return right(); }
2878 }; 2898 };
2879 2899
2880 #undef DECLARE_INSTRUCTION 2900 #undef DECLARE_INSTRUCTION
2881 #undef DECLARE_CONCRETE_INSTRUCTION 2901 #undef DECLARE_CONCRETE_INSTRUCTION
2882 2902
2883 } } // namespace v8::internal 2903 } } // namespace v8::internal
2884 2904
2885 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 2905 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/ia32/lithium-codegen-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698