| Index: src/hydrogen-instructions.cc
|
| diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
|
| index f1f44add9eadd0b7c77c0fc8a72099788fd17a7f..01a9dd68054620492f6ae756dade82fc19396fed 100644
|
| --- a/src/hydrogen-instructions.cc
|
| +++ b/src/hydrogen-instructions.cc
|
| @@ -949,6 +949,25 @@ void HBoundsCheck::InferRepresentation(HInferRepresentationPhase* h_infer) {
|
| }
|
|
|
|
|
| +Range* HBoundsCheck::InferRange(Zone* zone) {
|
| + Representation r = representation();
|
| + if (r.IsSmiOrInteger32() && length()->HasRange()) {
|
| + int upper = length()->range()->upper() - (allow_equality() ? 0 : 1);
|
| + int lower = 0;
|
| +
|
| + Range* result = new(zone) Range(lower, upper);
|
| + if (index()->HasRange()) {
|
| + result->Intersect(index()->range());
|
| + }
|
| +
|
| + // In case of Smi representation, clamp result to Smi::kMaxValue.
|
| + if (r.IsSmi()) result->ClampToSmi();
|
| + return result;
|
| + }
|
| + return HValue::InferRange(zone);
|
| +}
|
| +
|
| +
|
| void HBoundsCheckBaseIndexInformation::PrintDataTo(StringStream* stream) {
|
| stream->Add("base: ");
|
| base_index()->PrintNameTo(stream);
|
| @@ -1264,6 +1283,26 @@ HValue* HBitwise::Canonicalize() {
|
| }
|
|
|
|
|
| +Representation HAdd::RepresentationFromInputs() {
|
| + Representation left_rep = left()->representation();
|
| + if (left_rep.IsExternal()) {
|
| + return Representation::External();
|
| + }
|
| + return HArithmeticBinaryOperation::RepresentationFromInputs();
|
| +}
|
| +
|
| +
|
| +Representation HAdd::RequiredInputRepresentation(int index) {
|
| + if (index == 2) {
|
| + Representation left_rep = left()->representation();
|
| + if (left_rep.IsExternal()) {
|
| + return Representation::Integer32();
|
| + }
|
| + }
|
| + return HArithmeticBinaryOperation::RequiredInputRepresentation(index);
|
| +}
|
| +
|
| +
|
| static bool IsIdentityOperation(HValue* arg1, HValue* arg2, int32_t identity) {
|
| return arg1->representation().IsSpecialization() &&
|
| arg2->EqualsInteger32Constant(identity);
|
|
|