diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-08-04 12:18:09 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-08-04 12:18:09 -0700 |
commit | eeece4f5eab2d192635e19c64ae2d429f96c2284 (patch) | |
tree | 8ee91025e2e43769f1bfc01a101f95ba372830dd /deps/v8/src/hydrogen-instructions.cc | |
parent | b8c8e9c113e4611560948420e1ad67f1ee13d975 (diff) | |
download | node-eeece4f5eab2d192635e19c64ae2d429f96c2284.tar.gz |
Upgrade V8 to 3.5.3
Diffstat (limited to 'deps/v8/src/hydrogen-instructions.cc')
-rw-r--r-- | deps/v8/src/hydrogen-instructions.cc | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/deps/v8/src/hydrogen-instructions.cc b/deps/v8/src/hydrogen-instructions.cc index d282f3781..5bea55a77 100644 --- a/deps/v8/src/hydrogen-instructions.cc +++ b/deps/v8/src/hydrogen-instructions.cc @@ -862,19 +862,10 @@ void HInstanceOf::PrintDataTo(StringStream* stream) { Range* HValue::InferRange() { - if (representation().IsTagged()) { - // Tagged values are always in int32 range when converted to integer, - // but they can contain -0. - Range* result = new Range(); - result->set_can_be_minus_zero(true); - return result; - } else if (representation().IsNone()) { - return NULL; - } else { - // Untagged integer32 cannot be -0 and we don't compute ranges for - // untagged doubles. - return new Range(); - } + // Untagged integer32 cannot be -0, all other representations can. + Range* result = new Range(); + result->set_can_be_minus_zero(!representation().IsInteger32()); + return result; } @@ -1230,6 +1221,30 @@ Range* HSar::InferRange() { } +Range* HShr::InferRange() { + if (right()->IsConstant()) { + HConstant* c = HConstant::cast(right()); + if (c->HasInteger32Value()) { + int shift_count = c->Integer32Value() & 0x1f; + if (left()->range()->CanBeNegative()) { + // Only compute bounds if the result always fits into an int32. + return (shift_count >= 1) + ? new Range(0, static_cast<uint32_t>(0xffffffff) >> shift_count) + : new Range(); + } else { + // For positive inputs we can use the >> operator. + Range* result = (left()->range() != NULL) + ? left()->range()->Copy() + : new Range(); + result->Sar(c->Integer32Value()); + return result; + } + } + } + return HValue::InferRange(); +} + + Range* HShl::InferRange() { if (right()->IsConstant()) { HConstant* c = HConstant::cast(right()); @@ -1798,11 +1813,6 @@ void HSimulate::Verify() { } -void HBoundsCheck::Verify() { - HInstruction::Verify(); -} - - void HCheckSmi::Verify() { HInstruction::Verify(); ASSERT(HasNoUses()); @@ -1815,18 +1825,6 @@ void HCheckNonSmi::Verify() { } -void HCheckInstanceType::Verify() { - HInstruction::Verify(); - ASSERT(HasNoUses()); -} - - -void HCheckMap::Verify() { - HInstruction::Verify(); - ASSERT(HasNoUses()); -} - - void HCheckFunction::Verify() { HInstruction::Verify(); ASSERT(HasNoUses()); |