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

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

Issue 2603313002: X87: [builtins] FastNewFunctionContextStub becomes a builtin. (Closed)
Patch Set: 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
« no previous file with comments | « src/crankshaft/x87/lithium-codegen-x87.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 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_X87 5 #if V8_TARGET_ARCH_X87
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 #include "src/x87/frames-x87.h" 18 #include "src/x87/frames-x87.h"
18 19
19 namespace v8 { 20 namespace v8 {
20 namespace internal { 21 namespace internal {
21 22
22 #define __ ACCESS_MASM(masm()) 23 #define __ ACCESS_MASM(masm())
23 24
24 class JumpPatchSite BASE_EMBEDDED { 25 class JumpPatchSite BASE_EMBEDDED {
25 public: 26 public:
(...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(edx); // Preserve new target. 189 __ push(edx); // 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 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), 195 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
193 Immediate(slots)); 196 Immediate(slots));
194 __ CallStub(&stub); 197 __ Call(callable.code(), RelocInfo::CODE_TARGET);
195 // Result of FastNewFunctionContextStub is always in new space. 198 // Result of the FastNewFunctionContext builtin is always in new space.
196 need_write_barrier = false; 199 need_write_barrier = false;
197 } else { 200 } else {
198 __ push(edi); 201 __ push(edi);
199 __ Push(Smi::FromInt(info->scope()->scope_type())); 202 __ Push(Smi::FromInt(info->scope()->scope_type()));
200 __ CallRuntime(Runtime::kNewFunctionContext); 203 __ CallRuntime(Runtime::kNewFunctionContext);
201 } 204 }
202 if (info->scope()->new_target_var() != nullptr) { 205 if (info->scope()->new_target_var() != nullptr) {
203 __ pop(edx); // Restore new target. 206 __ pop(edx); // Restore new target.
204 } 207 }
205 } 208 }
(...skipping 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after
2781 isolate->builtins()->OnStackReplacement()->entry(), 2784 isolate->builtins()->OnStackReplacement()->entry(),
2782 Assembler::target_address_at(call_target_address, unoptimized_code)); 2785 Assembler::target_address_at(call_target_address, unoptimized_code));
2783 return ON_STACK_REPLACEMENT; 2786 return ON_STACK_REPLACEMENT;
2784 } 2787 }
2785 2788
2786 2789
2787 } // namespace internal 2790 } // namespace internal
2788 } // namespace v8 2791 } // namespace v8
2789 2792
2790 #endif // V8_TARGET_ARCH_X87 2793 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/crankshaft/x87/lithium-codegen-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698