| 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 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 __ Bind(loop_statement.break_label()); | 1158 __ Bind(loop_statement.break_label()); |
| 1159 DropOperands(5); | 1159 DropOperands(5); |
| 1160 | 1160 |
| 1161 // Exit and decrement the loop depth. | 1161 // Exit and decrement the loop depth. |
| 1162 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); | 1162 PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
| 1163 __ Bind(&exit); | 1163 __ Bind(&exit); |
| 1164 decrement_loop_depth(); | 1164 decrement_loop_depth(); |
| 1165 } | 1165 } |
| 1166 | 1166 |
| 1167 | 1167 |
| 1168 void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, | |
| 1169 bool pretenure) { | |
| 1170 // Use the fast case closure allocation code that allocates in new space for | |
| 1171 // nested functions that don't need literals cloning. If we're running with | |
| 1172 // the --always-opt or the --prepare-always-opt flag, we need to use the | |
| 1173 // runtime function so that the new function we are creating here gets a | |
| 1174 // chance to have its code optimized and doesn't just get a copy of the | |
| 1175 // existing unoptimized code. | |
| 1176 if (!FLAG_always_opt && | |
| 1177 !FLAG_prepare_always_opt && | |
| 1178 !pretenure && | |
| 1179 scope()->is_function_scope() && | |
| 1180 info->num_literals() == 0) { | |
| 1181 FastNewClosureStub stub(isolate(), info->language_mode(), info->kind()); | |
| 1182 __ Mov(x2, Operand(info)); | |
| 1183 __ CallStub(&stub); | |
| 1184 } else { | |
| 1185 __ Push(info); | |
| 1186 __ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured | |
| 1187 : Runtime::kNewClosure); | |
| 1188 } | |
| 1189 context()->Plug(x0); | |
| 1190 } | |
| 1191 | |
| 1192 | |
| 1193 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, | 1168 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, |
| 1194 FeedbackVectorSlot slot) { | 1169 FeedbackVectorSlot slot) { |
| 1195 DCHECK(NeedsHomeObject(initializer)); | 1170 DCHECK(NeedsHomeObject(initializer)); |
| 1196 __ Peek(StoreDescriptor::ReceiverRegister(), 0); | 1171 __ Peek(StoreDescriptor::ReceiverRegister(), 0); |
| 1197 __ Mov(StoreDescriptor::NameRegister(), | 1172 __ Mov(StoreDescriptor::NameRegister(), |
| 1198 Operand(isolate()->factory()->home_object_symbol())); | 1173 Operand(isolate()->factory()->home_object_symbol())); |
| 1199 __ Peek(StoreDescriptor::ValueRegister(), offset * kPointerSize); | 1174 __ Peek(StoreDescriptor::ValueRegister(), offset * kPointerSize); |
| 1200 EmitLoadStoreICSlot(slot); | 1175 EmitLoadStoreICSlot(slot); |
| 1201 CallStoreIC(); | 1176 CallStoreIC(); |
| 1202 } | 1177 } |
| (...skipping 3089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4292 } | 4267 } |
| 4293 | 4268 |
| 4294 return INTERRUPT; | 4269 return INTERRUPT; |
| 4295 } | 4270 } |
| 4296 | 4271 |
| 4297 | 4272 |
| 4298 } // namespace internal | 4273 } // namespace internal |
| 4299 } // namespace v8 | 4274 } // namespace v8 |
| 4300 | 4275 |
| 4301 #endif // V8_TARGET_ARCH_ARM64 | 4276 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |