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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 1456423003: [runtime] Introduce a proper %NewArray runtime entry. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 7480f9cff143bac2e6a2e7cc648018bc57d6f192..3d955f5f3a9f950dea6295f7448d401c1a452abe 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -4734,28 +4734,33 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
// Subclassing
__ bind(&subclassing);
- __ Pop(rcx); // return address.
- __ Push(rdi);
- __ Push(rdx);
-
- // Adjust argc.
switch (argument_count()) {
case ANY:
- case MORE_THAN_ONE:
- __ addp(rax, Immediate(2));
+ case MORE_THAN_ONE: {
+ StackArgumentsAccessor args(rsp, rax);
+ __ movp(args.GetReceiverOperand(), rdi);
+ __ addp(rax, Immediate(3));
break;
- case NONE:
- __ movp(rax, Immediate(2));
+ }
+ case NONE: {
+ StackArgumentsAccessor args(rsp, 0);
+ __ movp(args.GetReceiverOperand(), rdi);
+ __ Set(rax, 3);
break;
- case ONE:
- __ movp(rax, Immediate(3));
+ }
+ case ONE: {
+ StackArgumentsAccessor args(rsp, 1);
+ __ movp(args.GetReceiverOperand(), rdi);
+ __ Set(rax, 4);
break;
+ }
}
-
- __ Push(rcx);
- __ JumpToExternalReference(
- ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate()),
- 1);
+ __ PopReturnAddressTo(rcx);
+ __ Push(rdx);
+ __ Push(rbx);
+ __ PushReturnAddressFrom(rcx);
+ __ JumpToExternalReference(ExternalReference(Runtime::kNewArray, isolate()),
+ 1);
}
« no previous file with comments | « src/runtime/runtime-array.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698