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

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.cc

Issue 2604833004: [builtins] FastNewFunctionContextStub becomes a builtin (Closed)
Patch Set: That was unnecessary, reverted :) Created 3 years, 11 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
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_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/full-codegen/full-codegen.h"
8 #include "src/ast/compile-time-value.h" 7 #include "src/ast/compile-time-value.h"
9 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/builtins/builtins-constructor.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
11 #include "src/code-stubs.h" 11 #include "src/code-stubs.h"
12 #include "src/codegen.h" 12 #include "src/codegen.h"
13 #include "src/compilation-info.h" 13 #include "src/compilation-info.h"
14 #include "src/compiler.h" 14 #include "src/compiler.h"
15 #include "src/debug/debug.h" 15 #include "src/debug/debug.h"
16 #include "src/full-codegen/full-codegen.h"
16 #include "src/ic/ic.h" 17 #include "src/ic/ic.h"
17 18
18 namespace v8 { 19 namespace v8 {
19 namespace internal { 20 namespace internal {
20 21
21 #define __ ACCESS_MASM(masm()) 22 #define __ ACCESS_MASM(masm())
22 23
23 class JumpPatchSite BASE_EMBEDDED { 24 class JumpPatchSite BASE_EMBEDDED {
24 public: 25 public:
25 explicit JumpPatchSite(MacroAssembler* masm) : masm_(masm) { 26 explicit JumpPatchSite(MacroAssembler* masm) : masm_(masm) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 __ Push(info->scope()->scope_info()); 181 __ Push(info->scope()->scope_info());
181 __ CallRuntime(Runtime::kNewScriptContext); 182 __ CallRuntime(Runtime::kNewScriptContext);
182 PrepareForBailoutForId(BailoutId::ScriptContext(), 183 PrepareForBailoutForId(BailoutId::ScriptContext(),
183 BailoutState::TOS_REGISTER); 184 BailoutState::TOS_REGISTER);
184 // The new target value is not used, clobbering is safe. 185 // The new target value is not used, clobbering is safe.
185 DCHECK_NULL(info->scope()->new_target_var()); 186 DCHECK_NULL(info->scope()->new_target_var());
186 } else { 187 } else {
187 if (info->scope()->new_target_var() != nullptr) { 188 if (info->scope()->new_target_var() != nullptr) {
188 __ Push(rdx); // Preserve new target. 189 __ Push(rdx); // Preserve new target.
189 } 190 }
190 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { 191 if (slots <=
191 FastNewFunctionContextStub stub(isolate(), info->scope()->scope_type()); 192 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) {
193 Callable callable = CodeFactory::FastNewFunctionContext(
194 isolate(), info->scope()->scope_type());
192 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); 195 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots);
193 __ CallStub(&stub); 196 __ Call(callable.code(), RelocInfo::CODE_TARGET);
194 // Result of FastNewFunctionContextStub is always in new space. 197 // Result of the FastNewFunctionContext builtin is always in new space.
195 need_write_barrier = false; 198 need_write_barrier = false;
196 } else { 199 } else {
197 __ Push(rdi); 200 __ Push(rdi);
198 __ Push(Smi::FromInt(info->scope()->scope_type())); 201 __ Push(Smi::FromInt(info->scope()->scope_type()));
199 __ CallRuntime(Runtime::kNewFunctionContext); 202 __ CallRuntime(Runtime::kNewFunctionContext);
200 } 203 }
201 if (info->scope()->new_target_var() != nullptr) { 204 if (info->scope()->new_target_var() != nullptr) {
202 __ Pop(rdx); // Restore new target. 205 __ Pop(rdx); // Restore new target.
203 } 206 }
204 } 207 }
(...skipping 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after
2771 DCHECK_EQ( 2774 DCHECK_EQ(
2772 isolate->builtins()->OnStackReplacement()->entry(), 2775 isolate->builtins()->OnStackReplacement()->entry(),
2773 Assembler::target_address_at(call_target_address, unoptimized_code)); 2776 Assembler::target_address_at(call_target_address, unoptimized_code));
2774 return ON_STACK_REPLACEMENT; 2777 return ON_STACK_REPLACEMENT;
2775 } 2778 }
2776 2779
2777 } // namespace internal 2780 } // namespace internal
2778 } // namespace v8 2781 } // namespace v8
2779 2782
2780 #endif // V8_TARGET_ARCH_X64 2783 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698