Runtime::FunctionId function_id) {
FrameScope scope(masm, StackFrame::INTERNAL);
// Push a copy of the function onto the stack.
- __ push(a1);
- // Push call kind information.
- __ push(t1);
- // Function is also the parameter to the runtime call.
- __ push(a1);
+ // Push call kind information and function as parameter to the runtime call.
+ __ Push(a1, t1, a1);
__ CallRuntime(function_id, 1);
- // Restore call kind information.
- __ pop(t1);
- // Restore receiver.
- __ pop(a1);
+ // Restore call kind information and receiver.
+ __ Pop(a1, t1);
}
__ sb(t0, constructor_count);
__ Branch(&allocate, ne, t0, Operand(zero_reg));
- __ Push(a1, a2);
-
- __ push(a1); // Constructor.
+ __ Push(a1, a2, a1); // a1 = Constructor.
// The call will replace the stub, so the countdown is only done once.
__ CallRuntime(Runtime::kFinalizeInstanceSize, 1);
- __ pop(a2);
- __ pop(a1);
+ __ Pop(a1, a2);
__ bind(&allocate);
}
// Out of stack space.
__ lw(a1, MemOperand(fp, kFunctionOffset));
- __ push(a1);
- __ push(v0);
+ __ Push(a1, v0);
__ InvokeBuiltin(Builtins::APPLY_OVERFLOW, CALL_FUNCTION);
// End of stack check.
// a0: current argument index
__ bind(&loop);
__ lw(a1, MemOperand(fp, kArgsOffset));
- __ push(a1);
- __ push(a0);
+ __ Push(a1, a0);
// Call the runtime to access the property in the arguments array.
__ CallRuntime(Runtime::kGetProperty, 2);
Label done;
__ bind(materialize_true);
__ LoadRoot(at, Heap::kTrueValueRootIndex);
- __ push(at);
__ Branch(&done);
__ bind(materialize_false);
__ LoadRoot(at, Heap::kFalseValueRootIndex);
- __ push(at);
__ bind(&done);
+ __ push(at);
}
__ jmp(&allocated);
__ bind(&runtime_allocate);
- __ push(t1);
__ li(a0, Operand(Smi::FromInt(size)));
- __ push(a0);
+ __ Push(t1, a0);
__ CallRuntime(Runtime::kAllocateInNewSpace, 1);
__ pop(t1);
handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
__ LoadRoot(a2, Heap::kthrow_stringRootIndex); // "throw"
__ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter
- __ push(a3); // iter
- __ push(a0); // exception
+ __ Push(a3, a0); // iter, exception
__ jmp(&l_call);
// try { received = %yield result }
__ bind(&l_next);
__ LoadRoot(a2, Heap::knext_stringRootIndex); // "next"
__ lw(a3, MemOperand(sp, 1 * kPointerSize)); // iter
- __ push(a3); // iter
- __ push(a0); // received
+ __ Push(a3, a0); // iter, received
// result = receiver[f](arg);
__ bind(&l_call);
__ Call(&resume_frame);
__ jmp(&done);
__ bind(&resume_frame);
- __ push(ra); // Return address.
- __ push(fp); // Caller's frame pointer.
- __ mov(fp, sp);
- __ push(cp); // Callee's context.
- __ push(t0); // Callee's JS Function.
+ // ra = return address.
+ // fp = caller's frame pointer.
+ // cp = callee's context,
+ // t0 = callee's JS function.
+ __ Push(ra, fp, cp, t0);
+ // Adjust FP to point to saved FP.
+ __ Addu(fp, sp, 2 * kPointerSize);
// Load the operand stack size.
__ lw(a3, FieldMemOperand(a1, JSGeneratorObject::kOperandStackOffset));
__ push(a2);
__ Branch(&push_operand_holes);
__ bind(&call_resume);
- __ push(a1);
- __ push(result_register());
+ ASSERT(!result_register().is(a1));
+ __ Push(a1, result_register());
__ Push(Smi::FromInt(resume_mode));
__ CallRuntime(Runtime::kResumeJSGeneratorObject, 3);
// Not reached: the runtime call returns elsewhere.
VisitForStackValue(prop->obj());
VisitForAccumulatorValue(prop->key());
__ mov(a1, result_register());
- __ pop(a2);
- __ pop(a0); // Restore value.
+ __ Pop(a0, a2); // a0 = restored value.
Handle<Code> ic = is_classic_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
// - a1 is the key,
// - a2 is the receiver.
__ mov(a0, result_register());
- __ pop(a1); // Key.
- __ pop(a2);
+ __ Pop(a2, a1); // a1 = key.
Handle<Code> ic = is_classic_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize()
void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) {
- // Push copy of the first argument or undefined if it doesn't exist.
+ // t2: copy of the first argument or undefined if it doesn't exist.
if (arg_count > 0) {
- __ lw(a1, MemOperand(sp, arg_count * kPointerSize));
+ __ lw(t2, MemOperand(sp, arg_count * kPointerSize));
} else {
- __ LoadRoot(a1, Heap::kUndefinedValueRootIndex);
+ __ LoadRoot(t2, Heap::kUndefinedValueRootIndex);
}
- __ push(a1);
- // Push the receiver of the enclosing function.
+ // t1: the receiver of the enclosing function.
int receiver_offset = 2 + info_->scope()->num_parameters();
- __ lw(a1, MemOperand(fp, receiver_offset * kPointerSize));
- __ push(a1);
- // Push the language mode.
- __ li(a1, Operand(Smi::FromInt(language_mode())));
- __ push(a1);
+ __ lw(t1, MemOperand(fp, receiver_offset * kPointerSize));
+
+ // t0: the language mode.
+ __ li(t0, Operand(Smi::FromInt(language_mode())));
- // Push the start position of the scope the calls resides in.
+ // a1: the start position of the scope the calls resides in.
__ li(a1, Operand(Smi::FromInt(scope()->start_position())));
- __ push(a1);
// Do the runtime call.
+ __ Push(t2, t1, t0, a1);
__ CallRuntime(Runtime::kResolvePossiblyDirectEval, 5);
}
__ bind(&slow);
// Call the runtime to find the function to call (returned in v0)
// and the object holding it (returned in v1).
- __ push(context_register());
+ ASSERT(!context_register().is(a2));
__ li(a2, Operand(proxy->name()));
- __ push(a2);
+ __ Push(context_register(), a2);
__ CallRuntime(Runtime::kLoadContextSlot, 2);
__ Push(v0, v1); // Function, receiver.
VisitForStackValue(args->at(1)); // index
VisitForStackValue(args->at(2)); // value
- __ pop(value);
- __ pop(index);
+ __ Pop(index, value);
VisitForAccumulatorValue(args->at(0)); // string
if (FLAG_debug_code) {
VisitForStackValue(args->at(1)); // index
VisitForStackValue(args->at(2)); // value
- __ pop(value);
- __ pop(index);
+ __ Pop(index, value);
VisitForAccumulatorValue(args->at(0)); // string
if (FLAG_debug_code) {
} else {
// Non-global variable. Call the runtime to try to delete from the
// context where the variable was introduced.
- __ push(context_register());
+ ASSERT(!context_register().is(a2));
__ li(a2, Operand(var->name()));
- __ push(a2);
+ __ Push(context_register(), a2);
__ CallRuntime(Runtime::kDeleteContextSlot, 2);
context()->Plug(v0);
}
}
case KEYED_PROPERTY: {
__ mov(a0, result_register()); // Value.
- __ pop(a1); // Key.
- __ pop(a2); // Receiver.
+ __ Pop(a2, a1); // a1 = key, a2 = receiver.
Handle<Code> ic = is_classic_mode()
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();