Chromium Code Reviews| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 136 V(LoadKeyed) \ | 136 V(LoadKeyed) \ |
| 137 V(LoadKeyedGeneric) \ | 137 V(LoadKeyedGeneric) \ |
| 138 V(LoadNamedField) \ | 138 V(LoadNamedField) \ |
| 139 V(LoadNamedFieldPolymorphic) \ | 139 V(LoadNamedFieldPolymorphic) \ |
| 140 V(LoadNamedGeneric) \ | 140 V(LoadNamedGeneric) \ |
| 141 V(MapEnumLength) \ | 141 V(MapEnumLength) \ |
| 142 V(MathFloorOfDiv) \ | 142 V(MathFloorOfDiv) \ |
| 143 V(MathMinMax) \ | 143 V(MathMinMax) \ |
| 144 V(Mod) \ | 144 V(Mod) \ |
| 145 V(Mul) \ | 145 V(Mul) \ |
| 146 V(MultiplyAdd) \ | |
| 146 V(ObjectLiteral) \ | 147 V(ObjectLiteral) \ |
| 147 V(OsrEntry) \ | 148 V(OsrEntry) \ |
| 148 V(OuterContext) \ | 149 V(OuterContext) \ |
| 149 V(Parameter) \ | 150 V(Parameter) \ |
| 150 V(Power) \ | 151 V(Power) \ |
| 151 V(PushArgument) \ | 152 V(PushArgument) \ |
| 152 V(Random) \ | 153 V(Random) \ |
| 153 V(RegExpLiteral) \ | 154 V(RegExpLiteral) \ |
| 154 V(Return) \ | 155 V(Return) \ |
| 155 V(Ror) \ | 156 V(Ror) \ |
| (...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3530 | 3531 |
| 3531 DECLARE_CONCRETE_INSTRUCTION(Mul) | 3532 DECLARE_CONCRETE_INSTRUCTION(Mul) |
| 3532 | 3533 |
| 3533 protected: | 3534 protected: |
| 3534 virtual bool DataEquals(HValue* other) { return true; } | 3535 virtual bool DataEquals(HValue* other) { return true; } |
| 3535 | 3536 |
| 3536 virtual Range* InferRange(Zone* zone); | 3537 virtual Range* InferRange(Zone* zone); |
| 3537 }; | 3538 }; |
| 3538 | 3539 |
| 3539 | 3540 |
| 3541 class HMultiplyAdd: public HTemplateInstruction<4> { | |
| 3542 public: | |
| 3543 HMultiplyAdd(HValue* context, HValue* a, HValue* b, HValue* c) { | |
| 3544 ASSERT(a != NULL && b != NULL && c != NULL); | |
| 3545 SetOperandAt(0, context); | |
| 3546 SetOperandAt(1, a); | |
| 3547 SetOperandAt(2, b); | |
| 3548 SetOperandAt(3, c); | |
| 3549 | |
| 3550 // FIXME: Not sure what the stuff below means. Stolen from | |
| 3551 // HArithmeticBinaryOperation and HMathFloorOfDiv. | |
|
ulan_google
2012/11/07 09:54:03
It sets the output representation of this instruct
| |
| 3552 set_representation(Representation::Double()); | |
| 3553 } | |
| 3554 | |
| 3555 HValue* context() { return OperandAt(0); } | |
| 3556 HValue* a() { return OperandAt(1); } | |
| 3557 HValue* b() { return OperandAt(2); } | |
| 3558 HValue* c() { return OperandAt(3); } | |
| 3559 | |
| 3560 virtual bool IsCommutative() const { return false; } | |
| 3561 | |
| 3562 virtual void PrintDataTo(StringStream* stream) { | |
| 3563 // FIXME: Implement properly in the .cc file | |
| 3564 a()->PrintNameTo(stream); | |
| 3565 stream->Add(" "); | |
| 3566 b()->PrintNameTo(stream); | |
| 3567 stream->Add(" "); | |
| 3568 c()->PrintNameTo(stream); | |
| 3569 } | |
| 3570 | |
| 3571 virtual Representation RequiredInputRepresentation(int index) { | |
| 3572 return index == 0 ? Representation::Tagged() : Representation::Double(); | |
| 3573 } | |
| 3574 | |
| 3575 DECLARE_CONCRETE_INSTRUCTION(MultiplyAdd) | |
| 3576 }; | |
| 3577 | |
| 3578 | |
| 3540 class HMod: public HArithmeticBinaryOperation { | 3579 class HMod: public HArithmeticBinaryOperation { |
| 3541 public: | 3580 public: |
| 3542 HMod(HValue* context, HValue* left, HValue* right) | 3581 HMod(HValue* context, HValue* left, HValue* right) |
| 3543 : HArithmeticBinaryOperation(context, left, right) { | 3582 : HArithmeticBinaryOperation(context, left, right) { |
| 3544 SetFlag(kCanBeDivByZero); | 3583 SetFlag(kCanBeDivByZero); |
| 3545 } | 3584 } |
| 3546 | 3585 |
| 3547 bool HasPowerOf2Divisor() { | 3586 bool HasPowerOf2Divisor() { |
| 3548 if (right()->IsConstant() && | 3587 if (right()->IsConstant() && |
| 3549 HConstant::cast(right())->HasInteger32Value()) { | 3588 HConstant::cast(right())->HasInteger32Value()) { |
| (...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5282 virtual bool IsDeletable() const { return true; } | 5321 virtual bool IsDeletable() const { return true; } |
| 5283 }; | 5322 }; |
| 5284 | 5323 |
| 5285 | 5324 |
| 5286 #undef DECLARE_INSTRUCTION | 5325 #undef DECLARE_INSTRUCTION |
| 5287 #undef DECLARE_CONCRETE_INSTRUCTION | 5326 #undef DECLARE_CONCRETE_INSTRUCTION |
| 5288 | 5327 |
| 5289 } } // namespace v8::internal | 5328 } } // namespace v8::internal |
| 5290 | 5329 |
| 5291 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 5330 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |