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

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

Issue 975463002: Implement subclassing Arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm again Created 5 years, 10 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
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index cc9271452262c1a203fd61e9c4c322be56ff5073..dd79a4e1a2dda437504dfc48a61ca6180c0d7366 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -4636,8 +4636,30 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
__ bind(&no_info);
GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
+ // Subclassing
__ bind(&subclassing);
- __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1);
+ __ Pop(rcx); // return address.
+ __ Push(rdi);
+ __ Push(rdx);
+
+ // Adjust argc.
+ switch (argument_count()) {
+ case ANY:
+ case MORE_THAN_ONE:
+ __ addp(rax, Immediate(2));
+ break;
+ case NONE:
+ __ movp(rax, Immediate(2));
+ break;
+ case ONE:
+ __ movp(rax, Immediate(3));
+ break;
+ }
+
+ __ Push(rcx);
+ __ JumpToExternalReference(
+ ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate()),
+ 1);
}

Powered by Google App Engine
This is Rietveld 408576698