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

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

Issue 2770003002: Set the current context to the function's context when entering to LAP. (Closed)
Patch Set: Attempt to get the context in PropertyHandlerCompiler::GenerateApiAccessorCall (NOT WORKING) Created 3 years, 6 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 | « src/objects.cc ('k') | test/unittests/api/v8-object-unittest.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/api-arguments.h" 7 #include "src/api-arguments.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after
2729 STATIC_ASSERT(FCA::kHolderIndex == 0); 2729 STATIC_ASSERT(FCA::kHolderIndex == 0);
2730 STATIC_ASSERT(FCA::kNewTargetIndex == 7); 2730 STATIC_ASSERT(FCA::kNewTargetIndex == 7);
2731 STATIC_ASSERT(FCA::kArgsLength == 8); 2731 STATIC_ASSERT(FCA::kArgsLength == 8);
2732 2732
2733 __ PopReturnAddressTo(return_address); 2733 __ PopReturnAddressTo(return_address);
2734 2734
2735 // new target 2735 // new target
2736 __ PushRoot(Heap::kUndefinedValueRootIndex); 2736 __ PushRoot(Heap::kUndefinedValueRootIndex);
2737 2737
2738 // context save 2738 // context save
2739 __ Push(context); 2739 __ Push(context);
Toon Verwaest 2017/06/19 08:45:05 This is now the context after loading the LAP cont
Yuki 2017/06/20 14:35:13 Ah, I see. I confirmed that it worked locally. Le
2740 2740
2741 // callee 2741 // callee
2742 __ Push(callee); 2742 __ Push(callee);
2743 2743
2744 // call data 2744 // call data
2745 __ Push(call_data); 2745 __ Push(call_data);
2746 2746
2747 // return value 2747 // return value
2748 __ PushRoot(Heap::kUndefinedValueRootIndex); 2748 __ PushRoot(Heap::kUndefinedValueRootIndex);
2749 // return value default 2749 // return value default
2750 __ PushRoot(Heap::kUndefinedValueRootIndex); 2750 __ PushRoot(Heap::kUndefinedValueRootIndex);
2751 // isolate 2751 // isolate
2752 Register scratch = call_data; 2752 Register scratch = call_data;
2753 __ Move(scratch, ExternalReference::isolate_address(masm->isolate())); 2753 __ Move(scratch, ExternalReference::isolate_address(masm->isolate()));
2754 __ Push(scratch); 2754 __ Push(scratch);
2755 // holder 2755 // holder
2756 __ Push(holder); 2756 __ Push(holder);
2757 2757
2758 #if 0 // TEMPORARILY COMMENTED OUT: MOVED TO
2759 // PropertyHandlerCompiler::GenerateApiAccessorCall
2760 if (this->is_lazy()) {
2761 // load context from holder
2762 __ movp(scratch, FieldOperand(holder, HeapObject::kMapOffset));
2763 __ GetMapConstructor(scratch, scratch, context);
2764 __ movp(context, FieldOperand(scratch, JSFunction::kContextOffset));
2765 } else {
2766 // load context from callee
2767 __ movp(context, FieldOperand(callee, JSFunction::kContextOffset));
2768 }
2769 #endif
2770
2758 __ movp(scratch, rsp); 2771 __ movp(scratch, rsp);
2759 // Push return address back on stack. 2772 // Push return address back on stack.
2760 __ PushReturnAddressFrom(return_address); 2773 __ PushReturnAddressFrom(return_address);
2761 2774
2762 if (!this->is_lazy()) {
2763 // load context from callee
2764 __ movp(context, FieldOperand(callee, JSFunction::kContextOffset));
2765 }
2766
2767 // Allocate the v8::Arguments structure in the arguments' space since 2775 // Allocate the v8::Arguments structure in the arguments' space since
2768 // it's not controlled by GC. 2776 // it's not controlled by GC.
2769 const int kApiStackSpace = 3; 2777 const int kApiStackSpace = 3;
2770 2778
2771 PrepareCallApiFunction(masm, kApiStackSpace); 2779 PrepareCallApiFunction(masm, kApiStackSpace);
2772 2780
2773 // FunctionCallbackInfo::implicit_args_. 2781 // FunctionCallbackInfo::implicit_args_.
2774 int argc = this->argc(); 2782 int argc = this->argc();
2775 __ movp(StackSpaceOperand(0), scratch); 2783 __ movp(StackSpaceOperand(0), scratch);
2776 __ addp(scratch, Immediate((argc + FCA::kArgsLength - 1) * kPointerSize)); 2784 __ addp(scratch, Immediate((argc + FCA::kArgsLength - 1) * kPointerSize));
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2894 kStackUnwindSpace, nullptr, return_value_operand, 2902 kStackUnwindSpace, nullptr, return_value_operand,
2895 NULL); 2903 NULL);
2896 } 2904 }
2897 2905
2898 #undef __ 2906 #undef __
2899 2907
2900 } // namespace internal 2908 } // namespace internal
2901 } // namespace v8 2909 } // namespace v8
2902 2910
2903 #endif // V8_TARGET_ARCH_X64 2911 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/unittests/api/v8-object-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698