Commit a820568b authored by erikcorry's avatar erikcorry Committed by Commit bot

ARM: Load undefined receiver sentinel without constant pool

Each call to emit_32 uses 5 constant pool slots:
* the "emit_32" string
* undefined (the receiver)
* the argument (heap number)
* the load IC
* the call IC

This change cuts that down 20% to 4, by loading the undefined from the heap roots.

R=verwaest@chromium.org
BUG=

Review URL: https://codereview.chromium.org/980563002

Cr-Commit-Position: refs/heads/master@{#26979}
parent 2525e8f4
......@@ -929,7 +929,9 @@ static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) {
// Push function as parameter to the runtime call.
__ Push(r1);
// Whether to compile in a background thread.
__ Push(masm->isolate()->factory()->ToBoolean(concurrent));
__ LoadRoot(
ip, concurrent ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
__ push(ip);
__ CallRuntime(Runtime::kCompileOptimized, 2);
// Restore receiver.
......
......@@ -2913,7 +2913,8 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
}
// Push undefined as receiver. This is patched in the method prologue if it
// is a sloppy mode method.
__ Push(isolate()->factory()->undefined_value());
__ LoadRoot(ip, Heap::kUndefinedValueRootIndex);
__ push(ip);
} else {
// Load the function from the receiver.
DCHECK(callee->IsProperty());
......
......@@ -2603,7 +2603,12 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
}
// Push undefined as receiver. This is patched in the method prologue if it
// is a sloppy mode method.
__ Push(isolate()->factory()->undefined_value());
{
UseScratchRegisterScope temps(masm_);
Register temp = temps.AcquireX();
__ LoadRoot(temp, Heap::kUndefinedValueRootIndex);
__ Push(temp);
}
} else {
// Load the function from the receiver.
DCHECK(callee->IsProperty());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment