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 4403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4414 }; | 4414 }; |
4415 | 4415 |
4416 | 4416 |
4417 class HMul: public HArithmeticBinaryOperation { | 4417 class HMul: public HArithmeticBinaryOperation { |
4418 public: | 4418 public: |
4419 static HInstruction* New(Zone* zone, | 4419 static HInstruction* New(Zone* zone, |
4420 HValue* context, | 4420 HValue* context, |
4421 HValue* left, | 4421 HValue* left, |
4422 HValue* right); | 4422 HValue* right); |
4423 | 4423 |
| 4424 static HInstruction* NewImul(Zone* zone, |
| 4425 HValue* context, |
| 4426 HValue* left, |
| 4427 HValue* right) { |
| 4428 HMul* mul = new(zone) HMul(context, left, right); |
| 4429 // TODO(mstarzinger): Prevent bailout on minus zero for imul. |
| 4430 mul->AssumeRepresentation(Representation::Integer32()); |
| 4431 mul->ClearFlag(HValue::kCanOverflow); |
| 4432 return mul; |
| 4433 } |
| 4434 |
4424 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 4435 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
4425 | 4436 |
4426 virtual HValue* Canonicalize(); | 4437 virtual HValue* Canonicalize(); |
4427 | 4438 |
4428 // Only commutative if it is certain that not two objects are multiplicated. | 4439 // Only commutative if it is certain that not two objects are multiplicated. |
4429 virtual bool IsCommutative() const { | 4440 virtual bool IsCommutative() const { |
4430 return !representation().IsTagged(); | 4441 return !representation().IsTagged(); |
4431 } | 4442 } |
4432 | 4443 |
4433 DECLARE_CONCRETE_INSTRUCTION(Mul) | 4444 DECLARE_CONCRETE_INSTRUCTION(Mul) |
(...skipping 2116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6550 virtual bool IsDeletable() const { return true; } | 6561 virtual bool IsDeletable() const { return true; } |
6551 }; | 6562 }; |
6552 | 6563 |
6553 | 6564 |
6554 #undef DECLARE_INSTRUCTION | 6565 #undef DECLARE_INSTRUCTION |
6555 #undef DECLARE_CONCRETE_INSTRUCTION | 6566 #undef DECLARE_CONCRETE_INSTRUCTION |
6556 | 6567 |
6557 } } // namespace v8::internal | 6568 } } // namespace v8::internal |
6558 | 6569 |
6559 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6570 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |