Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: src/arm/builtins-arm.cc

Issue 1116943002: Function apply(): make all architectures use an IC for performance. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Oops, fixed arm64 failure to push argument. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/builtins-arm.cc
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
index 532672dea0c9e5dcba50d18ae3afaed1b1d326b0..3dd61b00a4b7e0f57f94e4f5afb58345a0fd1649 100644
--- a/src/arm/builtins-arm.cc
+++ b/src/arm/builtins-arm.cc
@@ -1390,33 +1390,36 @@ static void Generate_PushAppliedArguments(MacroAssembler* masm,
const int indexOffset,
const int limitOffset) {
Label entry, loop;
- __ ldr(r0, MemOperand(fp, indexOffset));
+ Register receiver = LoadDescriptor::ReceiverRegister();
+ Register key = LoadDescriptor::NameRegister();
+
+ __ ldr(key, MemOperand(fp, indexOffset));
__ b(&entry);
- // Load the current argument from the arguments array and push it to the
- // stack.
- // r0: current argument index
+ // Load the current argument from the arguments array.
__ bind(&loop);
- __ ldr(r1, MemOperand(fp, argumentsOffset));
- __ Push(r1, r0);
+ __ ldr(receiver, MemOperand(fp, argumentsOffset));
+
+ // Use inline caching to speed up access to arguments.
+ Handle<Code> ic = masm->isolate()->builtins()->KeyedLoadIC_Megamorphic();
+ __ Call(ic, RelocInfo::CODE_TARGET);
- // Call the runtime to access the property in the arguments array.
- __ CallRuntime(Runtime::kGetProperty, 2);
+ // Push the nth argument.
__ push(r0);
- // Use inline caching to access the arguments.
- __ ldr(r0, MemOperand(fp, indexOffset));
- __ add(r0, r0, Operand(1 << kSmiTagSize));
- __ str(r0, MemOperand(fp, indexOffset));
+ __ ldr(key, MemOperand(fp, indexOffset));
+ __ add(key, key, Operand(1 << kSmiTagSize));
+ __ str(key, MemOperand(fp, indexOffset));
// Test if the copy loop has finished copying all the elements from the
// arguments object.
__ bind(&entry);
__ ldr(r1, MemOperand(fp, limitOffset));
- __ cmp(r0, r1);
+ __ cmp(key, r1);
__ b(ne, &loop);
// On exit, the pushed arguments count is in r0, untagged
+ __ mov(r0, key);
__ SmiUntag(r0);
}
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698