| Index: src/mips/lithium-codegen-mips.cc
|
| diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
|
| index 97dcd163cf2c7a6b2ffaf0e37e3feacf31db8c29..e644f0a9b57574ed1f609abecebf58983e95db09 100644
|
| --- a/src/mips/lithium-codegen-mips.cc
|
| +++ b/src/mips/lithium-codegen-mips.cc
|
| @@ -242,6 +242,8 @@ bool LCodeGen::GeneratePrologue() {
|
|
|
| // Trace the call.
|
| if (FLAG_trace && info()->IsOptimizing()) {
|
| + // We have not executed any compiled code yet, so cp still holds the
|
| + // incoming context.
|
| __ CallRuntime(Runtime::kTraceEnter, 0);
|
| }
|
| return !is_aborted();
|
| @@ -723,9 +725,22 @@ void LCodeGen::CallRuntime(const Runtime::Function* function,
|
| }
|
|
|
|
|
| +void LCodeGen::LoadContextFromDeferred(LOperand* context) {
|
| + if (context->IsRegister()) {
|
| + __ Move(cp, ToRegister(context));
|
| + } else if (context->IsStackSlot()) {
|
| + __ lw(cp, ToMemOperand(context));
|
| + } else {
|
| + UNREACHABLE();
|
| + }
|
| +}
|
| +
|
| +
|
| void LCodeGen::CallRuntimeFromDeferred(Runtime::FunctionId id,
|
| int argc,
|
| - LInstruction* instr) {
|
| + LInstruction* instr,
|
| + LOperand* context) {
|
| + LoadContextFromDeferred(context);
|
| __ CallRuntimeSaveDoubles(id);
|
| RecordSafepointWithRegisters(
|
| instr->pointer_map(), argc, Safepoint::kNoLazyDeopt);
|
| @@ -950,10 +965,6 @@ void LCodeGen::RecordSafepoint(
|
| safepoint.DefinePointerRegister(ToRegister(pointer), zone());
|
| }
|
| }
|
| - if (kind & Safepoint::kWithRegisters) {
|
| - // Register cp always contains a pointer to the context.
|
| - safepoint.DefinePointerRegister(cp, zone());
|
| - }
|
| }
|
|
|
|
|
| @@ -1046,6 +1057,7 @@ void LCodeGen::DoParameter(LParameter* instr) {
|
|
|
|
|
| void LCodeGen::DoCallStub(LCallStub* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
| switch (instr->hydrogen()->major_key()) {
|
| case CodeStub::RegExpConstructResult: {
|
| @@ -1828,6 +1840,7 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
|
| void LCodeGen::DoThrow(LThrow* instr) {
|
| Register input_reg = EmitLoadRegister(instr->value(), at);
|
| __ push(input_reg);
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| CallRuntime(Runtime::kThrow, 1, instr);
|
|
|
| if (FLAG_debug_code) {
|
| @@ -1979,6 +1992,7 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) {
|
|
|
|
|
| void LCodeGen::DoArithmeticT(LArithmeticT* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->left()).is(a1));
|
| ASSERT(ToRegister(instr->right()).is(a0));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
| @@ -2425,6 +2439,7 @@ static Condition ComputeCompareCondition(Token::Value op) {
|
|
|
|
|
| void LCodeGen::DoStringCompareAndBranch(LStringCompareAndBranch* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| Token::Value op = instr->op();
|
|
|
| Handle<Code> ic = CompareIC::GetUninitialized(isolate(), op);
|
| @@ -2584,6 +2599,7 @@ void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) {
|
|
|
|
|
| void LCodeGen::DoInstanceOf(LInstanceOf* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| Label true_label, done;
|
| ASSERT(ToRegister(instr->left()).is(a0)); // Object is in a0.
|
| ASSERT(ToRegister(instr->right()).is(a1)); // Function is in a1.
|
| @@ -2694,6 +2710,7 @@ void LCodeGen::DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
|
| InstanceofStub stub(flags);
|
|
|
| PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
| + LoadContextFromDeferred(instr->context());
|
|
|
| // Get the temp register reserved by the instruction. This needs to be t0 as
|
| // its slot of the pushing of safepoint registers is used to communicate the
|
| @@ -2731,6 +2748,7 @@ void LCodeGen::DoInstanceSize(LInstanceSize* instr) {
|
|
|
|
|
| void LCodeGen::DoCmpT(LCmpT* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| Token::Value op = instr->op();
|
|
|
| Handle<Code> ic = CompareIC::GetUninitialized(isolate(), op);
|
| @@ -2754,8 +2772,11 @@ void LCodeGen::DoCmpT(LCmpT* instr) {
|
| void LCodeGen::DoReturn(LReturn* instr) {
|
| if (FLAG_trace && info()->IsOptimizing()) {
|
| // Push the return value on the stack as the parameter.
|
| - // Runtime::TraceExit returns its parameter in v0.
|
| + // Runtime::TraceExit returns its parameter in v0. We're leaving the code
|
| + // managed by the register allocator and tearing down the frame, it's
|
| + // safe to write to the context register.
|
| __ push(v0);
|
| + __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| __ CallRuntime(Runtime::kTraceExit, 1);
|
| }
|
| if (info()->saves_caller_doubles()) {
|
| @@ -2810,6 +2831,7 @@ void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) {
|
|
|
|
|
| void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->global_object()).is(a0));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
|
|
| @@ -2847,6 +2869,7 @@ void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) {
|
|
|
|
|
| void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->global_object()).is(a1));
|
| ASSERT(ToRegister(instr->value()).is(a0));
|
|
|
| @@ -2944,6 +2967,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
|
|
|
|
|
| void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->object()).is(a0));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
|
|
| @@ -3249,6 +3273,7 @@ MemOperand LCodeGen::PrepareKeyedOperand(Register key,
|
|
|
|
|
| void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->object()).is(a1));
|
| ASSERT(ToRegister(instr->key()).is(a0));
|
|
|
| @@ -3394,7 +3419,6 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) {
|
| ParameterCount actual(receiver);
|
| __ InvokeFunction(function, actual, CALL_FUNCTION,
|
| safepoint_generator, CALL_AS_METHOD);
|
| - __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| }
|
|
|
|
|
| @@ -3423,11 +3447,11 @@ void LCodeGen::DoThisFunction(LThisFunction* instr) {
|
| void LCodeGen::DoContext(LContext* instr) {
|
| // If there is a non-return use, the context must be moved to a register.
|
| Register result = ToRegister(instr->result());
|
| - for (HUseIterator it(instr->hydrogen()->uses()); !it.Done(); it.Advance()) {
|
| - if (!it.value()->IsReturn()) {
|
| - __ mov(result, cp);
|
| - return;
|
| - }
|
| + if (info()->IsOptimizing()) {
|
| + __ lw(result, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| + } else {
|
| + // If there is no frame, the context must be in cp.
|
| + ASSERT(result.is(cp));
|
| }
|
| }
|
|
|
| @@ -3441,6 +3465,7 @@ void LCodeGen::DoOuterContext(LOuterContext* instr) {
|
|
|
|
|
| void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| __ LoadHeapObject(scratch0(), instr->hydrogen()->pairs());
|
| __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags())));
|
| // The context is the first argument.
|
| @@ -3450,8 +3475,9 @@ void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
|
|
|
|
|
| void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
|
| + Register context = ToRegister(instr->context());
|
| Register result = ToRegister(instr->result());
|
| - __ lw(result, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
|
| + __ lw(result, ContextOperand(context, Context::GLOBAL_OBJECT_INDEX));
|
| }
|
|
|
|
|
| @@ -3504,9 +3530,6 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
|
| __ InvokeFunction(
|
| function, expected, count, CALL_FUNCTION, generator, call_kind);
|
| }
|
| -
|
| - // Restore context.
|
| - __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| }
|
|
|
|
|
| @@ -3523,6 +3546,8 @@ void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) {
|
|
|
|
|
| void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) {
|
| + ASSERT(instr->context() != NULL);
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| Register input = ToRegister(instr->value());
|
| Register result = ToRegister(instr->result());
|
| Register scratch = scratch0();
|
| @@ -3564,7 +3589,8 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) {
|
| // Slow case: Call the runtime system to do the number allocation.
|
| __ bind(&slow);
|
|
|
| - CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
|
| + CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr,
|
| + instr->context());
|
| // Set the pointer to the new heap number in tmp.
|
| if (!tmp1.is(v0))
|
| __ mov(tmp1, v0);
|
| @@ -3882,6 +3908,9 @@ void LCodeGen::DoMathExp(LMathExp* instr) {
|
|
|
| void LCodeGen::DoMathLog(LMathLog* instr) {
|
| ASSERT(ToDoubleRegister(instr->result()).is(f4));
|
| + // Set the context register to a GC-safe fake value. Clobbering it is
|
| + // OK because this instruction is marked as a call.
|
| + __ mov(cp, zero_reg);
|
| TranscendentalCacheStub stub(TranscendentalCache::LOG,
|
| TranscendentalCacheStub::UNTAGGED);
|
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| @@ -3890,6 +3919,9 @@ void LCodeGen::DoMathLog(LMathLog* instr) {
|
|
|
| void LCodeGen::DoMathTan(LMathTan* instr) {
|
| ASSERT(ToDoubleRegister(instr->result()).is(f4));
|
| + // Set the context register to a GC-safe fake value. Clobbering it is
|
| + // OK because this instruction is marked as a call.
|
| + __ mov(cp, zero_reg);
|
| TranscendentalCacheStub stub(TranscendentalCache::TAN,
|
| TranscendentalCacheStub::UNTAGGED);
|
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| @@ -3898,6 +3930,9 @@ void LCodeGen::DoMathTan(LMathTan* instr) {
|
|
|
| void LCodeGen::DoMathCos(LMathCos* instr) {
|
| ASSERT(ToDoubleRegister(instr->result()).is(f4));
|
| + // Set the context register to a GC-safe fake value. Clobbering it is
|
| + // OK because this instruction is marked as a call.
|
| + __ mov(cp, zero_reg);
|
| TranscendentalCacheStub stub(TranscendentalCache::COS,
|
| TranscendentalCacheStub::UNTAGGED);
|
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| @@ -3906,6 +3941,9 @@ void LCodeGen::DoMathCos(LMathCos* instr) {
|
|
|
| void LCodeGen::DoMathSin(LMathSin* instr) {
|
| ASSERT(ToDoubleRegister(instr->result()).is(f4));
|
| + // Set the context register to a GC-safe fake value. Clobbering it is
|
| + // OK because this instruction is marked as a call.
|
| + __ mov(cp, zero_reg);
|
| TranscendentalCacheStub stub(TranscendentalCache::SIN,
|
| TranscendentalCacheStub::UNTAGGED);
|
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| @@ -3913,6 +3951,7 @@ void LCodeGen::DoMathSin(LMathSin* instr) {
|
|
|
|
|
| void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->function()).is(a1));
|
| ASSERT(instr->HasPointerMap());
|
|
|
| @@ -3923,7 +3962,6 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
|
| SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt);
|
| ParameterCount count(instr->arity());
|
| __ InvokeFunction(a1, count, CALL_FUNCTION, generator, CALL_AS_METHOD);
|
| - __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| } else {
|
| CallKnownFunction(known_function,
|
| instr->hydrogen()->formal_parameter_count(),
|
| @@ -3936,17 +3974,18 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
|
|
|
|
|
| void LCodeGen::DoCallKeyed(LCallKeyed* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
|
|
| int arity = instr->arity();
|
| Handle<Code> ic =
|
| isolate()->stub_cache()->ComputeKeyedCallInitialize(arity);
|
| CallCode(ic, RelocInfo::CODE_TARGET, instr);
|
| - __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| }
|
|
|
|
|
| void LCodeGen::DoCallNamed(LCallNamed* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
|
|
| int arity = instr->arity();
|
| @@ -3955,23 +3994,22 @@ void LCodeGen::DoCallNamed(LCallNamed* instr) {
|
| isolate()->stub_cache()->ComputeCallInitialize(arity, mode);
|
| __ li(a2, Operand(instr->name()));
|
| CallCode(ic, mode, instr);
|
| - // Restore context register.
|
| - __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| }
|
|
|
|
|
| void LCodeGen::DoCallFunction(LCallFunction* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->function()).is(a1));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
|
|
| int arity = instr->arity();
|
| CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS);
|
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
|
| - __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| }
|
|
|
|
|
| void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
|
|
| int arity = instr->arity();
|
| @@ -3980,7 +4018,6 @@ void LCodeGen::DoCallGlobal(LCallGlobal* instr) {
|
| isolate()->stub_cache()->ComputeCallInitialize(arity, mode);
|
| __ li(a2, Operand(instr->name()));
|
| CallCode(ic, mode, instr);
|
| - __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| }
|
|
|
|
|
| @@ -3996,6 +4033,7 @@ void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) {
|
|
|
|
|
| void LCodeGen::DoCallNew(LCallNew* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->constructor()).is(a1));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
|
|
| @@ -4009,6 +4047,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) {
|
|
|
|
|
| void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->constructor()).is(a1));
|
| ASSERT(ToRegister(instr->result()).is(v0));
|
|
|
| @@ -4160,6 +4199,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
|
|
|
|
|
| void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->object()).is(a1));
|
| ASSERT(ToRegister(instr->value()).is(a0));
|
|
|
| @@ -4402,6 +4442,7 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) {
|
|
|
|
|
| void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| ASSERT(ToRegister(instr->object()).is(a2));
|
| ASSERT(ToRegister(instr->key()).is(a1));
|
| ASSERT(ToRegister(instr->value()).is(a0));
|
| @@ -4434,6 +4475,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) {
|
| __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg,
|
| scratch, GetRAState(), kDontSaveFPRegs);
|
| } else {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| PushSafepointRegistersScope scope(
|
| this, Safepoint::kWithRegistersAndDoubles);
|
| __ mov(a0, object_reg);
|
| @@ -4458,6 +4500,7 @@ void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) {
|
|
|
|
|
| void LCodeGen::DoStringAdd(LStringAdd* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| __ push(ToRegister(instr->left()));
|
| __ push(ToRegister(instr->right()));
|
| StringAddStub stub(instr->hydrogen()->flags());
|
| @@ -4512,7 +4555,8 @@ void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) {
|
| __ SmiTag(index);
|
| __ push(index);
|
| }
|
| - CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr);
|
| + CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr,
|
| + instr->context());
|
| __ AssertSmi(v0);
|
| __ SmiUntag(v0);
|
| __ StoreToSafepointRegisterSlot(v0, result);
|
| @@ -4565,7 +4609,7 @@ void LCodeGen::DoDeferredStringCharFromCode(LStringCharFromCode* instr) {
|
| PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
| __ SmiTag(char_code);
|
| __ push(char_code);
|
| - CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr);
|
| + CallRuntimeFromDeferred(Runtime::kCharFromCode, 1, instr, instr->context());
|
| __ StoreToSafepointRegisterSlot(v0, result);
|
| }
|
|
|
| @@ -4705,7 +4749,15 @@ void LCodeGen::DoDeferredNumberTagI(LInstruction* instr,
|
| // register is stored, as this register is in the pointer map, but contains an
|
| // integer value.
|
| __ StoreToSafepointRegisterSlot(zero_reg, dst);
|
| - CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
|
| + // NumberTagI and NumberTagD use the context from the frame, rather than
|
| + // the environment's HContext or HInlinedContext value.
|
| + // They only call Runtime::kAllocateHeapNumber.
|
| + // The corresponding HChange instructions are added in a phase that does
|
| + // not have easy access to the local context.
|
| + __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| + __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
|
| + RecordSafepointWithRegisters(
|
| + instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
|
| __ Move(dst, v0);
|
| __ Subu(dst, dst, kHeapObjectTag);
|
|
|
| @@ -4761,7 +4813,15 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) {
|
| __ mov(reg, zero_reg);
|
|
|
| PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
| - CallRuntimeFromDeferred(Runtime::kAllocateHeapNumber, 0, instr);
|
| + // NumberTagI and NumberTagD use the context from the frame, rather than
|
| + // the environment's HContext or HInlinedContext value.
|
| + // They only call Runtime::kAllocateHeapNumber.
|
| + // The corresponding HChange instructions are added in a phase that does
|
| + // not have easy access to the local context.
|
| + __ lw(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| + __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber);
|
| + RecordSafepointWithRegisters(
|
| + instr->pointer_map(), 0, Safepoint::kNoLazyDeopt);
|
| __ Subu(v0, v0, kHeapObjectTag);
|
| __ StoreToSafepointRegisterSlot(v0, reg);
|
| }
|
| @@ -5106,7 +5166,10 @@ void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) {
|
| {
|
| PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
| __ push(object);
|
| - CallRuntimeFromDeferred(Runtime::kMigrateInstance, 1, instr);
|
| + __ mov(cp, zero_reg);
|
| + __ CallRuntimeSaveDoubles(Runtime::kMigrateInstance);
|
| + RecordSafepointWithRegisters(
|
| + instr->pointer_map(), 1, Safepoint::kNoLazyDeopt);
|
| __ StoreToSafepointRegisterSlot(v0, scratch0());
|
| }
|
| __ And(at, scratch0(), Operand(kSmiTagMask));
|
| @@ -5304,12 +5367,15 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
|
| if (instr->hydrogen()->IsOldPointerSpaceAllocation()) {
|
| ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation());
|
| ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
|
| - CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr);
|
| + CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr,
|
| + instr->context());
|
| } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) {
|
| ASSERT(!instr->hydrogen()->IsNewSpaceAllocation());
|
| - CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr);
|
| + CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr,
|
| + instr->context());
|
| } else {
|
| - CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr);
|
| + CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr,
|
| + instr->context());
|
| }
|
| __ StoreToSafepointRegisterSlot(v0, result);
|
| }
|
| @@ -5324,6 +5390,7 @@ void LCodeGen::DoToFastProperties(LToFastProperties* instr) {
|
|
|
|
|
| void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| Label materialized;
|
| // Registers will be used as follows:
|
| // t3 = literals array.
|
| @@ -5376,6 +5443,7 @@ void LCodeGen::DoRegExpLiteral(LRegExpLiteral* instr) {
|
|
|
|
|
| void LCodeGen::DoFunctionLiteral(LFunctionLiteral* instr) {
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| // Use the fast case closure allocation code that allocates in new
|
| // space for nested functions that don't need literals cloning.
|
| bool pretenure = instr->hydrogen()->pretenure();
|
| @@ -5607,6 +5675,7 @@ void LCodeGen::DoDummyUse(LDummyUse* instr) {
|
|
|
| void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) {
|
| PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters);
|
| + LoadContextFromDeferred(instr->context());
|
| __ CallRuntimeSaveDoubles(Runtime::kStackGuard);
|
| RecordSafepointWithLazyDeopt(
|
| instr, RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS);
|
| @@ -5638,6 +5707,8 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) {
|
| Label done;
|
| __ LoadRoot(at, Heap::kStackLimitRootIndex);
|
| __ Branch(&done, hs, sp, Operand(at));
|
| + ASSERT(instr->context()->IsRegister());
|
| + ASSERT(ToRegister(instr->context()).is(cp));
|
| CallCode(isolate()->builtins()->StackCheck(),
|
| RelocInfo::CODE_TARGET,
|
| instr);
|
|
|