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

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: Made the unittest a little milder (not test a corner case). 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 2737 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (this->is_lazy()) {
jochen (gone - plz use gerrit) 2017/06/14 09:26:01 maybe we can just enter the correct context before
Yuki 2017/06/14 13:34:52 I gave it a shot in PS8, but I failed so far. Cou
2759 // load context from holder
2760 __ movp(scratch, FieldOperand(holder, HeapObject::kMapOffset));
2761 __ GetMapConstructor(scratch, scratch, context);
2762 __ movp(context, FieldOperand(scratch, JSFunction::kContextOffset));
2763 } else {
2764 // load context from callee
2765 __ movp(context, FieldOperand(callee, JSFunction::kContextOffset));
2766 }
2767
2758 __ movp(scratch, rsp); 2768 __ movp(scratch, rsp);
2759 // Push return address back on stack. 2769 // Push return address back on stack.
2760 __ PushReturnAddressFrom(return_address); 2770 __ PushReturnAddressFrom(return_address);
2761 2771
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 2772 // Allocate the v8::Arguments structure in the arguments' space since
2768 // it's not controlled by GC. 2773 // it's not controlled by GC.
2769 const int kApiStackSpace = 3; 2774 const int kApiStackSpace = 3;
2770 2775
2771 PrepareCallApiFunction(masm, kApiStackSpace); 2776 PrepareCallApiFunction(masm, kApiStackSpace);
2772 2777
2773 // FunctionCallbackInfo::implicit_args_. 2778 // FunctionCallbackInfo::implicit_args_.
2774 int argc = this->argc(); 2779 int argc = this->argc();
2775 __ movp(StackSpaceOperand(0), scratch); 2780 __ movp(StackSpaceOperand(0), scratch);
2776 __ addp(scratch, Immediate((argc + FCA::kArgsLength - 1) * kPointerSize)); 2781 __ 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, 2899 kStackUnwindSpace, nullptr, return_value_operand,
2895 NULL); 2900 NULL);
2896 } 2901 }
2897 2902
2898 #undef __ 2903 #undef __
2899 2904
2900 } // namespace internal 2905 } // namespace internal
2901 } // namespace v8 2906 } // namespace v8
2902 2907
2903 #endif // V8_TARGET_ARCH_X64 2908 #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