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

Unified Diff: src/arm64/code-stubs-arm64.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/arm64/code-stubs-arm64.cc
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc
index a3fd1a4ca83088bdec068dd549e02cbcf9430425..1a8cbea5129d0e948b174e7984febb2a2ab35731 100644
--- a/src/arm64/code-stubs-arm64.cc
+++ b/src/arm64/code-stubs-arm64.cc
@@ -5016,12 +5016,11 @@ void ArrayConstructorStub::GenerateDispatchToArrayStub(
void ArrayConstructorStub::Generate(MacroAssembler* masm) {
ASM_LOCATION("ArrayConstructorStub::Generate");
// ----------- S t a t e -------------
- // -- x0 : argc (only if argument_count() == ANY)
+ // -- x0 : argc (only if argument_count() is ANY or MORE_THAN_ONE)
// -- x1 : constructor
// -- x2 : AllocationSite or undefined
// -- x3 : original constructor
- // -- sp[0] : return address
- // -- sp[4] : last argument
+ // -- sp[0] : last argument
// -----------------------------------
Register constructor = x1;
Register allocation_site = x2;
@@ -5065,8 +5064,24 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) {
__ Bind(&no_info);
GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
+ // Subclassing support.
__ Bind(&subclassing);
- __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1);
+ __ Push(constructor, original_constructor);
+ // Adjust argc.
+ switch (argument_count()) {
+ case ANY:
+ case MORE_THAN_ONE:
+ __ add(x0, x0, Operand(2));
+ break;
+ case NONE:
+ __ Mov(x0, Operand(2));
+ break;
+ case ONE:
+ __ Mov(x0, Operand(3));
+ break;
+ }
+ __ JumpToExternalReference(
+ ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate()));
}

Powered by Google App Engine
This is Rietveld 408576698