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

Side by Side Diff: src/ppc/builtins-ppc.cc

Issue 1455563005: PPC: Handle StepIn for constructors through PrepareStep just like for regular calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@patch3
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 unified diff | Download patch
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_PPC 5 #if V8_TARGET_ARCH_PPC
6 6
7 #include "src/codegen.h" 7 #include "src/codegen.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/full-codegen/full-codegen.h" 10 #include "src/full-codegen/full-codegen.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 // Preserve the incoming parameters on the stack. 369 // Preserve the incoming parameters on the stack.
370 __ AssertUndefinedOrAllocationSite(r5, r7); 370 __ AssertUndefinedOrAllocationSite(r5, r7);
371 __ SmiTag(r3); 371 __ SmiTag(r3);
372 __ Push(r5, r3, r4, r6); 372 __ Push(r5, r3, r4, r6);
373 373
374 // Try to allocate the object without transitioning into C code. If any of 374 // Try to allocate the object without transitioning into C code. If any of
375 // the preconditions is not met, the code bails out to the runtime call. 375 // the preconditions is not met, the code bails out to the runtime call.
376 Label rt_call, allocated; 376 Label rt_call, allocated;
377 if (FLAG_inline_new) { 377 if (FLAG_inline_new) {
378 ExternalReference debug_step_in_fp =
379 ExternalReference::debug_step_in_fp_address(isolate);
380 __ mov(r5, Operand(debug_step_in_fp));
381 __ LoadP(r5, MemOperand(r5));
382 __ cmpi(r5, Operand::Zero());
383 __ bne(&rt_call);
384
385 // Verify that the new target is a JSFunction. 378 // Verify that the new target is a JSFunction.
386 __ CompareObjectType(r6, r8, r7, JS_FUNCTION_TYPE); 379 __ CompareObjectType(r6, r8, r7, JS_FUNCTION_TYPE);
387 __ bne(&rt_call); 380 __ bne(&rt_call);
388 381
389 // Load the initial map and verify that it is in fact a map. 382 // Load the initial map and verify that it is in fact a map.
390 // r6: new target 383 // r6: new target
391 __ LoadP(r5, 384 __ LoadP(r5,
392 FieldMemOperand(r6, JSFunction::kPrototypeOrInitialMapOffset)); 385 FieldMemOperand(r6, JSFunction::kPrototypeOrInitialMapOffset));
393 __ JumpIfSmi(r5, &rt_call); 386 __ JumpIfSmi(r5, &rt_call);
394 __ CompareObjectType(r5, r8, r7, MAP_TYPE); 387 __ CompareObjectType(r5, r8, r7, MAP_TYPE);
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 __ beq(&no_args, cr0); 670 __ beq(&no_args, cr0);
678 __ ShiftLeftImm(ip, r3, Operand(kPointerSizeLog2)); 671 __ ShiftLeftImm(ip, r3, Operand(kPointerSizeLog2));
679 __ mtctr(r3); 672 __ mtctr(r3);
680 __ bind(&loop); 673 __ bind(&loop);
681 __ subi(ip, ip, Operand(kPointerSize)); 674 __ subi(ip, ip, Operand(kPointerSize));
682 __ LoadPX(r0, MemOperand(r5, ip)); 675 __ LoadPX(r0, MemOperand(r5, ip));
683 __ push(r0); 676 __ push(r0);
684 __ bdnz(&loop); 677 __ bdnz(&loop);
685 __ bind(&no_args); 678 __ bind(&no_args);
686 679
687 // Handle step in.
688 Label skip_step_in;
689 ExternalReference debug_step_in_fp =
690 ExternalReference::debug_step_in_fp_address(masm->isolate());
691 __ mov(r5, Operand(debug_step_in_fp));
692 __ LoadP(r5, MemOperand(r5));
693 __ and_(r0, r5, r5, SetRC);
694 __ beq(&skip_step_in, cr0);
695
696 __ Push(r3, r4, r4);
697 __ CallRuntime(Runtime::kHandleStepInForDerivedConstructors, 1);
698 __ Pop(r3, r4);
699
700 __ bind(&skip_step_in);
701
702 // Call the function. 680 // Call the function.
703 // r3: number of arguments 681 // r3: number of arguments
704 // r4: constructor function 682 // r4: constructor function
705 ParameterCount actual(r3); 683 ParameterCount actual(r3);
706 __ InvokeFunction(r4, actual, CALL_FUNCTION, NullCallWrapper()); 684 __ InvokeFunction(r4, actual, CALL_FUNCTION, NullCallWrapper());
707 685
708 // Restore context from the frame. 686 // Restore context from the frame.
709 // r3: result 687 // r3: result
710 // sp[0]: number of arguments (smi-tagged) 688 // sp[0]: number of arguments (smi-tagged)
711 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); 689 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset));
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1963 __ bkpt(0); 1941 __ bkpt(0);
1964 } 1942 }
1965 } 1943 }
1966 1944
1967 1945
1968 #undef __ 1946 #undef __
1969 } // namespace internal 1947 } // namespace internal
1970 } // namespace v8 1948 } // namespace v8
1971 1949
1972 #endif // V8_TARGET_ARCH_PPC 1950 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « src/full-codegen/ppc/full-codegen-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698