| Index: src/mips/lithium-codegen-mips.cc
|
| diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
|
| index 3518f137a638ce6d7be42fce23f956999f118ccd..6f82e1bd75d77d9362318cec51cb23be206f7cd1 100644
|
| --- a/src/mips/lithium-codegen-mips.cc
|
| +++ b/src/mips/lithium-codegen-mips.cc
|
| @@ -2067,25 +2067,6 @@ void LCodeGen::DoDebugBreak(LDebugBreak* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoIsNumberAndBranch(LIsNumberAndBranch* instr) {
|
| - Representation r = instr->hydrogen()->value()->representation();
|
| - if (r.IsSmiOrInteger32() || r.IsDouble()) {
|
| - EmitBranch(instr, al, zero_reg, Operand(zero_reg));
|
| - } else {
|
| - ASSERT(r.IsTagged());
|
| - Register reg = ToRegister(instr->value());
|
| - HType type = instr->hydrogen()->value()->type();
|
| - if (type.IsTaggedNumber()) {
|
| - EmitBranch(instr, al, zero_reg, Operand(zero_reg));
|
| - }
|
| - __ JumpIfSmi(reg, instr->TrueLabel(chunk_));
|
| - __ lw(scratch0(), FieldMemOperand(reg, HeapObject::kMapOffset));
|
| - __ LoadRoot(at, Heap::kHeapNumberMapRootIndex);
|
| - EmitBranch(instr, eq, scratch0(), Operand(at));
|
| - }
|
| -}
|
| -
|
| -
|
| void LCodeGen::DoBranch(LBranch* instr) {
|
| Representation r = instr->hydrogen()->value()->representation();
|
| if (r.IsInteger32() || r.IsSmi()) {
|
| @@ -3021,6 +3002,12 @@ void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) {
|
| }
|
|
|
|
|
| +void LCodeGen::DoLoadRoot(LLoadRoot* instr) {
|
| + Register result = ToRegister(instr->result());
|
| + __ LoadRoot(result, instr->index());
|
| +}
|
| +
|
| +
|
| void LCodeGen::DoLoadExternalArrayPointer(
|
| LLoadExternalArrayPointer* instr) {
|
| Register to_reg = ToRegister(instr->result());
|
| @@ -4251,20 +4238,25 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
|
|
|
| if (elements_kind == EXTERNAL_FLOAT_ELEMENTS ||
|
| elements_kind == EXTERNAL_DOUBLE_ELEMENTS) {
|
| + Register address = scratch0();
|
| FPURegister value(ToDoubleRegister(instr->value()));
|
| if (key_is_constant) {
|
| - __ Addu(scratch0(), external_pointer, constant_key <<
|
| - element_size_shift);
|
| + if (constant_key != 0) {
|
| + __ Addu(address, external_pointer,
|
| + Operand(constant_key << element_size_shift));
|
| + } else {
|
| + address = external_pointer;
|
| + }
|
| } else {
|
| - __ sll(scratch0(), key, shift_size);
|
| - __ Addu(scratch0(), scratch0(), external_pointer);
|
| + __ sll(address, key, shift_size);
|
| + __ Addu(address, external_pointer, address);
|
| }
|
|
|
| if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) {
|
| __ cvt_s_d(double_scratch0(), value);
|
| - __ swc1(double_scratch0(), MemOperand(scratch0(), additional_offset));
|
| + __ swc1(double_scratch0(), MemOperand(address, additional_offset));
|
| } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS
|
| - __ sdc1(value, MemOperand(scratch0(), additional_offset));
|
| + __ sdc1(value, MemOperand(address, additional_offset));
|
| }
|
| } else {
|
| Register value(ToRegister(instr->value()));
|
| @@ -4306,33 +4298,29 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
|
| void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) {
|
| DoubleRegister value = ToDoubleRegister(instr->value());
|
| Register elements = ToRegister(instr->elements());
|
| - Register key = no_reg;
|
| Register scratch = scratch0();
|
| + DoubleRegister double_scratch = double_scratch0();
|
| bool key_is_constant = instr->key()->IsConstantOperand();
|
| - int constant_key = 0;
|
| - Label not_nan;
|
| + Label not_nan, done;
|
|
|
| // Calculate the effective address of the slot in the array to store the
|
| // double value.
|
| + int element_size_shift = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS);
|
| if (key_is_constant) {
|
| - constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
|
| + int constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
|
| if (constant_key & 0xF0000000) {
|
| Abort(kArrayIndexConstantValueTooBig);
|
| }
|
| + __ Addu(scratch, elements,
|
| + Operand((constant_key << element_size_shift) +
|
| + FixedDoubleArray::kHeaderSize - kHeapObjectTag));
|
| } else {
|
| - key = ToRegister(instr->key());
|
| - }
|
| - int element_size_shift = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS);
|
| - int shift_size = (instr->hydrogen()->key()->representation().IsSmi())
|
| - ? (element_size_shift - kSmiTagSize) : element_size_shift;
|
| - if (key_is_constant) {
|
| - __ Addu(scratch, elements, Operand((constant_key << element_size_shift) +
|
| - FixedDoubleArray::kHeaderSize - kHeapObjectTag));
|
| - } else {
|
| - __ sll(scratch, key, shift_size);
|
| - __ Addu(scratch, elements, Operand(scratch));
|
| - __ Addu(scratch, scratch,
|
| + int shift_size = (instr->hydrogen()->key()->representation().IsSmi())
|
| + ? (element_size_shift - kSmiTagSize) : element_size_shift;
|
| + __ Addu(scratch, elements,
|
| Operand(FixedDoubleArray::kHeaderSize - kHeapObjectTag));
|
| + __ sll(at, ToRegister(instr->key()), shift_size);
|
| + __ Addu(scratch, scratch, at);
|
| }
|
|
|
| if (instr->NeedsCanonicalization()) {
|
| @@ -4343,12 +4331,17 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) {
|
|
|
| // Only load canonical NaN if the comparison above set the overflow.
|
| __ bind(&is_nan);
|
| - __ Move(value, FixedDoubleArray::canonical_not_the_hole_nan_as_double());
|
| + __ Move(double_scratch,
|
| + FixedDoubleArray::canonical_not_the_hole_nan_as_double());
|
| + __ sdc1(double_scratch, MemOperand(scratch, instr->additional_index() <<
|
| + element_size_shift));
|
| + __ Branch(&done);
|
| }
|
|
|
| __ bind(¬_nan);
|
| __ sdc1(value, MemOperand(scratch, instr->additional_index() <<
|
| element_size_shift));
|
| + __ bind(&done);
|
| }
|
|
|
|
|
| @@ -5105,7 +5098,7 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
|
|
| void LCodeGen::DoCheckValue(LCheckValue* instr) {
|
| Register reg = ToRegister(instr->value());
|
| - Handle<HeapObject> object = instr->hydrogen()->object();
|
| + Handle<HeapObject> object = instr->hydrogen()->object().handle();
|
| AllowDeferredHandleDereference smi_check;
|
| if (isolate()->heap()->InNewSpace(*object)) {
|
| Register reg = ToRegister(instr->value());
|
| @@ -5156,7 +5149,6 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
|
| LOperand* input = instr->value();
|
| ASSERT(input->IsRegister());
|
| Register reg = ToRegister(input);
|
| - SmallMapList* map_set = instr->hydrogen()->map_set();
|
| __ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
|
|
|
| DeferredCheckMaps* deferred = NULL;
|
| @@ -5165,12 +5157,13 @@ void LCodeGen::DoCheckMaps(LCheckMaps* instr) {
|
| __ bind(deferred->check_maps());
|
| }
|
|
|
| + UniqueSet<Map> map_set = instr->hydrogen()->map_set();
|
| Label success;
|
| - for (int i = 0; i < map_set->length() - 1; i++) {
|
| - Handle<Map> map = map_set->at(i);
|
| + for (int i = 0; i < map_set.size() - 1; i++) {
|
| + Handle<Map> map = map_set.at(i).handle();
|
| __ CompareMapAndBranch(map_reg, map, &success, eq, &success);
|
| }
|
| - Handle<Map> map = map_set->last();
|
| + Handle<Map> map = map_set.at(map_set.size() - 1).handle();
|
| // Do the CompareMap() directly within the Branch() and DeoptimizeIf().
|
| if (instr->hydrogen()->has_migration_target()) {
|
| __ Branch(deferred->entry(), ne, map_reg, Operand(map));
|
|
|