| Index: src/mips/lithium-codegen-mips.cc
|
| diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
|
| index aa56d7298e6900d00241bfceaf808076f6a0e2a1..e7f05a66468b37110125f9fc27642d6c502cf1bf 100644
|
| --- a/src/mips/lithium-codegen-mips.cc
|
| +++ b/src/mips/lithium-codegen-mips.cc
|
| @@ -409,7 +409,7 @@ Register LCodeGen::EmitLoadRegister(LOperand* op, Register scratch) {
|
| } else if (r.IsDouble()) {
|
| Abort(kEmitLoadRegisterUnsupportedDoubleImmediate);
|
| } else {
|
| - ASSERT(r.IsTagged());
|
| + ASSERT(r.IsSmiOrTagged());
|
| __ LoadObject(scratch, literal);
|
| }
|
| return scratch;
|
| @@ -1398,10 +1398,7 @@ void LCodeGen::DoMulI(LMulI* instr) {
|
| instr->hydrogen()->CheckFlag(HValue::kBailoutOnMinusZero);
|
|
|
| if (right_op->IsConstantOperand() && !can_overflow) {
|
| - // Use optimized code for specific constants.
|
| - int32_t constant = ToRepresentation(
|
| - LConstantOperand::cast(right_op),
|
| - instr->hydrogen()->right()->representation());
|
| + int32_t constant = ToInteger32(LConstantOperand::cast(right_op));
|
|
|
| if (bailout_on_minus_zero && (constant < 0)) {
|
| // The case of a null constant will be handled separately.
|
| @@ -4067,6 +4064,16 @@ void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
|
| }
|
|
|
|
|
| +void LCodeGen::DoStoreCodeEntry(LStoreCodeEntry* instr) {
|
| + Register function = ToRegister(instr->function());
|
| + Register code_object = ToRegister(instr->code_object());
|
| + __ Addu(code_object, code_object,
|
| + Operand(Code::kHeaderSize - kHeapObjectTag));
|
| + __ sw(code_object,
|
| + FieldMemOperand(function, JSFunction::kCodeEntryOffset));
|
| +}
|
| +
|
| +
|
| void LCodeGen::DoInnerAllocatedObject(LInnerAllocatedObject* instr) {
|
| Register result = ToRegister(instr->result());
|
| Register base = ToRegister(instr->base_object());
|
| @@ -4846,7 +4853,7 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
| Register scratch1 = scratch0();
|
| Register scratch2 = ToRegister(instr->temp());
|
| DoubleRegister double_scratch = double_scratch0();
|
| - DoubleRegister double_scratch2 = ToDoubleRegister(instr->temp3());
|
| + DoubleRegister double_scratch2 = ToDoubleRegister(instr->temp2());
|
|
|
| ASSERT(!scratch1.is(input_reg) && !scratch1.is(scratch2));
|
| ASSERT(!scratch2.is(input_reg) && !scratch2.is(scratch1));
|
| @@ -4861,11 +4868,6 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
| // of the if.
|
|
|
| if (instr->truncating()) {
|
| - Register scratch3 = ToRegister(instr->temp2());
|
| - FPURegister single_scratch = double_scratch.low();
|
| - ASSERT(!scratch3.is(input_reg) &&
|
| - !scratch3.is(scratch1) &&
|
| - !scratch3.is(scratch2));
|
| // Performs a truncating conversion of a floating point number as used by
|
| // the JS bitwise operations.
|
| Label heap_number;
|
| @@ -4879,14 +4881,8 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
|
| __ Branch(&done);
|
|
|
| __ bind(&heap_number);
|
| - __ ldc1(double_scratch2,
|
| - FieldMemOperand(input_reg, HeapNumber::kValueOffset));
|
| - __ EmitECMATruncate(input_reg,
|
| - double_scratch2,
|
| - single_scratch,
|
| - scratch1,
|
| - scratch2,
|
| - scratch3);
|
| + __ mov(scratch2, input_reg);
|
| + __ TruncateHeapNumberToI(input_reg, scratch2);
|
| } else {
|
| // Deoptimize if we don't have a heap number.
|
| DeoptimizeIf(ne, instr->environment(), scratch1, Operand(at));
|
| @@ -4973,20 +4969,12 @@ void LCodeGen::DoNumberUntagD(LNumberUntagD* instr) {
|
| void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
| Register result_reg = ToRegister(instr->result());
|
| Register scratch1 = scratch0();
|
| - Register scratch2 = ToRegister(instr->temp());
|
| DoubleRegister double_input = ToDoubleRegister(instr->value());
|
|
|
| if (instr->truncating()) {
|
| - Register scratch3 = ToRegister(instr->temp2());
|
| - FPURegister single_scratch = double_scratch0().low();
|
| - __ EmitECMATruncate(result_reg,
|
| - double_input,
|
| - single_scratch,
|
| - scratch1,
|
| - scratch2,
|
| - scratch3);
|
| + __ TruncateDoubleToI(result_reg, double_input);
|
| } else {
|
| - Register except_flag = scratch2;
|
| + Register except_flag = LCodeGen::scratch1();
|
|
|
| __ EmitFPUTruncate(kRoundToMinusInf,
|
| result_reg,
|
| @@ -5013,21 +5001,13 @@ void LCodeGen::DoDoubleToI(LDoubleToI* instr) {
|
|
|
| void LCodeGen::DoDoubleToSmi(LDoubleToSmi* instr) {
|
| Register result_reg = ToRegister(instr->result());
|
| - Register scratch1 = scratch0();
|
| - Register scratch2 = ToRegister(instr->temp());
|
| + Register scratch1 = LCodeGen::scratch0();
|
| DoubleRegister double_input = ToDoubleRegister(instr->value());
|
|
|
| if (instr->truncating()) {
|
| - Register scratch3 = ToRegister(instr->temp2());
|
| - FPURegister single_scratch = double_scratch0().low();
|
| - __ EmitECMATruncate(result_reg,
|
| - double_input,
|
| - single_scratch,
|
| - scratch1,
|
| - scratch2,
|
| - scratch3);
|
| + __ TruncateDoubleToI(result_reg, double_input);
|
| } else {
|
| - Register except_flag = scratch2;
|
| + Register except_flag = LCodeGen::scratch1();
|
|
|
| __ EmitFPUTruncate(kRoundToMinusInf,
|
| result_reg,
|
| @@ -5109,20 +5089,20 @@ void LCodeGen::DoCheckInstanceType(LCheckInstanceType* instr) {
|
| }
|
|
|
|
|
| -void LCodeGen::DoCheckFunction(LCheckFunction* instr) {
|
| +void LCodeGen::DoCheckValue(LCheckValue* instr) {
|
| Register reg = ToRegister(instr->value());
|
| - Handle<JSFunction> target = instr->hydrogen()->target();
|
| + Handle<HeapObject> object = instr->hydrogen()->object();
|
| AllowDeferredHandleDereference smi_check;
|
| - if (isolate()->heap()->InNewSpace(*target)) {
|
| + if (isolate()->heap()->InNewSpace(*object)) {
|
| Register reg = ToRegister(instr->value());
|
| - Handle<Cell> cell = isolate()->factory()->NewCell(target);
|
| + Handle<Cell> cell = isolate()->factory()->NewCell(object);
|
| __ li(at, Operand(Handle<Object>(cell)));
|
| __ lw(at, FieldMemOperand(at, Cell::kValueOffset));
|
| DeoptimizeIf(ne, instr->environment(), reg,
|
| Operand(at));
|
| } else {
|
| DeoptimizeIf(ne, instr->environment(), reg,
|
| - Operand(target));
|
| + Operand(object));
|
| }
|
| }
|
|
|
| @@ -5407,8 +5387,7 @@ void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
|
| if (!pretenure && instr->hydrogen()->has_no_literals()) {
|
| FastNewClosureStub stub(instr->hydrogen()->language_mode(),
|
| instr->hydrogen()->is_generator());
|
| - __ li(a1, Operand(instr->hydrogen()->shared_info()));
|
| - __ push(a1);
|
| + __ li(a2, Operand(instr->hydrogen()->shared_info()));
|
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| } else {
|
| __ li(a2, Operand(instr->hydrogen()->shared_info()));
|
| @@ -5664,8 +5643,9 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) {
|
| Label done;
|
| __ LoadRoot(at, Heap::kStackLimitRootIndex);
|
| __ Branch(&done, hs, sp, Operand(at));
|
| - StackCheckStub stub;
|
| - CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| + CallCode(isolate()->builtins()->StackCheck(),
|
| + RelocInfo::CODE_TARGET,
|
| + instr);
|
| EnsureSpaceForLazyDeopt();
|
| last_lazy_deopt_pc_ = masm()->pc_offset();
|
| __ bind(&done);
|
|
|