| 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/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
| (...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 __ B(done); | 1370 __ B(done); |
| 1371 } | 1371 } |
| 1372 } | 1372 } |
| 1373 | 1373 |
| 1374 | 1374 |
| 1375 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, | 1375 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, |
| 1376 TypeofMode typeof_mode) { | 1376 TypeofMode typeof_mode) { |
| 1377 Variable* var = proxy->var(); | 1377 Variable* var = proxy->var(); |
| 1378 DCHECK(var->IsUnallocatedOrGlobalSlot() || | 1378 DCHECK(var->IsUnallocatedOrGlobalSlot() || |
| 1379 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); | 1379 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); |
| 1380 if (var->IsGlobalSlot()) { | 1380 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); |
| 1381 DCHECK(var->index() > 0); | 1381 __ Mov(LoadDescriptor::NameRegister(), Operand(var->name())); |
| 1382 DCHECK(var->IsStaticGlobalObjectProperty()); | 1382 __ Mov(LoadDescriptor::SlotRegister(), |
| 1383 int const slot = var->index(); | 1383 SmiFromSlot(proxy->VariableFeedbackSlot())); |
| 1384 int const depth = scope()->ContextChainLength(var->scope()); | 1384 CallLoadIC(typeof_mode); |
| 1385 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | |
| 1386 __ Mov(LoadGlobalViaContextDescriptor::SlotRegister(), slot); | |
| 1387 LoadGlobalViaContextStub stub(isolate(), depth); | |
| 1388 __ CallStub(&stub); | |
| 1389 } else { | |
| 1390 __ Push(Smi::FromInt(slot)); | |
| 1391 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); | |
| 1392 } | |
| 1393 } else { | |
| 1394 __ Ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); | |
| 1395 __ Mov(LoadDescriptor::NameRegister(), Operand(var->name())); | |
| 1396 __ Mov(LoadDescriptor::SlotRegister(), | |
| 1397 SmiFromSlot(proxy->VariableFeedbackSlot())); | |
| 1398 CallLoadIC(typeof_mode); | |
| 1399 } | |
| 1400 } | 1385 } |
| 1401 | 1386 |
| 1402 | 1387 |
| 1403 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, | 1388 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
| 1404 TypeofMode typeof_mode) { | 1389 TypeofMode typeof_mode) { |
| 1405 // Record position before possible IC call. | 1390 // Record position before possible IC call. |
| 1406 SetExpressionPosition(proxy); | 1391 SetExpressionPosition(proxy); |
| 1407 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); | 1392 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); |
| 1408 Variable* var = proxy->var(); | 1393 Variable* var = proxy->var(); |
| 1409 | 1394 |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2308 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, | 2293 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
| 2309 FeedbackVectorSlot slot) { | 2294 FeedbackVectorSlot slot) { |
| 2310 ASM_LOCATION("FullCodeGenerator::EmitVariableAssignment"); | 2295 ASM_LOCATION("FullCodeGenerator::EmitVariableAssignment"); |
| 2311 if (var->IsUnallocated()) { | 2296 if (var->IsUnallocated()) { |
| 2312 // Global var, const, or let. | 2297 // Global var, const, or let. |
| 2313 __ Mov(StoreDescriptor::NameRegister(), Operand(var->name())); | 2298 __ Mov(StoreDescriptor::NameRegister(), Operand(var->name())); |
| 2314 __ Ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); | 2299 __ Ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); |
| 2315 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 2300 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
| 2316 CallStoreIC(); | 2301 CallStoreIC(); |
| 2317 | 2302 |
| 2318 } else if (var->IsGlobalSlot()) { | |
| 2319 // Global var, const, or let. | |
| 2320 DCHECK(var->index() > 0); | |
| 2321 DCHECK(var->IsStaticGlobalObjectProperty()); | |
| 2322 int const slot = var->index(); | |
| 2323 int const depth = scope()->ContextChainLength(var->scope()); | |
| 2324 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | |
| 2325 __ Mov(StoreGlobalViaContextDescriptor::SlotRegister(), slot); | |
| 2326 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(x0)); | |
| 2327 StoreGlobalViaContextStub stub(isolate(), depth, language_mode()); | |
| 2328 __ CallStub(&stub); | |
| 2329 } else { | |
| 2330 __ Push(Smi::FromInt(slot)); | |
| 2331 __ Push(x0); | |
| 2332 __ CallRuntime(is_strict(language_mode()) | |
| 2333 ? Runtime::kStoreGlobalViaContext_Strict | |
| 2334 : Runtime::kStoreGlobalViaContext_Sloppy, | |
| 2335 2); | |
| 2336 } | |
| 2337 } else if (var->mode() == LET && op != Token::INIT_LET) { | 2303 } else if (var->mode() == LET && op != Token::INIT_LET) { |
| 2338 // Non-initializing assignment to let variable needs a write barrier. | 2304 // Non-initializing assignment to let variable needs a write barrier. |
| 2339 DCHECK(!var->IsLookupSlot()); | 2305 DCHECK(!var->IsLookupSlot()); |
| 2340 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2306 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 2341 Label assign; | 2307 Label assign; |
| 2342 MemOperand location = VarOperand(var, x1); | 2308 MemOperand location = VarOperand(var, x1); |
| 2343 __ Ldr(x10, location); | 2309 __ Ldr(x10, location); |
| 2344 __ JumpIfNotRoot(x10, Heap::kTheHoleValueRootIndex, &assign); | 2310 __ JumpIfNotRoot(x10, Heap::kTheHoleValueRootIndex, &assign); |
| 2345 __ Mov(x10, Operand(var->name())); | 2311 __ Mov(x10, Operand(var->name())); |
| 2346 __ Push(x10); | 2312 __ Push(x10); |
| (...skipping 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5212 } | 5178 } |
| 5213 | 5179 |
| 5214 return INTERRUPT; | 5180 return INTERRUPT; |
| 5215 } | 5181 } |
| 5216 | 5182 |
| 5217 | 5183 |
| 5218 } // namespace internal | 5184 } // namespace internal |
| 5219 } // namespace v8 | 5185 } // namespace v8 |
| 5220 | 5186 |
| 5221 #endif // V8_TARGET_ARCH_ARM64 | 5187 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |