| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index 3ce76c1ef19a2a2be7b70dac589a5ee5761a9fea..9042066a0233c599bc292858d972e63a05a9056e 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -579,13 +579,25 @@ HConstant* HGraph::GetConstant(SetOncePointer<HConstant>* pointer,
|
| }
|
|
|
|
|
| +HConstant* HGraph::GetConstantInt32(SetOncePointer<HConstant>* pointer,
|
| + int32_t value) {
|
| + if (!pointer->is_set()) {
|
| + HConstant* constant =
|
| + new(zone()) HConstant(value, Representation::Integer32());
|
| + constant->InsertAfter(GetConstantUndefined());
|
| + pointer->set(constant);
|
| + }
|
| + return pointer->get();
|
| +}
|
| +
|
| +
|
| HConstant* HGraph::GetConstant1() {
|
| - return GetConstant(&constant_1_, Handle<Smi>(Smi::FromInt(1)));
|
| + return GetConstantInt32(&constant_1_, 1);
|
| }
|
|
|
|
|
| HConstant* HGraph::GetConstantMinus1() {
|
| - return GetConstant(&constant_minus1_, Handle<Smi>(Smi::FromInt(-1)));
|
| + return GetConstantInt32(&constant_minus1_, -1);
|
| }
|
|
|
|
|
| @@ -3378,8 +3390,7 @@ class BoundsCheckBbData: public ZoneObject {
|
| Representation representation,
|
| int32_t new_offset) {
|
| HConstant* new_constant = new(BasicBlock()->zone())
|
| - HConstant(Handle<Object>(Smi::FromInt(new_offset)),
|
| - Representation::Integer32());
|
| + HConstant(new_offset, Representation::Integer32());
|
| if (*add == NULL) {
|
| new_constant->InsertBefore(check);
|
| *add = new(BasicBlock()->zone()) HAdd(NULL,
|
| @@ -7923,8 +7934,8 @@ HInstruction* HGraphBuilder::BuildBinaryOperation(BinaryOperation* expr,
|
| // for a smi operation. If one of the operands is a constant string
|
| // do not generate code assuming it is a smi operation.
|
| if (info.IsSmi() &&
|
| - ((left->IsConstant() && HConstant::cast(left)->HasStringValue()) ||
|
| - (right->IsConstant() && HConstant::cast(right)->HasStringValue()))) {
|
| + ((left->IsConstant() && HConstant::cast(left)->handle()->IsString()) ||
|
| + (right->IsConstant() && HConstant::cast(right)->handle()->IsString()))) {
|
| return instr;
|
| }
|
| Representation rep = ToRepresentation(info);
|
| @@ -8142,7 +8153,7 @@ static bool MatchLiteralCompareTypeof(HValue* left,
|
| if (left->IsTypeof() &&
|
| Token::IsEqualityOp(op) &&
|
| right->IsConstant() &&
|
| - HConstant::cast(right)->HasStringValue()) {
|
| + HConstant::cast(right)->handle()->IsString()) {
|
| *typeof_expr = HTypeof::cast(left);
|
| *check = Handle<String>::cast(HConstant::cast(right)->handle());
|
| return true;
|
|
|