| Index: src/compiler/code-generator.cc
|
| diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
|
| index f36cdfc3977bf426b82f6249f91bd8dad5f1da4f..2f846154e1764f07cda54e922789003727e24c2a 100644
|
| --- a/src/compiler/code-generator.cc
|
| +++ b/src/compiler/code-generator.cc
|
| @@ -867,16 +867,15 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
|
| } else if (type == MachineType::Uint8() || type == MachineType::Uint16() ||
|
| type == MachineType::Uint32()) {
|
| translation->StoreUint32StackSlot(LocationOperand::cast(op)->index());
|
| - } else if (IsAnyTagged(type.representation())) {
|
| - translation->StoreStackSlot(LocationOperand::cast(op)->index());
|
| } else {
|
| - CHECK(false);
|
| + CHECK_EQ(MachineRepresentation::kTagged, type.representation());
|
| + translation->StoreStackSlot(LocationOperand::cast(op)->index());
|
| }
|
| } else if (op->IsFPStackSlot()) {
|
| if (type.representation() == MachineRepresentation::kFloat64) {
|
| translation->StoreDoubleStackSlot(LocationOperand::cast(op)->index());
|
| } else {
|
| - DCHECK_EQ(MachineRepresentation::kFloat32, type.representation());
|
| + CHECK_EQ(MachineRepresentation::kFloat32, type.representation());
|
| translation->StoreFloatStackSlot(LocationOperand::cast(op)->index());
|
| }
|
| } else if (op->IsRegister()) {
|
| @@ -889,27 +888,26 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
|
| } else if (type == MachineType::Uint8() || type == MachineType::Uint16() ||
|
| type == MachineType::Uint32()) {
|
| translation->StoreUint32Register(converter.ToRegister(op));
|
| - } else if (IsAnyTagged(type.representation())) {
|
| - translation->StoreRegister(converter.ToRegister(op));
|
| } else {
|
| - CHECK(false);
|
| + CHECK_EQ(MachineRepresentation::kTagged, type.representation());
|
| + translation->StoreRegister(converter.ToRegister(op));
|
| }
|
| } else if (op->IsFPRegister()) {
|
| InstructionOperandConverter converter(this, instr);
|
| if (type.representation() == MachineRepresentation::kFloat64) {
|
| translation->StoreDoubleRegister(converter.ToDoubleRegister(op));
|
| } else {
|
| - DCHECK_EQ(MachineRepresentation::kFloat32, type.representation());
|
| + CHECK_EQ(MachineRepresentation::kFloat32, type.representation());
|
| translation->StoreFloatRegister(converter.ToFloatRegister(op));
|
| }
|
| - } else if (op->IsImmediate()) {
|
| + } else {
|
| + CHECK(op->IsImmediate());
|
| InstructionOperandConverter converter(this, instr);
|
| Constant constant = converter.ToConstant(op);
|
| Handle<Object> constant_object;
|
| switch (constant.type()) {
|
| case Constant::kInt32:
|
| - if (type.representation() == MachineRepresentation::kTagged ||
|
| - type.representation() == MachineRepresentation::kTaggedSigned) {
|
| + if (type.representation() == MachineRepresentation::kTagged) {
|
| // When pointers are 4 bytes, we can use int32 constants to represent
|
| // Smis.
|
| DCHECK_EQ(4, kPointerSize);
|
| @@ -947,37 +945,28 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
|
| // TODO(jarin,bmeurer): We currently pass in raw pointers to the
|
| // JSFunction::entry here. We should really consider fixing this.
|
| DCHECK(type.representation() == MachineRepresentation::kWord64 ||
|
| - type.representation() == MachineRepresentation::kTagged ||
|
| - type.representation() == MachineRepresentation::kTaggedSigned);
|
| + type.representation() == MachineRepresentation::kTagged);
|
| DCHECK_EQ(8, kPointerSize);
|
| constant_object =
|
| handle(reinterpret_cast<Smi*>(constant.ToInt64()), isolate());
|
| DCHECK(constant_object->IsSmi());
|
| break;
|
| case Constant::kFloat32:
|
| - if (type.representation() == MachineRepresentation::kTaggedSigned) {
|
| - DCHECK(IsSmiDouble(constant.ToFloat32()));
|
| - } else {
|
| - DCHECK(type.representation() == MachineRepresentation::kFloat32 ||
|
| - CanBeTaggedPointer(type.representation()));
|
| - }
|
| + DCHECK(type.representation() == MachineRepresentation::kFloat32 ||
|
| + type.representation() == MachineRepresentation::kTagged);
|
| constant_object = isolate()->factory()->NewNumber(constant.ToFloat32());
|
| break;
|
| case Constant::kFloat64:
|
| - if (type.representation() == MachineRepresentation::kTaggedSigned) {
|
| - DCHECK(IsSmiDouble(constant.ToFloat64()));
|
| - } else {
|
| - DCHECK(type.representation() == MachineRepresentation::kFloat64 ||
|
| - CanBeTaggedPointer(type.representation()));
|
| - }
|
| + DCHECK(type.representation() == MachineRepresentation::kFloat64 ||
|
| + type.representation() == MachineRepresentation::kTagged);
|
| constant_object = isolate()->factory()->NewNumber(constant.ToFloat64());
|
| break;
|
| case Constant::kHeapObject:
|
| - DCHECK(CanBeTaggedPointer(type.representation()));
|
| + DCHECK_EQ(MachineRepresentation::kTagged, type.representation());
|
| constant_object = constant.ToHeapObject();
|
| break;
|
| default:
|
| - CHECK(false);
|
| + UNREACHABLE();
|
| }
|
| if (constant_object.is_identical_to(info()->closure())) {
|
| translation->StoreJSFrameFunction();
|
| @@ -985,8 +974,6 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
|
| int literal_id = DefineDeoptimizationLiteral(constant_object);
|
| translation->StoreLiteral(literal_id);
|
| }
|
| - } else {
|
| - CHECK(false);
|
| }
|
| }
|
|
|
|
|