| 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 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1203 | 1203 |
| 1204 | 1204 |
| 1205 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, | 1205 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
| 1206 bool pretenure) { | 1206 bool pretenure) { |
| 1207 // Use the fast case closure allocation code that allocates in new space for | 1207 // Use the fast case closure allocation code that allocates in new space for |
| 1208 // nested functions that don't need literals cloning. If we're running with | 1208 // nested functions that don't need literals cloning. If we're running with |
| 1209 // the --always-opt or the --prepare-always-opt flag, we need to use the | 1209 // the --always-opt or the --prepare-always-opt flag, we need to use the |
| 1210 // runtime function so that the new function we are creating here gets a | 1210 // runtime function so that the new function we are creating here gets a |
| 1211 // chance to have its code optimized and doesn't just get a copy of the | 1211 // chance to have its code optimized and doesn't just get a copy of the |
| 1212 // existing unoptimized code. | 1212 // existing unoptimized code. |
| 1213 if (!FLAG_always_opt && | 1213 if (!FLAG_always_opt && !FLAG_prepare_always_opt && !pretenure && |
| 1214 !FLAG_prepare_always_opt && | 1214 scope()->is_function_scope()) { |
| 1215 !pretenure && | |
| 1216 scope()->is_function_scope() && | |
| 1217 info->num_literals() == 0) { | |
| 1218 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); | 1215 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); |
| 1219 __ Mov(x2, Operand(info)); | 1216 __ Mov(x2, Operand(info)); |
| 1220 __ CallStub(&stub); | 1217 __ CallStub(&stub); |
| 1221 } else { | 1218 } else { |
| 1222 __ Push(info); | 1219 __ Push(info); |
| 1223 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured | 1220 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured |
| 1224 : Runtime::kNewClosure); | 1221 : Runtime::kNewClosure); |
| 1225 } | 1222 } |
| 1226 context()->Plug(x0); | 1223 context()->Plug(x0); |
| 1227 } | 1224 } |
| (...skipping 3637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4865 } | 4862 } |
| 4866 | 4863 |
| 4867 return INTERRUPT; | 4864 return INTERRUPT; |
| 4868 } | 4865 } |
| 4869 | 4866 |
| 4870 | 4867 |
| 4871 } // namespace internal | 4868 } // namespace internal |
| 4872 } // namespace v8 | 4869 } // namespace v8 |
| 4873 | 4870 |
| 4874 #endif // V8_TARGET_ARCH_ARM64 | 4871 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |