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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
11 // parameter to a function is defined to be 'a0'. So there are many 11 // parameter to a function is defined to be 'a0'. So there are many
12 // places where we have to move a previous result in v0 to a0 for the 12 // places where we have to move a previous result in v0 to a0 for the
13 // next call: mov(a0, v0). This is not needed on the other architectures. 13 // next call: mov(a0, v0). This is not needed on the other architectures.
14 14
15 #include "src/full-codegen/full-codegen.h"
16 #include "src/ast/compile-time-value.h" 15 #include "src/ast/compile-time-value.h"
17 #include "src/ast/scopes.h" 16 #include "src/ast/scopes.h"
17 #include "src/builtins/builtins-constructor.h"
18 #include "src/code-factory.h" 18 #include "src/code-factory.h"
19 #include "src/code-stubs.h" 19 #include "src/code-stubs.h"
20 #include "src/codegen.h" 20 #include "src/codegen.h"
21 #include "src/compilation-info.h" 21 #include "src/compilation-info.h"
22 #include "src/compiler.h" 22 #include "src/compiler.h"
23 #include "src/debug/debug.h" 23 #include "src/debug/debug.h"
24 #include "src/full-codegen/full-codegen.h"
24 #include "src/ic/ic.h" 25 #include "src/ic/ic.h"
25 26
26 #include "src/mips64/code-stubs-mips64.h" 27 #include "src/mips64/code-stubs-mips64.h"
27 #include "src/mips64/macro-assembler-mips64.h" 28 #include "src/mips64/macro-assembler-mips64.h"
28 29
29 namespace v8 { 30 namespace v8 {
30 namespace internal { 31 namespace internal {
31 32
32 #define __ ACCESS_MASM(masm()) 33 #define __ ACCESS_MASM(masm())
33 34
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 __ Push(info->scope()->scope_info()); 201 __ Push(info->scope()->scope_info());
201 __ CallRuntime(Runtime::kNewScriptContext); 202 __ CallRuntime(Runtime::kNewScriptContext);
202 PrepareForBailoutForId(BailoutId::ScriptContext(), 203 PrepareForBailoutForId(BailoutId::ScriptContext(),
203 BailoutState::TOS_REGISTER); 204 BailoutState::TOS_REGISTER);
204 // The new target value is not used, clobbering is safe. 205 // The new target value is not used, clobbering is safe.
205 DCHECK_NULL(info->scope()->new_target_var()); 206 DCHECK_NULL(info->scope()->new_target_var());
206 } else { 207 } else {
207 if (info->scope()->new_target_var() != nullptr) { 208 if (info->scope()->new_target_var() != nullptr) {
208 __ push(a3); // Preserve new target. 209 __ push(a3); // Preserve new target.
209 } 210 }
210 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { 211 if (slots <=
211 FastNewFunctionContextStub stub(isolate(), info->scope()->scope_type()); 212 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) {
213 Callable callable = CodeFactory::FastNewFunctionContext(
214 isolate(), info->scope()->scope_type());
212 __ li(FastNewFunctionContextDescriptor::SlotsRegister(), 215 __ li(FastNewFunctionContextDescriptor::SlotsRegister(),
213 Operand(slots)); 216 Operand(slots));
214 __ CallStub(&stub); 217 __ Call(callable.code(), RelocInfo::CODE_TARGET);
215 // Result of FastNewFunctionContextStub is always in new space. 218 // Result of the FastNewFunctionContext builtin is always in new space.
216 need_write_barrier = false; 219 need_write_barrier = false;
217 } else { 220 } else {
218 __ push(a1); 221 __ push(a1);
219 __ Push(Smi::FromInt(info->scope()->scope_type())); 222 __ Push(Smi::FromInt(info->scope()->scope_type()));
220 __ CallRuntime(Runtime::kNewFunctionContext); 223 __ CallRuntime(Runtime::kNewFunctionContext);
221 } 224 }
222 if (info->scope()->new_target_var() != nullptr) { 225 if (info->scope()->new_target_var() != nullptr) {
223 __ pop(a3); // Restore new target. 226 __ pop(a3); // Restore new target.
224 } 227 }
225 } 228 }
(...skipping 2661 matching lines...) Expand 10 before | Expand all | Expand 10 after
2887 reinterpret_cast<uint64_t>( 2890 reinterpret_cast<uint64_t>(
2888 isolate->builtins()->OnStackReplacement()->entry())); 2891 isolate->builtins()->OnStackReplacement()->entry()));
2889 return ON_STACK_REPLACEMENT; 2892 return ON_STACK_REPLACEMENT;
2890 } 2893 }
2891 2894
2892 2895
2893 } // namespace internal 2896 } // namespace internal
2894 } // namespace v8 2897 } // namespace v8
2895 2898
2896 #endif // V8_TARGET_ARCH_MIPS64 2899 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698