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

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

Issue 1237813002: Switch CallConstructStub to take new.target in register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ported to all architectures. 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
Index: src/arm/code-stubs-arm.cc
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc
index 005fb97513d0277325c9ff516612aeb922f1949c..c71a6e3efebfb95188eae188fd514f396a458e0d 100644
--- a/src/arm/code-stubs-arm.cc
+++ b/src/arm/code-stubs-arm.cc
@@ -2607,18 +2607,24 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
// r0 : number of arguments
// r1 : the function to call
// r2 : feedback vector
- // r3 : (only if r2 is not the megamorphic symbol) slot in feedback
- // vector (Smi)
+ // r3 : slot in feedback vector (Smi, for RecordCallTarget)
+ // r4 : original constructor (for IsSuperConstructorCall)
Label slow, non_function_call;
// Check that the function is not a smi.
__ JumpIfSmi(r1, &non_function_call);
// Check that the function is a JSFunction.
- __ CompareObjectType(r1, r4, r4, JS_FUNCTION_TYPE);
+ __ CompareObjectType(r1, r5, r5, JS_FUNCTION_TYPE);
__ b(ne, &slow);
if (RecordCallTarget()) {
+ if (IsSuperConstructorCall()) {
+ __ push(r4);
Michael Starzinger 2015/07/14 15:02:47 Potentially applies to all architectures: Note tha
jbramley 2015/07/14 16:57:35 A TODO is probably a good idea, but it's up to you
Michael Starzinger 2015/07/15 07:36:36 Done. Added a TODO here.
+ }
GenerateRecordCallTarget(masm);
+ if (IsSuperConstructorCall()) {
+ __ pop(r4);
+ }
__ add(r5, r2, Operand::PointerOffsetFromSmiKey(r3));
if (FLAG_pretenuring_call_new) {
@@ -2642,9 +2648,7 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
// Pass function as original constructor.
if (IsSuperConstructorCall()) {
- __ mov(r4, Operand(1 * kPointerSize));
- __ add(r4, r4, Operand(r0, LSL, kPointerSizeLog2));
- __ ldr(r3, MemOperand(sp, r4));
+ __ mov(r3, r4);
} else {
__ mov(r3, r1);
}
@@ -2658,10 +2662,10 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
// r0: number of arguments
// r1: called object
- // r4: object type
+ // r5: object type
Label do_call;
__ bind(&slow);
- __ cmp(r4, Operand(JS_FUNCTION_PROXY_TYPE));
+ __ cmp(r5, Operand(JS_FUNCTION_PROXY_TYPE));
__ b(ne, &non_function_call);
__ GetBuiltinFunction(r1, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR);
__ jmp(&do_call);

Powered by Google App Engine
This is Rietveld 408576698