| Index: src/mips/lithium-codegen-mips.cc
|
| diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
|
| index 6bd45fe2f2353633032609927c205d0e483fa763..01671143ab62114aa5926bdf14a09e0ed20282b1 100644
|
| --- a/src/mips/lithium-codegen-mips.cc
|
| +++ b/src/mips/lithium-codegen-mips.cc
|
| @@ -91,7 +91,7 @@ void LCodeGen::FinishCode(Handle<Code> code) {
|
| }
|
|
|
|
|
| -void LChunkBuilder::Abort(const char* reason) {
|
| +void LChunkBuilder::Abort(BailoutReason reason) {
|
| info()->set_bailout_reason(reason);
|
| status_ = ABORTED;
|
| }
|
| @@ -324,7 +324,7 @@ bool LCodeGen::GenerateDeoptJumpTable() {
|
| // end of the jump table.
|
| if (!is_int16((masm()->pc_offset() / Assembler::kInstrSize) +
|
| deopt_jump_table_.length() * 12)) {
|
| - Abort("Generated code is too large");
|
| + Abort(kGeneratedCodeIsTooLarge);
|
| }
|
|
|
| if (deopt_jump_table_.length() > 0) {
|
| @@ -411,7 +411,7 @@ Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) {
|
| ASSERT(constant->HasSmiValue());
|
| __ li(scratch, Operand(Smi::FromInt(constant->Integer32Value())));
|
| } else if (r.IsDouble()) {
|
| - Abort("EmitLoadRegister: Unsupported double immediate.");
|
| + Abort(kEmitLoadRegisterUnsupportedDoubleImmediate);
|
| } else {
|
| ASSERT(r.IsTagged());
|
| __ LoadObject(scratch, literal);
|
| @@ -449,9 +449,9 @@ DoubleRegister LCodeGen::EmitLoadDoubleRegister(LOperand* op,
|
| __ cvt_d_w(dbl_scratch, flt_scratch);
|
| return dbl_scratch;
|
| } else if (r.IsDouble()) {
|
| - Abort("unsupported double immediate");
|
| + Abort(kUnsupportedDoubleImmediate);
|
| } else if (r.IsTagged()) {
|
| - Abort("unsupported tagged immediate");
|
| + Abort(kUnsupportedTaggedImmediate);
|
| }
|
| } else if (op->IsStackSlot() || op->IsArgument()) {
|
| MemOperand mem_op = ToMemOperand(op);
|
| @@ -520,14 +520,14 @@ Operand LCodeGen::ToOperand(LOperand* op) {
|
| ASSERT(constant->HasInteger32Value());
|
| return Operand(constant->Integer32Value());
|
| } else if (r.IsDouble()) {
|
| - Abort("ToOperand Unsupported double immediate.");
|
| + Abort(kToOperandUnsupportedDoubleImmediate);
|
| }
|
| ASSERT(r.IsTagged());
|
| return Operand(constant->handle());
|
| } else if (op->IsRegister()) {
|
| return Operand(ToRegister(op));
|
| } else if (op->IsDoubleRegister()) {
|
| - Abort("ToOperand IsDoubleRegister unimplemented");
|
| + Abort(kToOperandIsDoubleRegisterUnimplemented);
|
| return Operand(0);
|
| }
|
| // Stack slots not implemented, use ToMemOperand instead.
|
| @@ -748,7 +748,7 @@ void LCodeGen::DeoptimizeIf(Condition cc,
|
| Address entry =
|
| Deoptimizer::GetDeoptimizationEntry(isolate(), id, bailout_type);
|
| if (entry == NULL) {
|
| - Abort("bailout was not prepared");
|
| + Abort(kBailoutWasNotPrepared);
|
| return;
|
| }
|
|
|
| @@ -1583,8 +1583,12 @@ void LCodeGen::DoShiftI(LShiftI* instr) {
|
| if (shift_count != 0) {
|
| if (instr->hydrogen_value()->representation().IsSmi() &&
|
| instr->can_deopt()) {
|
| - __ sll(result, left, shift_count - 1);
|
| - __ SmiTagCheckOverflow(result, result, scratch);
|
| + if (shift_count != 1) {
|
| + __ sll(result, left, shift_count - 1);
|
| + __ SmiTagCheckOverflow(result, result, scratch);
|
| + } else {
|
| + __ SmiTagCheckOverflow(result, left, scratch);
|
| + }
|
| DeoptimizeIf(lt, instr->environment(), scratch, Operand(zero_reg));
|
| } else {
|
| __ sll(result, left, shift_count);
|
| @@ -1658,6 +1662,11 @@ void LCodeGen::DoConstantD(LConstantD* instr) {
|
| }
|
|
|
|
|
| +void LCodeGen::DoConstantE(LConstantE* instr) {
|
| + __ li(ToRegister(instr->result()), Operand(instr->value()));
|
| +}
|
| +
|
| +
|
| void LCodeGen::DoConstantT(LConstantT* instr) {
|
| Handle<Object> value = instr->value();
|
| AllowDeferredHandleDereference smi_check;
|
| @@ -1761,7 +1770,7 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
|
| static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
|
| __ Subu(at, at, Operand(encoding == String::ONE_BYTE_ENCODING
|
| ? one_byte_seq_type : two_byte_seq_type));
|
| - __ Check(eq, "Unexpected string type", at, Operand(zero_reg));
|
| + __ Check(eq, kUnexpectedStringType, at, Operand(zero_reg));
|
| }
|
|
|
| __ Addu(scratch,
|
| @@ -2803,19 +2812,6 @@ void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoLinkObjectInList(LLinkObjectInList* instr) {
|
| - Register object = ToRegister(instr->object());
|
| - ExternalReference sites_list_address = instr->GetReference(isolate());
|
| -
|
| - __ li(at, Operand(sites_list_address));
|
| - __ lw(at, MemOperand(at));
|
| - __ sw(at, FieldMemOperand(object,
|
| - instr->hydrogen()->store_field().offset()));
|
| - __ li(at, Operand(sites_list_address));
|
| - __ sw(object, MemOperand(at));
|
| -}
|
| -
|
| -
|
| void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
|
| Register context = ToRegister(instr->context());
|
| Register result = ToRegister(instr->result());
|
| @@ -2878,6 +2874,13 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
|
| HObjectAccess access = instr->hydrogen()->access();
|
| int offset = access.offset();
|
| Register object = ToRegister(instr->object());
|
| +
|
| + if (access.IsExternalMemory()) {
|
| + Register result = ToRegister(instr->result());
|
| + __ lw(result, MemOperand(object, offset));
|
| + return;
|
| + }
|
| +
|
| if (instr->hydrogen()->representation().IsDouble()) {
|
| DoubleRegister result = ToDoubleRegister(instr->result());
|
| __ ldc1(result, FieldMemOperand(object, offset));
|
| @@ -3073,7 +3076,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
|
| if (key_is_constant) {
|
| constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
|
| if (constant_key & 0xF0000000) {
|
| - Abort("array index constant value too big.");
|
| + Abort(kArrayIndexConstantValueTooBig);
|
| }
|
| } else {
|
| key = ToRegister(instr->key());
|
| @@ -3159,7 +3162,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
|
| if (key_is_constant) {
|
| constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
|
| if (constant_key & 0xF0000000) {
|
| - Abort("array index constant value too big.");
|
| + Abort(kArrayIndexConstantValueTooBig);
|
| }
|
| } else {
|
| key = ToRegister(instr->key());
|
| @@ -3430,7 +3433,7 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
|
| void LCodeGen::DoPushArgument(LPushArgument* instr) {
|
| LOperand* argument = instr->value();
|
| if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) {
|
| - Abort("DoPushArgument not implemented for double type.");
|
| + Abort(kDoPushArgumentNotImplementedForDoubleType);
|
| } else {
|
| Register argument_reg = EmitLoadRegister(argument, at);
|
| __ push(argument_reg);
|
| @@ -4115,6 +4118,12 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
|
| HObjectAccess access = instr->hydrogen()->access();
|
| int offset = access.offset();
|
|
|
| + if (access.IsExternalMemory()) {
|
| + Register value = ToRegister(instr->value());
|
| + __ sw(value, MemOperand(object, offset));
|
| + return;
|
| + }
|
| +
|
| Handle<Map> transition = instr->transition();
|
|
|
| if (FLAG_track_heap_object_fields && representation.IsHeapObject()) {
|
| @@ -4249,7 +4258,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
|
| if (key_is_constant) {
|
| constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
|
| if (constant_key & 0xF0000000) {
|
| - Abort("array index constant value too big.");
|
| + Abort(kArrayIndexConstantValueTooBig);
|
| }
|
| } else {
|
| key = ToRegister(instr->key());
|
| @@ -4327,7 +4336,7 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) {
|
| if (key_is_constant) {
|
| constant_key = ToInteger32(LConstantOperand::cast(instr->key()));
|
| if (constant_key & 0xF0000000) {
|
| - Abort("array index constant value too big.");
|
| + Abort(kArrayIndexConstantValueTooBig);
|
| }
|
| } else {
|
| key = ToRegister(instr->key());
|
| @@ -4587,13 +4596,6 @@ void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoStringLength(LStringLength* instr) {
|
| - Register string = ToRegister(instr->string());
|
| - Register result = ToRegister(instr->result());
|
| - __ lw(result, FieldMemOperand(string, String::kLengthOffset));
|
| -}
|
| -
|
| -
|
| void LCodeGen::DoInteger32ToDouble(LInteger32ToDouble* instr) {
|
| LOperand* input = instr->value();
|
| ASSERT(input->IsRegister() || input->IsStackSlot());
|
| @@ -5312,10 +5314,12 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
|
| if (instr->hydrogen()->MustAllocateDoubleAligned()) {
|
| flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
|
| }
|
| - if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
|
| - ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace());
|
| + if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
|
| + ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
|
| + ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
|
| flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE);
|
| - } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) {
|
| + } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
|
| + ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
|
| flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE);
|
| }
|
| if (instr->size()->IsConstantOperand()) {
|
| @@ -5373,10 +5377,12 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
|
| __ Push(Smi::FromInt(size));
|
| }
|
|
|
| - if (instr->hydrogen()->CanAllocateInOldPointerSpace()) {
|
| - ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace());
|
| + if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
|
| + ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
|
| + ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
|
| CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr);
|
| - } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) {
|
| + } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
|
| + ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
|
| CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr);
|
| } else {
|
| CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
|
|
|