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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 } | 281 } |
| 282 | 282 |
| 283 void Intersect(Range* other); | 283 void Intersect(Range* other); |
| 284 void Union(Range* other); | 284 void Union(Range* other); |
| 285 void CombinedMax(Range* other); | 285 void CombinedMax(Range* other); |
| 286 void CombinedMin(Range* other); | 286 void CombinedMin(Range* other); |
| 287 | 287 |
| 288 void AddConstant(int32_t value); | 288 void AddConstant(int32_t value); |
| 289 void Sar(int32_t value); | 289 void Sar(int32_t value); |
| 290 void Shl(int32_t value); | 290 void Shl(int32_t value); |
| 291 bool AddAndCheckOverflow(Range* other); | 291 bool AddAndCheckOverflow(const Representation& r, Range* other); |
| 292 bool SubAndCheckOverflow(Range* other); | 292 bool SubAndCheckOverflow(const Representation& r, Range* other); |
| 293 bool MulAndCheckOverflow(Range* other); | 293 bool MulAndCheckOverflow(const Representation& r, Range* other); |
| 294 | 294 |
| 295 private: | 295 private: |
| 296 int32_t lower_; | 296 int32_t lower_; |
| 297 int32_t upper_; | 297 int32_t upper_; |
| 298 Range* next_; | 298 Range* next_; |
| 299 bool can_be_minus_zero_; | 299 bool can_be_minus_zero_; |
| 300 }; | 300 }; |
| 301 | 301 |
| 302 | 302 |
| 303 class UniqueValueId { | 303 class UniqueValueId { |
| (...skipping 3059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3363 | 3363 |
| 3364 virtual Representation observed_input_representation(int index) { | 3364 virtual Representation observed_input_representation(int index) { |
| 3365 if (index == 0) return Representation::Tagged(); | 3365 if (index == 0) return Representation::Tagged(); |
| 3366 return observed_input_representation_[index - 1]; | 3366 return observed_input_representation_[index - 1]; |
| 3367 } | 3367 } |
| 3368 | 3368 |
| 3369 virtual void InferRepresentation(HInferRepresentation* h_infer); | 3369 virtual void InferRepresentation(HInferRepresentation* h_infer); |
| 3370 virtual Representation RepresentationFromInputs(); | 3370 virtual Representation RepresentationFromInputs(); |
| 3371 virtual void AssumeRepresentation(Representation r); | 3371 virtual void AssumeRepresentation(Representation r); |
| 3372 | 3372 |
| 3373 virtual void UpdateRepresentation(Representation new_rep, | |
| 3374 HInferRepresentation* h_infer, | |
| 3375 const char* reason) { | |
| 3376 // By default, binary operations don't handle Smis. | |
| 3377 if (new_rep.IsSmi()) { | |
| 3378 new_rep = Representation::Integer32(); | |
| 3379 } | |
| 3380 HValue::UpdateRepresentation(new_rep, h_infer, reason); | |
| 3381 } | |
| 3382 | |
| 3383 virtual bool IsCommutative() const { return false; } | 3373 virtual bool IsCommutative() const { return false; } |
| 3384 | 3374 |
| 3385 virtual void PrintDataTo(StringStream* stream); | 3375 virtual void PrintDataTo(StringStream* stream); |
| 3386 | 3376 |
| 3377 virtual Representation RequiredInputRepresentation(int index) { | |
| 3378 if (index == 0) return Representation::Tagged(); | |
| 3379 Representation r = representation(); | |
| 3380 if (r.IsSmi() && CannotBothBeSmi()) { | |
|
danno
2013/06/06 12:32:13
A comment might be nice.
| |
| 3381 int non_smi = (!right()->representation().IsInteger32() && | |
| 3382 AreOperandsBetterSwitched()) ? 1 : 2; | |
| 3383 if (index == non_smi) return Representation::Integer32(); | |
| 3384 } | |
| 3385 return r; | |
| 3386 } | |
| 3387 | |
| 3388 virtual bool CannotBothBeSmi() { return false; } | |
| 3389 | |
| 3387 DECLARE_ABSTRACT_INSTRUCTION(BinaryOperation) | 3390 DECLARE_ABSTRACT_INSTRUCTION(BinaryOperation) |
| 3388 | 3391 |
| 3389 private: | 3392 private: |
| 3390 bool IgnoreObservedOutputRepresentation(Representation current_rep); | 3393 bool IgnoreObservedOutputRepresentation(Representation current_rep); |
| 3391 | 3394 |
| 3392 Representation observed_input_representation_[2]; | 3395 Representation observed_input_representation_[2]; |
| 3393 Representation observed_output_representation_; | 3396 Representation observed_output_representation_; |
| 3394 }; | 3397 }; |
| 3395 | 3398 |
| 3396 | 3399 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3658 class HBitwiseBinaryOperation: public HBinaryOperation { | 3661 class HBitwiseBinaryOperation: public HBinaryOperation { |
| 3659 public: | 3662 public: |
| 3660 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right) | 3663 HBitwiseBinaryOperation(HValue* context, HValue* left, HValue* right) |
| 3661 : HBinaryOperation(context, left, right) { | 3664 : HBinaryOperation(context, left, right) { |
| 3662 SetFlag(kFlexibleRepresentation); | 3665 SetFlag(kFlexibleRepresentation); |
| 3663 SetFlag(kTruncatingToInt32); | 3666 SetFlag(kTruncatingToInt32); |
| 3664 SetFlag(kAllowUndefinedAsNaN); | 3667 SetFlag(kAllowUndefinedAsNaN); |
| 3665 SetAllSideEffects(); | 3668 SetAllSideEffects(); |
| 3666 } | 3669 } |
| 3667 | 3670 |
| 3668 virtual Representation RequiredInputRepresentation(int index) { | |
| 3669 return index == 0 | |
| 3670 ? Representation::Tagged() | |
| 3671 : representation(); | |
| 3672 } | |
| 3673 | |
| 3674 virtual void RepresentationChanged(Representation to) { | 3671 virtual void RepresentationChanged(Representation to) { |
| 3675 if (!to.IsTagged()) { | 3672 if (!to.IsTagged()) { |
| 3676 ASSERT(to.IsInteger32()); | 3673 ASSERT(to.IsSmiOrInteger32()); |
| 3677 ClearAllSideEffects(); | 3674 ClearAllSideEffects(); |
| 3678 SetFlag(kUseGVN); | 3675 SetFlag(kUseGVN); |
| 3679 } else { | 3676 } else { |
| 3680 SetAllSideEffects(); | 3677 SetAllSideEffects(); |
| 3681 ClearFlag(kUseGVN); | 3678 ClearFlag(kUseGVN); |
| 3682 } | 3679 } |
| 3683 } | 3680 } |
| 3684 | 3681 |
| 3685 virtual void UpdateRepresentation(Representation new_rep, | 3682 virtual void UpdateRepresentation(Representation new_rep, |
| 3686 HInferRepresentation* h_infer, | 3683 HInferRepresentation* h_infer, |
| 3687 const char* reason) { | 3684 const char* reason) { |
| 3688 // We only generate either int32 or generic tagged bitwise operations. | 3685 // We only generate either int32 or generic tagged bitwise operations. |
| 3689 if (new_rep.IsSmi() || new_rep.IsDouble()) { | 3686 if (new_rep.IsDouble()) new_rep = Representation::Integer32(); |
| 3690 new_rep = Representation::Integer32(); | 3687 HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); |
| 3691 } | |
| 3692 HValue::UpdateRepresentation(new_rep, h_infer, reason); | |
| 3693 } | 3688 } |
| 3694 | 3689 |
| 3695 virtual void initialize_output_representation(Representation observed) { | 3690 virtual void initialize_output_representation(Representation observed) { |
| 3696 if (observed.IsDouble()) observed = Representation::Integer32(); | 3691 if (observed.IsDouble()) observed = Representation::Integer32(); |
| 3697 HBinaryOperation::initialize_output_representation(observed); | 3692 HBinaryOperation::initialize_output_representation(observed); |
| 3698 } | 3693 } |
| 3699 | 3694 |
| 3700 virtual HType CalculateInferredType(); | 3695 virtual HType CalculateInferredType(); |
| 3701 | 3696 |
| 3702 DECLARE_ABSTRACT_INSTRUCTION(BitwiseBinaryOperation) | 3697 DECLARE_ABSTRACT_INSTRUCTION(BitwiseBinaryOperation) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3748 if (to.IsTagged()) { | 3743 if (to.IsTagged()) { |
| 3749 SetAllSideEffects(); | 3744 SetAllSideEffects(); |
| 3750 ClearFlag(kUseGVN); | 3745 ClearFlag(kUseGVN); |
| 3751 } else { | 3746 } else { |
| 3752 ClearAllSideEffects(); | 3747 ClearAllSideEffects(); |
| 3753 SetFlag(kUseGVN); | 3748 SetFlag(kUseGVN); |
| 3754 } | 3749 } |
| 3755 } | 3750 } |
| 3756 | 3751 |
| 3757 virtual HType CalculateInferredType(); | 3752 virtual HType CalculateInferredType(); |
| 3758 virtual Representation RequiredInputRepresentation(int index) { | |
| 3759 return index == 0 | |
| 3760 ? Representation::Tagged() | |
| 3761 : representation(); | |
| 3762 } | |
| 3763 | 3753 |
| 3764 virtual HValue* Canonicalize(); | 3754 virtual HValue* Canonicalize(); |
| 3765 | 3755 |
| 3766 private: | 3756 private: |
| 3767 virtual bool IsDeletable() const { return true; } | 3757 virtual bool IsDeletable() const { return true; } |
| 3768 }; | 3758 }; |
| 3769 | 3759 |
| 3770 | 3760 |
| 3771 class HCompareGeneric: public HBinaryOperation { | 3761 class HCompareGeneric: public HBinaryOperation { |
| 3772 public: | 3762 public: |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4312 | 4302 |
| 4313 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 4303 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
| 4314 | 4304 |
| 4315 virtual HValue* Canonicalize(); | 4305 virtual HValue* Canonicalize(); |
| 4316 | 4306 |
| 4317 // Only commutative if it is certain that not two objects are multiplicated. | 4307 // Only commutative if it is certain that not two objects are multiplicated. |
| 4318 virtual bool IsCommutative() const { | 4308 virtual bool IsCommutative() const { |
| 4319 return !representation().IsTagged(); | 4309 return !representation().IsTagged(); |
| 4320 } | 4310 } |
| 4321 | 4311 |
| 4312 virtual bool CannotBothBeSmi() { return true; } | |
| 4313 | |
| 4322 DECLARE_CONCRETE_INSTRUCTION(Mul) | 4314 DECLARE_CONCRETE_INSTRUCTION(Mul) |
| 4323 | 4315 |
| 4324 protected: | 4316 protected: |
| 4325 virtual bool DataEquals(HValue* other) { return true; } | 4317 virtual bool DataEquals(HValue* other) { return true; } |
| 4326 | 4318 |
| 4327 virtual Range* InferRange(Zone* zone); | 4319 virtual Range* InferRange(Zone* zone); |
| 4328 | 4320 |
| 4329 private: | 4321 private: |
| 4330 HMul(HValue* context, HValue* left, HValue* right) | 4322 HMul(HValue* context, HValue* left, HValue* right) |
| 4331 : HArithmeticBinaryOperation(context, left, right) { | 4323 : HArithmeticBinaryOperation(context, left, right) { |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 4349 bool HasPowerOf2Divisor() { | 4341 bool HasPowerOf2Divisor() { |
| 4350 if (right()->IsConstant() && | 4342 if (right()->IsConstant() && |
| 4351 HConstant::cast(right())->HasInteger32Value()) { | 4343 HConstant::cast(right())->HasInteger32Value()) { |
| 4352 int32_t value = HConstant::cast(right())->Integer32Value(); | 4344 int32_t value = HConstant::cast(right())->Integer32Value(); |
| 4353 return value != 0 && (IsPowerOf2(value) || IsPowerOf2(-value)); | 4345 return value != 0 && (IsPowerOf2(value) || IsPowerOf2(-value)); |
| 4354 } | 4346 } |
| 4355 | 4347 |
| 4356 return false; | 4348 return false; |
| 4357 } | 4349 } |
| 4358 | 4350 |
| 4351 virtual void UpdateRepresentation(Representation new_rep, | |
| 4352 HInferRepresentation* h_infer, | |
| 4353 const char* reason) { | |
| 4354 // Do not support Smi as representation of division, to avoid needing to | |
| 4355 // mask the value to set the smi-tag. | |
| 4356 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); | |
| 4357 HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | |
| 4358 } | |
| 4359 | |
| 4359 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 4360 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
| 4360 | 4361 |
| 4361 virtual HValue* Canonicalize(); | 4362 virtual HValue* Canonicalize(); |
| 4362 | 4363 |
| 4363 DECLARE_CONCRETE_INSTRUCTION(Mod) | 4364 DECLARE_CONCRETE_INSTRUCTION(Mod) |
| 4364 | 4365 |
| 4365 protected: | 4366 protected: |
| 4366 virtual bool DataEquals(HValue* other) { return true; } | 4367 virtual bool DataEquals(HValue* other) { return true; } |
| 4367 | 4368 |
| 4368 virtual Range* InferRange(Zone* zone); | 4369 virtual Range* InferRange(Zone* zone); |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 4395 bool HasPowerOf2Divisor() { | 4396 bool HasPowerOf2Divisor() { |
| 4396 if (right()->IsConstant() && | 4397 if (right()->IsConstant() && |
| 4397 HConstant::cast(right())->HasInteger32Value()) { | 4398 HConstant::cast(right())->HasInteger32Value()) { |
| 4398 int32_t value = HConstant::cast(right())->Integer32Value(); | 4399 int32_t value = HConstant::cast(right())->Integer32Value(); |
| 4399 return value != 0 && (IsPowerOf2(value) || IsPowerOf2(-value)); | 4400 return value != 0 && (IsPowerOf2(value) || IsPowerOf2(-value)); |
| 4400 } | 4401 } |
| 4401 | 4402 |
| 4402 return false; | 4403 return false; |
| 4403 } | 4404 } |
| 4404 | 4405 |
| 4406 virtual void UpdateRepresentation(Representation new_rep, | |
| 4407 HInferRepresentation* h_infer, | |
| 4408 const char* reason) { | |
| 4409 // Do not support Smi as representation of division, to avoid needing to | |
| 4410 // mask the value to set the smi-tag. | |
| 4411 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); | |
| 4412 HBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | |
| 4413 } | |
| 4414 | |
| 4405 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); | 4415 virtual HValue* EnsureAndPropagateNotMinusZero(BitVector* visited); |
| 4406 | 4416 |
| 4407 virtual HValue* Canonicalize(); | 4417 virtual HValue* Canonicalize(); |
| 4408 | 4418 |
| 4409 DECLARE_CONCRETE_INSTRUCTION(Div) | 4419 DECLARE_CONCRETE_INSTRUCTION(Div) |
| 4410 | 4420 |
| 4411 protected: | 4421 protected: |
| 4412 virtual bool DataEquals(HValue* other) { return true; } | 4422 virtual bool DataEquals(HValue* other) { return true; } |
| 4413 | 4423 |
| 4414 virtual Range* InferRange(Zone* zone); | 4424 virtual Range* InferRange(Zone* zone); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 4439 | 4449 |
| 4440 virtual Representation observed_input_representation(int index) { | 4450 virtual Representation observed_input_representation(int index) { |
| 4441 return RequiredInputRepresentation(index); | 4451 return RequiredInputRepresentation(index); |
| 4442 } | 4452 } |
| 4443 | 4453 |
| 4444 virtual void InferRepresentation(HInferRepresentation* h_infer); | 4454 virtual void InferRepresentation(HInferRepresentation* h_infer); |
| 4445 | 4455 |
| 4446 virtual Representation RepresentationFromInputs() { | 4456 virtual Representation RepresentationFromInputs() { |
| 4447 Representation left_rep = left()->representation(); | 4457 Representation left_rep = left()->representation(); |
| 4448 Representation right_rep = right()->representation(); | 4458 Representation right_rep = right()->representation(); |
| 4449 if ((left_rep.IsNone() || left_rep.IsInteger32()) && | 4459 Representation result = Representation::Smi(); |
| 4450 (right_rep.IsNone() || right_rep.IsInteger32())) { | 4460 result = result.generalize(left_rep); |
| 4451 return Representation::Integer32(); | 4461 result = result.generalize(right_rep); |
| 4452 } | 4462 if (result.IsTagged()) return Representation::Double(); |
| 4453 return Representation::Double(); | 4463 return result; |
| 4454 } | 4464 } |
| 4455 | 4465 |
| 4456 virtual bool IsCommutative() const { return true; } | 4466 virtual bool IsCommutative() const { return true; } |
| 4457 | 4467 |
| 4458 Operation operation() { return operation_; } | 4468 Operation operation() { return operation_; } |
| 4459 | 4469 |
| 4460 DECLARE_CONCRETE_INSTRUCTION(MathMinMax) | 4470 DECLARE_CONCRETE_INSTRUCTION(MathMinMax) |
| 4461 | 4471 |
| 4462 protected: | 4472 protected: |
| 4463 virtual bool DataEquals(HValue* other) { | 4473 virtual bool DataEquals(HValue* other) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4513 | 4523 |
| 4514 class HShl: public HBitwiseBinaryOperation { | 4524 class HShl: public HBitwiseBinaryOperation { |
| 4515 public: | 4525 public: |
| 4516 static HInstruction* New(Zone* zone, | 4526 static HInstruction* New(Zone* zone, |
| 4517 HValue* context, | 4527 HValue* context, |
| 4518 HValue* left, | 4528 HValue* left, |
| 4519 HValue* right); | 4529 HValue* right); |
| 4520 | 4530 |
| 4521 virtual Range* InferRange(Zone* zone); | 4531 virtual Range* InferRange(Zone* zone); |
| 4522 | 4532 |
| 4533 virtual void UpdateRepresentation(Representation new_rep, | |
| 4534 HInferRepresentation* h_infer, | |
| 4535 const char* reason) { | |
| 4536 // Do not support Smi as representation of shift right, to avoid needing to | |
| 4537 // mask the value to set the smi-tag. | |
| 4538 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); | |
| 4539 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | |
| 4540 } | |
| 4541 | |
| 4523 DECLARE_CONCRETE_INSTRUCTION(Shl) | 4542 DECLARE_CONCRETE_INSTRUCTION(Shl) |
| 4524 | 4543 |
| 4525 protected: | 4544 protected: |
| 4526 virtual bool DataEquals(HValue* other) { return true; } | 4545 virtual bool DataEquals(HValue* other) { return true; } |
| 4527 | 4546 |
| 4528 private: | 4547 private: |
| 4529 HShl(HValue* context, HValue* left, HValue* right) | 4548 HShl(HValue* context, HValue* left, HValue* right) |
| 4530 : HBitwiseBinaryOperation(context, left, right) { } | 4549 : HBitwiseBinaryOperation(context, left, right) { } |
| 4531 }; | 4550 }; |
| 4532 | 4551 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 4543 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) { | 4562 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) { |
| 4544 // This is intended to look for HAdd and HSub, to handle compounds | 4563 // This is intended to look for HAdd and HSub, to handle compounds |
| 4545 // like ((base + offset) >> scale) with one single decomposition. | 4564 // like ((base + offset) >> scale) with one single decomposition. |
| 4546 left()->TryDecompose(decomposition); | 4565 left()->TryDecompose(decomposition); |
| 4547 return true; | 4566 return true; |
| 4548 } | 4567 } |
| 4549 } | 4568 } |
| 4550 return false; | 4569 return false; |
| 4551 } | 4570 } |
| 4552 | 4571 |
| 4572 virtual void UpdateRepresentation(Representation new_rep, | |
| 4573 HInferRepresentation* h_infer, | |
| 4574 const char* reason) { | |
| 4575 // Do not support Smi as representation of shift right, to avoid needing to | |
| 4576 // mask the value to set the smi-tag. | |
| 4577 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); | |
| 4578 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | |
| 4579 } | |
| 4580 | |
| 4553 virtual Range* InferRange(Zone* zone); | 4581 virtual Range* InferRange(Zone* zone); |
| 4554 | 4582 |
| 4555 DECLARE_CONCRETE_INSTRUCTION(Shr) | 4583 DECLARE_CONCRETE_INSTRUCTION(Shr) |
| 4556 | 4584 |
| 4557 protected: | 4585 protected: |
| 4558 virtual bool DataEquals(HValue* other) { return true; } | 4586 virtual bool DataEquals(HValue* other) { return true; } |
| 4559 | 4587 |
| 4560 private: | 4588 private: |
| 4561 HShr(HValue* context, HValue* left, HValue* right) | 4589 HShr(HValue* context, HValue* left, HValue* right) |
| 4562 : HBitwiseBinaryOperation(context, left, right) { } | 4590 : HBitwiseBinaryOperation(context, left, right) { } |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 4575 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) { | 4603 if (decomposition->Apply(left(), 0, right()->GetInteger32Constant())) { |
| 4576 // This is intended to look for HAdd and HSub, to handle compounds | 4604 // This is intended to look for HAdd and HSub, to handle compounds |
| 4577 // like ((base + offset) >> scale) with one single decomposition. | 4605 // like ((base + offset) >> scale) with one single decomposition. |
| 4578 left()->TryDecompose(decomposition); | 4606 left()->TryDecompose(decomposition); |
| 4579 return true; | 4607 return true; |
| 4580 } | 4608 } |
| 4581 } | 4609 } |
| 4582 return false; | 4610 return false; |
| 4583 } | 4611 } |
| 4584 | 4612 |
| 4613 virtual void UpdateRepresentation(Representation new_rep, | |
| 4614 HInferRepresentation* h_infer, | |
| 4615 const char* reason) { | |
| 4616 // Do not support Smi as representation of shift right, to avoid needing to | |
| 4617 // mask the value to set the smi-tag. | |
| 4618 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); | |
| 4619 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | |
| 4620 } | |
| 4621 | |
| 4585 virtual Range* InferRange(Zone* zone); | 4622 virtual Range* InferRange(Zone* zone); |
| 4586 | 4623 |
| 4587 DECLARE_CONCRETE_INSTRUCTION(Sar) | 4624 DECLARE_CONCRETE_INSTRUCTION(Sar) |
| 4588 | 4625 |
| 4589 protected: | 4626 protected: |
| 4590 virtual bool DataEquals(HValue* other) { return true; } | 4627 virtual bool DataEquals(HValue* other) { return true; } |
| 4591 | 4628 |
| 4592 private: | 4629 private: |
| 4593 HSar(HValue* context, HValue* left, HValue* right) | 4630 HSar(HValue* context, HValue* left, HValue* right) |
| 4594 : HBitwiseBinaryOperation(context, left, right) { } | 4631 : HBitwiseBinaryOperation(context, left, right) { } |
| 4595 }; | 4632 }; |
| 4596 | 4633 |
| 4597 | 4634 |
| 4598 class HRor: public HBitwiseBinaryOperation { | 4635 class HRor: public HBitwiseBinaryOperation { |
| 4599 public: | 4636 public: |
| 4600 HRor(HValue* context, HValue* left, HValue* right) | 4637 HRor(HValue* context, HValue* left, HValue* right) |
| 4601 : HBitwiseBinaryOperation(context, left, right) { | 4638 : HBitwiseBinaryOperation(context, left, right) { |
| 4602 ChangeRepresentation(Representation::Integer32()); | 4639 ChangeRepresentation(Representation::Integer32()); |
| 4603 } | 4640 } |
| 4604 | 4641 |
| 4642 virtual void UpdateRepresentation(Representation new_rep, | |
| 4643 HInferRepresentation* h_infer, | |
| 4644 const char* reason) { | |
| 4645 // Do not support Smi as representation of shift right, to avoid needing to | |
| 4646 // mask the value to set the smi-tag. | |
| 4647 if (new_rep.IsSmi()) new_rep = Representation::Integer32(); | |
| 4648 HBitwiseBinaryOperation::UpdateRepresentation(new_rep, h_infer, reason); | |
| 4649 } | |
| 4650 | |
| 4605 DECLARE_CONCRETE_INSTRUCTION(Ror) | 4651 DECLARE_CONCRETE_INSTRUCTION(Ror) |
| 4606 | 4652 |
| 4607 protected: | 4653 protected: |
| 4608 virtual bool DataEquals(HValue* other) { return true; } | 4654 virtual bool DataEquals(HValue* other) { return true; } |
| 4609 }; | 4655 }; |
| 4610 | 4656 |
| 4611 | 4657 |
| 4612 class HOsrEntry: public HTemplateInstruction<0> { | 4658 class HOsrEntry: public HTemplateInstruction<0> { |
| 4613 public: | 4659 public: |
| 4614 explicit HOsrEntry(BailoutId ast_id) : ast_id_(ast_id) { | 4660 explicit HOsrEntry(BailoutId ast_id) : ast_id_(ast_id) { |
| (...skipping 1862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6477 virtual bool IsDeletable() const { return true; } | 6523 virtual bool IsDeletable() const { return true; } |
| 6478 }; | 6524 }; |
| 6479 | 6525 |
| 6480 | 6526 |
| 6481 #undef DECLARE_INSTRUCTION | 6527 #undef DECLARE_INSTRUCTION |
| 6482 #undef DECLARE_CONCRETE_INSTRUCTION | 6528 #undef DECLARE_CONCRETE_INSTRUCTION |
| 6483 | 6529 |
| 6484 } } // namespace v8::internal | 6530 } } // namespace v8::internal |
| 6485 | 6531 |
| 6486 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 6532 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
| OLD | NEW |