Chromium Code Reviews| Index: src/compiler/code-generator.cc |
| diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc |
| index acda1d2c5a0237e707585dd44b873e24673bf9be..e73016e62fd9cddbc989d3a4fb553b4ecacda9ef 100644 |
| --- a/src/compiler/code-generator.cc |
| +++ b/src/compiler/code-generator.cc |
| @@ -864,14 +864,20 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation, |
| Handle<Object> constant_object; |
| switch (constant.type()) { |
| case Constant::kInt32: |
| - DCHECK(type == MachineType::Int32() || type == MachineType::Uint32() || |
| - type.representation() == MachineRepresentation::kBit || |
| - type.representation() == MachineRepresentation::kNone); |
| - DCHECK(type.representation() != MachineRepresentation::kNone || |
| - constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); |
| - |
| - constant_object = |
| - isolate()->factory()->NewNumberFromInt(constant.ToInt32()); |
| + if (type.representation() == MachineRepresentation::kTagged) { |
|
Benedikt Meurer
2016/08/01 17:33:44
As discussed offline, this should only ever happen
|
| + constant_object = |
| + handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate()); |
| + } else { |
| + DCHECK(type == MachineType::Int32() || |
| + type == MachineType::Uint32() || |
| + type.representation() == MachineRepresentation::kBit || |
| + type.representation() == MachineRepresentation::kNone); |
| + DCHECK(type.representation() != MachineRepresentation::kNone || |
| + constant.ToInt32() == FrameStateDescriptor::kImpossibleValue); |
| + |
| + constant_object = |
| + isolate()->factory()->NewNumberFromInt(constant.ToInt32()); |
| + } |
| break; |
| case Constant::kFloat32: |
| DCHECK(type.representation() == MachineRepresentation::kFloat32 || |