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

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 2973593002: Revert of Set the current context to the function's context when entering to LAP. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 8
9 #include "src/api-arguments.h" 9 #include "src/api-arguments.h"
10 #include "src/assembler-inl.h" 10 #include "src/assembler-inl.h"
(...skipping 2682 matching lines...) Expand 10 before | Expand all | Expand 10 after
2693 void CallApiCallbackStub::Generate(MacroAssembler* masm) { 2693 void CallApiCallbackStub::Generate(MacroAssembler* masm) {
2694 // ----------- S t a t e ------------- 2694 // ----------- S t a t e -------------
2695 // -- r0 : callee 2695 // -- r0 : callee
2696 // -- r4 : call_data 2696 // -- r4 : call_data
2697 // -- r2 : holder 2697 // -- r2 : holder
2698 // -- r1 : api_function_address 2698 // -- r1 : api_function_address
2699 // -- cp : context 2699 // -- cp : context
2700 // -- 2700 // --
2701 // -- sp[0] : last argument 2701 // -- sp[0] : last argument
2702 // -- ... 2702 // -- ...
2703 // -- sp[(argc - 1) * 4] : first argument 2703 // -- sp[(argc - 1)* 4] : first argument
2704 // -- sp[argc * 4] : receiver 2704 // -- sp[argc * 4] : receiver
2705 // -- sp[(argc + 1) * 4] : accessor_holder
2706 // ----------------------------------- 2705 // -----------------------------------
2707 2706
2708 Register callee = r0; 2707 Register callee = r0;
2709 Register call_data = r4; 2708 Register call_data = r4;
2710 Register holder = r2; 2709 Register holder = r2;
2711 Register api_function_address = r1; 2710 Register api_function_address = r1;
2712 Register context = cp; 2711 Register context = cp;
2713 2712
2714 typedef FunctionCallbackArguments FCA; 2713 typedef FunctionCallbackArguments FCA;
2715 2714
2716 STATIC_ASSERT(FCA::kContextSaveIndex == 6); 2715 STATIC_ASSERT(FCA::kContextSaveIndex == 6);
2717 STATIC_ASSERT(FCA::kCalleeIndex == 5); 2716 STATIC_ASSERT(FCA::kCalleeIndex == 5);
2718 STATIC_ASSERT(FCA::kDataIndex == 4); 2717 STATIC_ASSERT(FCA::kDataIndex == 4);
2719 STATIC_ASSERT(FCA::kReturnValueOffset == 3); 2718 STATIC_ASSERT(FCA::kReturnValueOffset == 3);
2720 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2); 2719 STATIC_ASSERT(FCA::kReturnValueDefaultValueIndex == 2);
2721 STATIC_ASSERT(FCA::kIsolateIndex == 1); 2720 STATIC_ASSERT(FCA::kIsolateIndex == 1);
2722 STATIC_ASSERT(FCA::kHolderIndex == 0); 2721 STATIC_ASSERT(FCA::kHolderIndex == 0);
2723 STATIC_ASSERT(FCA::kNewTargetIndex == 7); 2722 STATIC_ASSERT(FCA::kNewTargetIndex == 7);
2724 STATIC_ASSERT(FCA::kArgsLength == 8); 2723 STATIC_ASSERT(FCA::kArgsLength == 8);
2725 2724
2726 // new target 2725 // new target
2727 __ PushRoot(Heap::kUndefinedValueRootIndex); 2726 __ PushRoot(Heap::kUndefinedValueRootIndex);
2728 2727
2729 // context save 2728 // context save
2730 __ push(context); 2729 __ push(context);
2730 if (!is_lazy()) {
2731 // load context from callee
2732 __ ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset));
2733 }
2731 2734
2732 // callee 2735 // callee
2733 __ push(callee); 2736 __ push(callee);
2734 2737
2735 // call data 2738 // call data
2736 __ push(call_data); 2739 __ push(call_data);
2737 2740
2738 Register scratch = call_data; 2741 Register scratch = call_data;
2739 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex); 2742 __ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
2740 // return value 2743 // return value
2741 __ push(scratch); 2744 __ push(scratch);
2742 // return value default 2745 // return value default
2743 __ push(scratch); 2746 __ push(scratch);
2744 // isolate 2747 // isolate
2745 __ mov(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); 2748 __ mov(scratch, Operand(ExternalReference::isolate_address(masm->isolate())));
2746 __ push(scratch); 2749 __ push(scratch);
2747 // holder 2750 // holder
2748 __ push(holder); 2751 __ push(holder);
2749 2752
2750 // enter a new context
2751 if (is_lazy()) {
2752 // load context from accessor_holder
2753 Register accessor_holder = context;
2754 __ ldr(accessor_holder,
2755 MemOperand(sp, (FCA::kArgsLength + 1 + argc()) * kPointerSize));
2756 __ ldr(scratch, FieldMemOperand(accessor_holder, HeapObject::kMapOffset));
2757 __ GetMapConstructor(scratch, scratch, context, callee);
2758 __ ldr(context, FieldMemOperand(scratch, JSFunction::kContextOffset));
2759 } else {
2760 // load context from callee
2761 __ ldr(context, FieldMemOperand(callee, JSFunction::kContextOffset));
2762 }
2763
2764 // Prepare arguments. 2753 // Prepare arguments.
2765 __ mov(scratch, sp); 2754 __ mov(scratch, sp);
2766 2755
2767 // Allocate the v8::Arguments structure in the arguments' space since 2756 // Allocate the v8::Arguments structure in the arguments' space since
2768 // it's not controlled by GC. 2757 // it's not controlled by GC.
2769 const int kApiStackSpace = 3; 2758 const int kApiStackSpace = 3;
2770 2759
2771 FrameScope frame_scope(masm, StackFrame::MANUAL); 2760 FrameScope frame_scope(masm, StackFrame::MANUAL);
2772 __ EnterExitFrame(false, kApiStackSpace); 2761 __ EnterExitFrame(false, kApiStackSpace);
2773 2762
(...skipping 17 matching lines...) Expand all
2791 MemOperand context_restore_operand( 2780 MemOperand context_restore_operand(
2792 fp, (2 + FCA::kContextSaveIndex) * kPointerSize); 2781 fp, (2 + FCA::kContextSaveIndex) * kPointerSize);
2793 // Stores return the first js argument 2782 // Stores return the first js argument
2794 int return_value_offset = 0; 2783 int return_value_offset = 0;
2795 if (is_store()) { 2784 if (is_store()) {
2796 return_value_offset = 2 + FCA::kArgsLength; 2785 return_value_offset = 2 + FCA::kArgsLength;
2797 } else { 2786 } else {
2798 return_value_offset = 2 + FCA::kReturnValueOffset; 2787 return_value_offset = 2 + FCA::kReturnValueOffset;
2799 } 2788 }
2800 MemOperand return_value_operand(fp, return_value_offset * kPointerSize); 2789 MemOperand return_value_operand(fp, return_value_offset * kPointerSize);
2801 const int stack_space = argc() + FCA::kArgsLength + 2; 2790 int stack_space = 0;
2802 MemOperand* stack_space_operand = nullptr; 2791 MemOperand length_operand = MemOperand(sp, 3 * kPointerSize);
2792 MemOperand* stack_space_operand = &length_operand;
2793 stack_space = argc() + FCA::kArgsLength + 1;
2794 stack_space_operand = NULL;
2803 2795
2804 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space, 2796 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, stack_space,
2805 stack_space_operand, return_value_operand, 2797 stack_space_operand, return_value_operand,
2806 &context_restore_operand); 2798 &context_restore_operand);
2807 } 2799 }
2808 2800
2809 2801
2810 void CallApiGetterStub::Generate(MacroAssembler* masm) { 2802 void CallApiGetterStub::Generate(MacroAssembler* masm) {
2811 // Build v8::PropertyCallbackInfo::args_ array on the stack and push property 2803 // Build v8::PropertyCallbackInfo::args_ array on the stack and push property
2812 // name below the exit frame to make GC aware of them. 2804 // name below the exit frame to make GC aware of them.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2867 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 2859 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
2868 kStackUnwindSpace, NULL, return_value_operand, NULL); 2860 kStackUnwindSpace, NULL, return_value_operand, NULL);
2869 } 2861 }
2870 2862
2871 #undef __ 2863 #undef __
2872 2864
2873 } // namespace internal 2865 } // namespace internal
2874 } // namespace v8 2866 } // namespace v8
2875 2867
2876 #endif // V8_TARGET_ARCH_ARM 2868 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/code-stubs-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698