| OLD | NEW |
| 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1208 | 1208 |
| 1209 | 1209 |
| 1210 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, | 1210 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
| 1211 bool pretenure) { | 1211 bool pretenure) { |
| 1212 // Use the fast case closure allocation code that allocates in new space for | 1212 // Use the fast case closure allocation code that allocates in new space for |
| 1213 // nested functions that don't need literals cloning. If we're running with | 1213 // nested functions that don't need literals cloning. If we're running with |
| 1214 // the --always-opt or the --prepare-always-opt flag, we need to use the | 1214 // the --always-opt or the --prepare-always-opt flag, we need to use the |
| 1215 // runtime function so that the new function we are creating here gets a | 1215 // runtime function so that the new function we are creating here gets a |
| 1216 // chance to have its code optimized and doesn't just get a copy of the | 1216 // chance to have its code optimized and doesn't just get a copy of the |
| 1217 // existing unoptimized code. | 1217 // existing unoptimized code. |
| 1218 if (!FLAG_always_opt && !FLAG_prepare_always_opt && !pretenure && | 1218 if (!FLAG_always_opt && |
| 1219 scope()->is_function_scope()) { | 1219 !FLAG_prepare_always_opt && |
| 1220 !pretenure && |
| 1221 scope()->is_function_scope() && |
| 1222 info->num_literals() == 0) { |
| 1220 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); | 1223 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); |
| 1221 __ Mov(x2, Operand(info)); | 1224 __ Mov(x2, Operand(info)); |
| 1222 __ CallStub(&stub); | 1225 __ CallStub(&stub); |
| 1223 } else { | 1226 } else { |
| 1224 __ Push(info); | 1227 __ Push(info); |
| 1225 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured | 1228 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured |
| 1226 : Runtime::kNewClosure); | 1229 : Runtime::kNewClosure); |
| 1227 } | 1230 } |
| 1228 context()->Plug(x0); | 1231 context()->Plug(x0); |
| 1229 } | 1232 } |
| (...skipping 3596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4826 } | 4829 } |
| 4827 | 4830 |
| 4828 return INTERRUPT; | 4831 return INTERRUPT; |
| 4829 } | 4832 } |
| 4830 | 4833 |
| 4831 | 4834 |
| 4832 } // namespace internal | 4835 } // namespace internal |
| 4833 } // namespace v8 | 4836 } // namespace v8 |
| 4834 | 4837 |
| 4835 #endif // V8_TARGET_ARCH_ARM64 | 4838 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |