Chromium Code Reviews| Index: src/arm/lithium-codegen-arm.cc |
| diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
| index ca38743b6b1921ab59cd3feae08923c309503370..e7734c19296f2143f45ac2a83352a4d1e7e49928 100644 |
| --- a/src/arm/lithium-codegen-arm.cc |
| +++ b/src/arm/lithium-codegen-arm.cc |
| @@ -248,6 +248,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(); |
| @@ -759,9 +761,22 @@ void LCodeGen::CallRuntime(const Runtime::Function* function, |
| } |
| +void LCodeGen::LoadContextFromDeferred(LOperand* context) { |
| + if (context->IsRegister()) { |
| + __ Move(cp, ToRegister(context)); |
| + } else if (context->IsStackSlot()) { |
| + __ ldr(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); |
| @@ -977,10 +992,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()); |
| - } |
| } |
| @@ -1073,6 +1084,7 @@ void LCodeGen::DoParameter(LParameter* instr) { |
| void LCodeGen::DoCallStub(LCallStub* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| switch (instr->hydrogen()->major_key()) { |
| case CodeStub::RegExpConstructResult: { |
| @@ -2023,6 +2035,7 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { |
| void LCodeGen::DoThrow(LThrow* instr) { |
| Register input_reg = EmitLoadRegister(instr->value(), ip); |
| __ push(input_reg); |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| CallRuntime(Runtime::kThrow, 1, instr); |
| if (FLAG_debug_code) { |
| @@ -2160,6 +2173,7 @@ void LCodeGen::DoArithmeticD(LArithmeticD* instr) { |
| void LCodeGen::DoArithmeticT(LArithmeticT* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->left()).is(r1)); |
| ASSERT(ToRegister(instr->right()).is(r0)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| @@ -2571,6 +2585,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); |
| @@ -2731,6 +2746,7 @@ void LCodeGen::DoCmpMapAndBranch(LCmpMapAndBranch* instr) { |
| void LCodeGen::DoInstanceOf(LInstanceOf* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->left()).is(r0)); // Object is in r0. |
| ASSERT(ToRegister(instr->right()).is(r1)); // Function is in r1. |
| @@ -2840,6 +2856,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 r4 as |
| // its slot of the pushing of safepoint registers is used to communicate the |
| @@ -2884,6 +2901,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); |
| @@ -2904,8 +2922,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 r0. |
| + // Runtime::TraceExit returns its parameter in r0. 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(r0); |
| + __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| __ CallRuntime(Runtime::kTraceExit, 1); |
| } |
| if (info()->saves_caller_doubles()) { |
| @@ -2960,6 +2981,7 @@ void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
| void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->global_object()).is(r0)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| @@ -2997,6 +3019,7 @@ void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { |
| void LCodeGen::DoStoreGlobalGeneric(LStoreGlobalGeneric* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->global_object()).is(r1)); |
| ASSERT(ToRegister(instr->value()).is(r0)); |
| @@ -3090,6 +3113,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->object()).is(r0)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| @@ -3383,6 +3407,7 @@ MemOperand LCodeGen::PrepareKeyedOperand(Register key, |
| void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->object()).is(r1)); |
| ASSERT(ToRegister(instr->key()).is(r0)); |
| @@ -3527,7 +3552,6 @@ void LCodeGen::DoApplyArguments(LApplyArguments* instr) { |
| ParameterCount actual(receiver); |
| __ InvokeFunction(function, actual, CALL_FUNCTION, |
| safepoint_generator, CALL_AS_METHOD); |
| - __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| } |
| @@ -3556,11 +3580,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()) { |
| + __ ldr(result, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| + } else { |
| + // If there is no frame, the context must be in cp. |
| + ASSERT(result.is(cp)); |
| } |
| } |
| @@ -3574,6 +3598,7 @@ void LCodeGen::DoOuterContext(LOuterContext* instr) { |
| void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| __ push(cp); // The context is the first argument. |
| __ LoadHeapObject(scratch0(), instr->hydrogen()->pairs()); |
| __ push(scratch0()); |
| @@ -3584,8 +3609,9 @@ void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
| void LCodeGen::DoGlobalObject(LGlobalObject* instr) { |
| + Register context = ToRegister(instr->context()); |
| Register result = ToRegister(instr->result()); |
| - __ ldr(result, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
| + __ ldr(result, ContextOperand(context, Context::GLOBAL_OBJECT_INDEX)); |
| } |
| @@ -3638,9 +3664,6 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
| __ InvokeFunction( |
| function, expected, count, CALL_FUNCTION, generator, call_kind); |
| } |
| - |
| - // Restore context. |
| - __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| } |
| @@ -3656,6 +3679,8 @@ void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) { |
| void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr) { |
| + ASSERT(instr->context() != NULL); |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
|
ulan
2013/09/27 12:08:00
I think we don't need context in cp here since it
vincent.belliard.fr
2013/09/27 12:37:04
It is just to be consistent with LChunkBuilder::Do
|
| Register input = ToRegister(instr->value()); |
| Register result = ToRegister(instr->result()); |
| Register scratch = scratch0(); |
| @@ -3699,7 +3724,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(r0)) __ mov(tmp1, Operand(r0)); |
| // Restore input_reg after call to runtime. |
| @@ -3970,6 +3996,9 @@ void LCodeGen::DoMathExp(LMathExp* instr) { |
| void LCodeGen::DoMathLog(LMathLog* instr) { |
| ASSERT(ToDoubleRegister(instr->result()).is(d2)); |
| + // Set the context register to a GC-safe fake value. Clobbering it is |
| + // OK because this instruction is marked as a call. |
| + __ mov(cp, Operand::Zero()); |
| TranscendentalCacheStub stub(TranscendentalCache::LOG, |
| TranscendentalCacheStub::UNTAGGED); |
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| @@ -3978,6 +4007,9 @@ void LCodeGen::DoMathLog(LMathLog* instr) { |
| void LCodeGen::DoMathTan(LMathTan* instr) { |
| ASSERT(ToDoubleRegister(instr->result()).is(d2)); |
| + // Set the context register to a GC-safe fake value. Clobbering it is |
| + // OK because this instruction is marked as a call. |
| + __ mov(cp, Operand::Zero()); |
| TranscendentalCacheStub stub(TranscendentalCache::TAN, |
| TranscendentalCacheStub::UNTAGGED); |
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| @@ -3986,6 +4018,9 @@ void LCodeGen::DoMathTan(LMathTan* instr) { |
| void LCodeGen::DoMathCos(LMathCos* instr) { |
| ASSERT(ToDoubleRegister(instr->result()).is(d2)); |
| + // Set the context register to a GC-safe fake value. Clobbering it is |
| + // OK because this instruction is marked as a call. |
| + __ mov(cp, Operand::Zero()); |
| TranscendentalCacheStub stub(TranscendentalCache::COS, |
| TranscendentalCacheStub::UNTAGGED); |
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| @@ -3994,6 +4029,9 @@ void LCodeGen::DoMathCos(LMathCos* instr) { |
| void LCodeGen::DoMathSin(LMathSin* instr) { |
| ASSERT(ToDoubleRegister(instr->result()).is(d2)); |
| + // Set the context register to a GC-safe fake value. Clobbering it is |
| + // OK because this instruction is marked as a call. |
| + __ mov(cp, Operand::Zero()); |
| TranscendentalCacheStub stub(TranscendentalCache::SIN, |
| TranscendentalCacheStub::UNTAGGED); |
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| @@ -4001,6 +4039,7 @@ void LCodeGen::DoMathSin(LMathSin* instr) { |
| void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->function()).is(r1)); |
| ASSERT(instr->HasPointerMap()); |
| @@ -4011,7 +4050,6 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
| SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); |
| ParameterCount count(instr->arity()); |
| __ InvokeFunction(r1, count, CALL_FUNCTION, generator, CALL_AS_METHOD); |
| - __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| } else { |
| CallKnownFunction(known_function, |
| instr->hydrogen()->formal_parameter_count(), |
| @@ -4024,17 +4062,18 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
| void LCodeGen::DoCallKeyed(LCallKeyed* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| int arity = instr->arity(); |
| Handle<Code> ic = |
| isolate()->stub_cache()->ComputeKeyedCallInitialize(arity); |
| CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
| - __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| } |
| void LCodeGen::DoCallNamed(LCallNamed* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| int arity = instr->arity(); |
| @@ -4043,23 +4082,22 @@ void LCodeGen::DoCallNamed(LCallNamed* instr) { |
| isolate()->stub_cache()->ComputeCallInitialize(arity, mode); |
| __ mov(r2, Operand(instr->name())); |
| CallCode(ic, mode, instr, NEVER_INLINE_TARGET_ADDRESS); |
| - // Restore context register. |
| - __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| } |
| void LCodeGen::DoCallFunction(LCallFunction* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->function()).is(r1)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| int arity = instr->arity(); |
| CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS); |
| CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
| - __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| } |
| void LCodeGen::DoCallGlobal(LCallGlobal* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| int arity = instr->arity(); |
| @@ -4068,7 +4106,6 @@ void LCodeGen::DoCallGlobal(LCallGlobal* instr) { |
| isolate()->stub_cache()->ComputeCallInitialize(arity, mode); |
| __ mov(r2, Operand(instr->name())); |
| CallCode(ic, mode, instr, NEVER_INLINE_TARGET_ADDRESS); |
| - __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| } |
| @@ -4084,6 +4121,7 @@ void LCodeGen::DoCallKnownGlobal(LCallKnownGlobal* instr) { |
| void LCodeGen::DoCallNew(LCallNew* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->constructor()).is(r1)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| @@ -4097,6 +4135,7 @@ void LCodeGen::DoCallNew(LCallNew* instr) { |
| void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->constructor()).is(r1)); |
| ASSERT(ToRegister(instr->result()).is(r0)); |
| @@ -4248,6 +4287,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
| void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->object()).is(r1)); |
| ASSERT(ToRegister(instr->value()).is(r0)); |
| @@ -4471,6 +4511,7 @@ void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { |
| void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| ASSERT(ToRegister(instr->object()).is(r2)); |
| ASSERT(ToRegister(instr->key()).is(r1)); |
| ASSERT(ToRegister(instr->value()).is(r0)); |
| @@ -4504,6 +4545,7 @@ void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { |
| __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, |
| scratch, GetLinkRegisterState(), kDontSaveFPRegs); |
| } else { |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| PushSafepointRegistersScope scope( |
| this, Safepoint::kWithRegistersAndDoubles); |
| __ Move(r0, object_reg); |
| @@ -4526,6 +4568,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()); |
| @@ -4581,7 +4624,8 @@ void LCodeGen::DoDeferredStringCharCodeAt(LStringCharCodeAt* instr) { |
| __ SmiTag(index); |
| __ push(index); |
| } |
| - CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr); |
| + CallRuntimeFromDeferred(Runtime::kStringCharCodeAt, 2, instr, |
| + instr->context()); |
| __ AssertSmi(r0); |
| __ SmiUntag(r0); |
| __ StoreToSafepointRegisterSlot(r0, result); |
| @@ -4633,7 +4677,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(r0, result); |
| } |
| @@ -4772,7 +4816,15 @@ void LCodeGen::DoDeferredNumberTagI(LInstruction* instr, |
| // integer value. |
| __ mov(ip, Operand::Zero()); |
| __ StoreToSafepointRegisterSlot(ip, 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. |
| + __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| + __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
| + RecordSafepointWithRegisters( |
| + instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
| __ Move(dst, r0); |
| __ sub(dst, dst, Operand(kHeapObjectTag)); |
| @@ -4828,7 +4880,15 @@ void LCodeGen::DoDeferredNumberTagD(LNumberTagD* instr) { |
| __ mov(reg, Operand::Zero()); |
| 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. |
| + __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| + __ CallRuntimeSaveDoubles(Runtime::kAllocateHeapNumber); |
| + RecordSafepointWithRegisters( |
| + instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
| __ sub(r0, r0, Operand(kHeapObjectTag)); |
| __ StoreToSafepointRegisterSlot(r0, reg); |
| } |
| @@ -5157,7 +5217,10 @@ void LCodeGen::DoDeferredInstanceMigration(LCheckMaps* instr, Register object) { |
| { |
| PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
| __ push(object); |
| - CallRuntimeFromDeferred(Runtime::kMigrateInstance, 1, instr); |
| + __ mov(cp, Operand::Zero()); |
| + __ CallRuntimeSaveDoubles(Runtime::kMigrateInstance); |
| + RecordSafepointWithRegisters( |
| + instr->pointer_map(), 1, Safepoint::kNoLazyDeopt); |
| __ StoreToSafepointRegisterSlot(r0, scratch0()); |
| } |
| __ tst(scratch0(), Operand(kSmiTagMask)); |
| @@ -5360,12 +5423,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(r0, result); |
| } |
| @@ -5379,6 +5445,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: |
| // r6 = literals array. |
| @@ -5422,6 +5489,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(); |
| @@ -5616,6 +5684,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); |
| @@ -5649,9 +5718,11 @@ void LCodeGen::DoStackCheck(LStackCheck* instr) { |
| __ cmp(sp, Operand(ip)); |
| __ b(hs, &done); |
| PredictableCodeSizeScope predictable(masm_, 2 * Assembler::kInstrSize); |
| + ASSERT(instr->context()->IsRegister()); |
| + ASSERT(ToRegister(instr->context()).is(cp)); |
| CallCode(isolate()->builtins()->StackCheck(), |
| - RelocInfo::CODE_TARGET, |
| - instr); |
| + RelocInfo::CODE_TARGET, |
| + instr); |
| EnsureSpaceForLazyDeopt(); |
| last_lazy_deopt_pc_ = masm()->pc_offset(); |
| __ bind(&done); |