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

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

Issue 1241223003: [arm] Fix pushing of stale register in CallConstructStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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 | « src/arm/code-stubs-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/code-stubs-arm64.cc
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc
index da6bdb75c58fa180dcf5acb069d436ed57ae307e..1703d4bcbf80127d17a094e669316bbfdb1139bb 100644
--- a/src/arm64/code-stubs-arm64.cc
+++ b/src/arm64/code-stubs-arm64.cc
@@ -2749,17 +2749,25 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub,
Register argc, Register function,
Register feedback_vector, Register index,
- Register orig_construct) {
+ Register orig_construct, bool is_super) {
FrameScope scope(masm, StackFrame::INTERNAL);
// Number-of-arguments register must be smi-tagged to call out.
__ SmiTag(argc);
- __ Push(argc, function, feedback_vector, index, orig_construct);
+ if (is_super) {
+ __ Push(argc, function, feedback_vector, index, orig_construct);
jbramley 2015/07/22 07:51:36 Why not pass orig_construct=NoReg for the !is_supe
Michael Starzinger 2015/07/22 08:07:41 The way the 8-register push is implemented, it ass
+ } else {
+ __ Push(argc, function, feedback_vector, index);
+ }
DCHECK(feedback_vector.Is(x2) && index.Is(x3));
__ CallStub(stub);
- __ Pop(orig_construct, index, feedback_vector, function, argc);
+ if (is_super) {
+ __ Pop(orig_construct, index, feedback_vector, function, argc);
+ } else {
+ __ Pop(index, feedback_vector, function, argc);
+ }
__ SmiUntag(argc);
}
@@ -2768,7 +2776,8 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
Register function,
Register feedback_vector, Register index,
Register orig_construct, Register scratch1,
- Register scratch2, Register scratch3) {
+ Register scratch2, Register scratch3,
+ bool is_super) {
ASM_LOCATION("GenerateRecordCallTarget");
DCHECK(!AreAliased(scratch1, scratch2, scratch3, argc, function,
feedback_vector, index, orig_construct));
@@ -2778,7 +2787,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
// function : the function to call
// feedback_vector : the feedback vector
// index : slot in feedback vector (smi)
- // orig_construct : original constructor
+ // orig_construct : original constructor (for IsSuperConstructorCall)
Label initialize, done, miss, megamorphic, not_array_function;
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
@@ -2857,7 +2866,8 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
// slot.
CreateAllocationSiteStub create_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &create_stub, argc, function,
- feedback_vector, index, orig_construct);
+ feedback_vector, index, orig_construct,
+ is_super);
__ B(&done);
__ Bind(&not_array_function);
@@ -2865,7 +2875,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc,
CreateWeakCellStub create_stub(masm->isolate());
CallStubInRecordCallTarget(masm, &create_stub, argc, function,
- feedback_vector, index, orig_construct);
+ feedback_vector, index, orig_construct, is_super);
__ Bind(&done);
}
@@ -3005,7 +3015,8 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
&slow);
if (RecordCallTarget()) {
- GenerateRecordCallTarget(masm, x0, function, x2, x3, x4, x5, x11, x12);
+ GenerateRecordCallTarget(masm, x0, function, x2, x3, x4, x5, x11, x12,
+ IsSuperConstructorCall());
__ Add(x5, x2, Operand::UntagSmiAndScale(x3, kPointerSizeLog2));
if (FLAG_pretenuring_call_new) {
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698