| Index: src/full-codegen/arm/full-codegen-arm.cc
|
| diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc
|
| index 177d8486611dda8708b8f88b625013de0d3b813e..475b0ace6eade4d9081ce3bdc1bdba230ff77bfc 100644
|
| --- a/src/full-codegen/arm/full-codegen-arm.cc
|
| +++ b/src/full-codegen/arm/full-codegen-arm.cc
|
| @@ -207,7 +207,7 @@ void FullCodeGenerator::Generate() {
|
| // Load parameter from stack.
|
| __ ldr(r0, MemOperand(fp, parameter_offset));
|
| // Store it in the context.
|
| - MemOperand target = ContextOperand(cp, var->index());
|
| + MemOperand target = ContextMemOperand(cp, var->index());
|
| __ str(r0, target);
|
|
|
| // Update the write barrier.
|
| @@ -710,7 +710,7 @@ MemOperand FullCodeGenerator::VarOperand(Variable* var, Register scratch) {
|
| if (var->IsContextSlot()) {
|
| int context_chain_length = scope()->ContextChainLength(var->scope());
|
| __ LoadContext(scratch, context_chain_length);
|
| - return ContextOperand(scratch, var->index());
|
| + return ContextMemOperand(scratch, var->index());
|
| } else {
|
| return StackOperand(var);
|
| }
|
| @@ -816,7 +816,7 @@ void FullCodeGenerator::VisitVariableDeclaration(
|
| Comment cmnt(masm_, "[ VariableDeclaration");
|
| EmitDebugCheckDeclarationContext(variable);
|
| __ LoadRoot(r0, Heap::kTheHoleValueRootIndex);
|
| - __ str(r0, ContextOperand(cp, variable->index()));
|
| + __ str(r0, ContextMemOperand(cp, variable->index()));
|
| // No write barrier since the_hole_value is in old space.
|
| PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
|
| }
|
| @@ -873,7 +873,7 @@ void FullCodeGenerator::VisitFunctionDeclaration(
|
| Comment cmnt(masm_, "[ FunctionDeclaration");
|
| EmitDebugCheckDeclarationContext(variable);
|
| VisitForAccumulatorValue(declaration->fun());
|
| - __ str(result_register(), ContextOperand(cp, variable->index()));
|
| + __ str(result_register(), ContextMemOperand(cp, variable->index()));
|
| int offset = Context::SlotOffset(variable->index());
|
| // We know that we have written a function, which is not a smi.
|
| __ RecordWriteContextSlot(cp,
|
| @@ -1270,12 +1270,12 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
|
| if (s->num_heap_slots() > 0) {
|
| if (s->calls_sloppy_eval()) {
|
| // Check that extension is NULL.
|
| - __ ldr(temp, ContextOperand(current, Context::EXTENSION_INDEX));
|
| + __ ldr(temp, ContextMemOperand(current, Context::EXTENSION_INDEX));
|
| __ tst(temp, temp);
|
| __ b(ne, slow);
|
| }
|
| // Load next context in chain.
|
| - __ ldr(next, ContextOperand(current, Context::PREVIOUS_INDEX));
|
| + __ ldr(next, ContextMemOperand(current, Context::PREVIOUS_INDEX));
|
| // Walk the rest of the chain without clobbering cp.
|
| current = next;
|
| }
|
| @@ -1297,11 +1297,11 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
|
| __ cmp(temp, ip);
|
| __ b(eq, &fast);
|
| // Check that extension is NULL.
|
| - __ ldr(temp, ContextOperand(next, Context::EXTENSION_INDEX));
|
| + __ ldr(temp, ContextMemOperand(next, Context::EXTENSION_INDEX));
|
| __ tst(temp, temp);
|
| __ b(ne, slow);
|
| // Load next context in chain.
|
| - __ ldr(next, ContextOperand(next, Context::PREVIOUS_INDEX));
|
| + __ ldr(next, ContextMemOperand(next, Context::PREVIOUS_INDEX));
|
| __ b(&loop);
|
| __ bind(&fast);
|
| }
|
| @@ -1323,24 +1323,24 @@ MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
|
| if (s->num_heap_slots() > 0) {
|
| if (s->calls_sloppy_eval()) {
|
| // Check that extension is NULL.
|
| - __ ldr(temp, ContextOperand(context, Context::EXTENSION_INDEX));
|
| + __ ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
|
| __ tst(temp, temp);
|
| __ b(ne, slow);
|
| }
|
| - __ ldr(next, ContextOperand(context, Context::PREVIOUS_INDEX));
|
| + __ ldr(next, ContextMemOperand(context, Context::PREVIOUS_INDEX));
|
| // Walk the rest of the chain without clobbering cp.
|
| context = next;
|
| }
|
| }
|
| // Check that last extension is NULL.
|
| - __ ldr(temp, ContextOperand(context, Context::EXTENSION_INDEX));
|
| + __ ldr(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
|
| __ tst(temp, temp);
|
| __ b(ne, slow);
|
|
|
| // This function is used only for loads, not stores, so it's safe to
|
| // return an cp-based operand (the write barrier cannot be allowed to
|
| // destroy the cp register).
|
| - return ContextOperand(context, var->index());
|
| + return ContextMemOperand(context, var->index());
|
| }
|
|
|
|
|
| @@ -1381,7 +1381,7 @@ void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy,
|
| Variable* var = proxy->var();
|
| DCHECK(var->IsUnallocatedOrGlobalSlot() ||
|
| (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
|
| - __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
|
| + __ LoadGlobalObject(LoadDescriptor::ReceiverRegister());
|
| __ mov(LoadDescriptor::NameRegister(), Operand(var->name()));
|
| __ mov(LoadDescriptor::SlotRegister(),
|
| Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
|
| @@ -2194,9 +2194,7 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
| __ CallRuntime(Runtime::kAllocateInNewSpace, 1);
|
|
|
| __ bind(&done_allocate);
|
| - __ ldr(r1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
|
| - __ ldr(r1, FieldMemOperand(r1, JSGlobalObject::kNativeContextOffset));
|
| - __ ldr(r1, ContextOperand(r1, Context::ITERATOR_RESULT_MAP_INDEX));
|
| + __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r1);
|
| __ pop(r2);
|
| __ LoadRoot(r3,
|
| done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
|
| @@ -2524,7 +2522,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
|
| if (var->IsUnallocated()) {
|
| // Global var, const, or let.
|
| __ mov(StoreDescriptor::NameRegister(), Operand(var->name()));
|
| - __ ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand());
|
| + __ LoadGlobalObject(StoreDescriptor::ReceiverRegister());
|
| EmitLoadStoreICSlot(slot);
|
| CallStoreIC();
|
|
|
| @@ -4118,9 +4116,7 @@ void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
| Label runtime, done;
|
|
|
| __ Allocate(JSIteratorResult::kSize, r0, r2, r3, &runtime, TAG_OBJECT);
|
| - __ ldr(r1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
|
| - __ ldr(r1, FieldMemOperand(r1, JSGlobalObject::kNativeContextOffset));
|
| - __ ldr(r1, ContextOperand(r1, Context::ITERATOR_RESULT_MAP_INDEX));
|
| + __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, r1);
|
| __ pop(r3);
|
| __ pop(r2);
|
| __ LoadRoot(r4, Heap::kEmptyFixedArrayRootIndex);
|
| @@ -4145,9 +4141,7 @@ void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
| __ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
|
| __ push(r0);
|
|
|
| - __ ldr(r0, GlobalObjectOperand());
|
| - __ ldr(r0, FieldMemOperand(r0, JSGlobalObject::kNativeContextOffset));
|
| - __ ldr(r0, ContextOperand(r0, expr->context_index()));
|
| + __ LoadNativeContextSlot(expr->context_index(), r0);
|
| }
|
|
|
|
|
| @@ -4238,7 +4232,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
|
| bool is_this = var->HasThisName(isolate());
|
| DCHECK(is_sloppy(language_mode()) || is_this);
|
| if (var->IsUnallocatedOrGlobalSlot()) {
|
| - __ ldr(r2, GlobalObjectOperand());
|
| + __ LoadGlobalObject(r2);
|
| __ mov(r1, Operand(var->name()));
|
| __ Push(r2, r1);
|
| __ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2);
|
| @@ -4785,7 +4779,7 @@ void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
|
|
|
|
|
| void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
|
| - __ ldr(dst, ContextOperand(cp, context_index));
|
| + __ ldr(dst, ContextMemOperand(cp, context_index));
|
| }
|
|
|
|
|
| @@ -4796,14 +4790,12 @@ void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
|
| // Contexts nested in the native context have a canonical empty function
|
| // as their closure, not the anonymous closure containing the global
|
| // code.
|
| - __ ldr(ip, GlobalObjectOperand());
|
| - __ ldr(ip, FieldMemOperand(ip, JSGlobalObject::kNativeContextOffset));
|
| - __ ldr(ip, ContextOperand(ip, Context::CLOSURE_INDEX));
|
| + __ LoadNativeContextSlot(Context::CLOSURE_INDEX, ip);
|
| } else if (closure_scope->is_eval_scope()) {
|
| // Contexts created by a call to eval have the same closure as the
|
| // context calling eval, not the anonymous closure containing the eval
|
| // code. Fetch it from the context.
|
| - __ ldr(ip, ContextOperand(cp, Context::CLOSURE_INDEX));
|
| + __ ldr(ip, ContextMemOperand(cp, Context::CLOSURE_INDEX));
|
| } else {
|
| DCHECK(closure_scope->is_function_scope());
|
| __ ldr(ip, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
|
|