Reviewers: Toon Verwaest,
Message:
PTAL
Description:
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.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/980563002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+11, -3 lines):
M src/arm/builtins-arm.cc
M src/arm/full-codegen-arm.cc
M src/arm64/full-codegen-arm64.cc
Index: src/arm/builtins-arm.cc
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
index
ba92ff8e34f326c483d710f4d6f16482e343e746..88f1a7526ee624e0b4bccc2baae97689c9c08c15
100644
--- a/src/arm/builtins-arm.cc
+++ b/src/arm/builtins-arm.cc
@@ -928,7 +928,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.
Index: src/arm/full-codegen-arm.cc
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
index
15958ccf54561149055489f32188e1530473fb81..6142f3a846cdf0b25350742e03031af659750491
100644
--- a/src/arm/full-codegen-arm.cc
+++ b/src/arm/full-codegen-arm.cc
@@ -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());
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc
b/src/arm64/full-codegen-arm64.cc
index
265f75f97c4fd994e0f00373c5d21d89d9417105..c3b979d80d603b484ca43deb2217c2788f6cd5f8
100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -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());
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.