Commit c4b9d144 authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS: ARM: Load undefined receiver sentinel without constant pool.

Port a820568b

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.

BUG=

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

Cr-Commit-Position: refs/heads/master@{#26995}
parent dbecf20d
......@@ -941,7 +941,9 @@ static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) {
// Push function as parameter to the runtime call.
__ Push(a1, a1);
// Whether to compile in a background thread.
__ Push(masm->isolate()->factory()->ToBoolean(concurrent));
__ LoadRoot(
at, concurrent ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
__ push(at);
__ CallRuntime(Runtime::kCompileOptimized, 2);
// Restore receiver.
......
......@@ -2895,7 +2895,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(at, Heap::kUndefinedValueRootIndex);
__ push(at);
} else {
// Load the function from the receiver.
DCHECK(callee->IsProperty());
......
......@@ -950,7 +950,9 @@ static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) {
// Push function as parameter to the runtime call.
__ Push(a1, a1);
// Whether to compile in a background thread.
__ Push(masm->isolate()->factory()->ToBoolean(concurrent));
__ LoadRoot(
at, concurrent ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
__ push(at);
__ CallRuntime(Runtime::kCompileOptimized, 2);
// Restore receiver.
......
......@@ -2896,7 +2896,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(at, Heap::kUndefinedValueRootIndex);
__ push(at);
} 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