OLD | NEW |
---|---|
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 V(LoadNamedGeneric) \ | 139 V(LoadNamedGeneric) \ |
140 V(Mod) \ | 140 V(Mod) \ |
141 V(Mul) \ | 141 V(Mul) \ |
142 V(ObjectLiteralFast) \ | 142 V(ObjectLiteralFast) \ |
143 V(ObjectLiteralGeneric) \ | 143 V(ObjectLiteralGeneric) \ |
144 V(OsrEntry) \ | 144 V(OsrEntry) \ |
145 V(OuterContext) \ | 145 V(OuterContext) \ |
146 V(Parameter) \ | 146 V(Parameter) \ |
147 V(Power) \ | 147 V(Power) \ |
148 V(PushArgument) \ | 148 V(PushArgument) \ |
149 V(Random) \ | |
149 V(RegExpLiteral) \ | 150 V(RegExpLiteral) \ |
150 V(Return) \ | 151 V(Return) \ |
151 V(Sar) \ | 152 V(Sar) \ |
152 V(Shl) \ | 153 V(Shl) \ |
153 V(Shr) \ | 154 V(Shr) \ |
154 V(Simulate) \ | 155 V(Simulate) \ |
155 V(SoftDeoptimize) \ | 156 V(SoftDeoptimize) \ |
156 V(StackCheck) \ | 157 V(StackCheck) \ |
157 V(StoreContextSlot) \ | 158 V(StoreContextSlot) \ |
158 V(StoreGlobalCell) \ | 159 V(StoreGlobalCell) \ |
(...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2991 : Representation::None(); | 2992 : Representation::None(); |
2992 } | 2993 } |
2993 | 2994 |
2994 DECLARE_CONCRETE_INSTRUCTION(Power) | 2995 DECLARE_CONCRETE_INSTRUCTION(Power) |
2995 | 2996 |
2996 protected: | 2997 protected: |
2997 virtual bool DataEquals(HValue* other) { return true; } | 2998 virtual bool DataEquals(HValue* other) { return true; } |
2998 }; | 2999 }; |
2999 | 3000 |
3000 | 3001 |
3002 class HRandom: public HTemplateInstruction<1> { | |
3003 public: | |
3004 explicit HRandom(HValue* global_object) { | |
3005 SetOperandAt(0, global_object); | |
3006 set_representation(Representation::Double()); | |
3007 } | |
3008 | |
3009 HValue* global_object() { return OperandAt(0); } | |
3010 | |
3011 virtual Representation RequiredInputRepresentation(int index) { | |
3012 return index == 0 | |
3013 ? Representation::Tagged() | |
3014 : Representation::None(); | |
Jakob Kummerow
2012/01/11 08:10:40
"return Representation::Tagged();" should suffice,
Mads Ager (chromium)
2012/01/11 10:24:46
Done.
| |
3015 } | |
3016 | |
3017 DECLARE_CONCRETE_INSTRUCTION(Random) | |
3018 }; | |
3019 | |
3020 | |
3001 class HAdd: public HArithmeticBinaryOperation { | 3021 class HAdd: public HArithmeticBinaryOperation { |
3002 public: | 3022 public: |
3003 HAdd(HValue* context, HValue* left, HValue* right) | 3023 HAdd(HValue* context, HValue* left, HValue* right) |
3004 : HArithmeticBinaryOperation(context, left, right) { | 3024 : HArithmeticBinaryOperation(context, left, right) { |
3005 SetFlag(kCanOverflow); | 3025 SetFlag(kCanOverflow); |
3006 } | 3026 } |
3007 | 3027 |
3008 // Add is only commutative if two integer values are added and not if two | 3028 // Add is only commutative if two integer values are added and not if two |
3009 // tagged values are added (because it might be a String concatenation). | 3029 // tagged values are added (because it might be a String concatenation). |
3010 virtual bool IsCommutative() const { | 3030 virtual bool IsCommutative() const { |
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4499 | 4519 |
4500 DECLARE_CONCRETE_INSTRUCTION(In) | 4520 DECLARE_CONCRETE_INSTRUCTION(In) |
4501 }; | 4521 }; |
4502 | 4522 |
4503 #undef DECLARE_INSTRUCTION | 4523 #undef DECLARE_INSTRUCTION |
4504 #undef DECLARE_CONCRETE_INSTRUCTION | 4524 #undef DECLARE_CONCRETE_INSTRUCTION |
4505 | 4525 |
4506 } } // namespace v8::internal | 4526 } } // namespace v8::internal |
4507 | 4527 |
4508 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 4528 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |