OLD | NEW |
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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 } else { | 1238 } else { |
1239 __ Push(info); | 1239 __ Push(info); |
1240 __ CallRuntime( | 1240 __ CallRuntime( |
1241 pretenure ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure, 1); | 1241 pretenure ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure, 1); |
1242 } | 1242 } |
1243 context()->Plug(r0); | 1243 context()->Plug(r0); |
1244 } | 1244 } |
1245 | 1245 |
1246 | 1246 |
1247 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, | 1247 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, |
1248 FeedbackVectorICSlot slot) { | 1248 FeedbackVectorSlot slot) { |
1249 DCHECK(NeedsHomeObject(initializer)); | 1249 DCHECK(NeedsHomeObject(initializer)); |
1250 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); | 1250 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
1251 __ mov(StoreDescriptor::NameRegister(), | 1251 __ mov(StoreDescriptor::NameRegister(), |
1252 Operand(isolate()->factory()->home_object_symbol())); | 1252 Operand(isolate()->factory()->home_object_symbol())); |
1253 __ ldr(StoreDescriptor::ValueRegister(), | 1253 __ ldr(StoreDescriptor::ValueRegister(), |
1254 MemOperand(sp, offset * kPointerSize)); | 1254 MemOperand(sp, offset * kPointerSize)); |
1255 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 1255 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
1256 CallStoreIC(); | 1256 CallStoreIC(); |
1257 } | 1257 } |
1258 | 1258 |
1259 | 1259 |
1260 void FullCodeGenerator::EmitSetHomeObjectAccumulator( | 1260 void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, |
1261 Expression* initializer, int offset, FeedbackVectorICSlot slot) { | 1261 int offset, |
| 1262 FeedbackVectorSlot slot) { |
1262 DCHECK(NeedsHomeObject(initializer)); | 1263 DCHECK(NeedsHomeObject(initializer)); |
1263 __ Move(StoreDescriptor::ReceiverRegister(), r0); | 1264 __ Move(StoreDescriptor::ReceiverRegister(), r0); |
1264 __ mov(StoreDescriptor::NameRegister(), | 1265 __ mov(StoreDescriptor::NameRegister(), |
1265 Operand(isolate()->factory()->home_object_symbol())); | 1266 Operand(isolate()->factory()->home_object_symbol())); |
1266 __ ldr(StoreDescriptor::ValueRegister(), | 1267 __ ldr(StoreDescriptor::ValueRegister(), |
1267 MemOperand(sp, offset * kPointerSize)); | 1268 MemOperand(sp, offset * kPointerSize)); |
1268 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 1269 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
1269 CallStoreIC(); | 1270 CallStoreIC(); |
1270 } | 1271 } |
1271 | 1272 |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 Handle<Code> code = | 2502 Handle<Code> code = |
2502 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2503 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2503 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2504 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2504 CallIC(code, expr->BinaryOperationFeedbackId()); | 2505 CallIC(code, expr->BinaryOperationFeedbackId()); |
2505 patch_site.EmitPatchInfo(); | 2506 patch_site.EmitPatchInfo(); |
2506 context()->Plug(r0); | 2507 context()->Plug(r0); |
2507 } | 2508 } |
2508 | 2509 |
2509 | 2510 |
2510 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2511 void FullCodeGenerator::EmitAssignment(Expression* expr, |
2511 FeedbackVectorICSlot slot) { | 2512 FeedbackVectorSlot slot) { |
2512 DCHECK(expr->IsValidReferenceExpressionOrThis()); | 2513 DCHECK(expr->IsValidReferenceExpressionOrThis()); |
2513 | 2514 |
2514 Property* prop = expr->AsProperty(); | 2515 Property* prop = expr->AsProperty(); |
2515 LhsKind assign_type = Property::GetAssignType(prop); | 2516 LhsKind assign_type = Property::GetAssignType(prop); |
2516 | 2517 |
2517 switch (assign_type) { | 2518 switch (assign_type) { |
2518 case VARIABLE: { | 2519 case VARIABLE: { |
2519 Variable* var = expr->AsVariableProxy()->var(); | 2520 Variable* var = expr->AsVariableProxy()->var(); |
2520 EffectContext context(this); | 2521 EffectContext context(this); |
2521 EmitVariableAssignment(var, Token::ASSIGN, slot); | 2522 EmitVariableAssignment(var, Token::ASSIGN, slot); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2594 // RecordWrite may destroy all its register arguments. | 2595 // RecordWrite may destroy all its register arguments. |
2595 __ mov(r3, result_register()); | 2596 __ mov(r3, result_register()); |
2596 int offset = Context::SlotOffset(var->index()); | 2597 int offset = Context::SlotOffset(var->index()); |
2597 __ RecordWriteContextSlot( | 2598 __ RecordWriteContextSlot( |
2598 r1, offset, r3, r2, kLRHasBeenSaved, kDontSaveFPRegs); | 2599 r1, offset, r3, r2, kLRHasBeenSaved, kDontSaveFPRegs); |
2599 } | 2600 } |
2600 } | 2601 } |
2601 | 2602 |
2602 | 2603 |
2603 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, | 2604 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
2604 FeedbackVectorICSlot slot) { | 2605 FeedbackVectorSlot slot) { |
2605 if (var->IsUnallocated()) { | 2606 if (var->IsUnallocated()) { |
2606 // Global var, const, or let. | 2607 // Global var, const, or let. |
2607 __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); | 2608 __ mov(StoreDescriptor::NameRegister(), Operand(var->name())); |
2608 __ ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 2609 __ ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
2609 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 2610 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
2610 CallStoreIC(); | 2611 CallStoreIC(); |
2611 | 2612 |
2612 } else if (var->IsGlobalSlot()) { | 2613 } else if (var->IsGlobalSlot()) { |
2613 // Global var, const, or let. | 2614 // Global var, const, or let. |
2614 DCHECK(var->index() > 0); | 2615 DCHECK(var->index() > 0); |
(...skipping 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5116 void FullCodeGenerator::ClearPendingMessage() { | 5117 void FullCodeGenerator::ClearPendingMessage() { |
5117 DCHECK(!result_register().is(r1)); | 5118 DCHECK(!result_register().is(r1)); |
5118 ExternalReference pending_message_obj = | 5119 ExternalReference pending_message_obj = |
5119 ExternalReference::address_of_pending_message_obj(isolate()); | 5120 ExternalReference::address_of_pending_message_obj(isolate()); |
5120 __ LoadRoot(r1, Heap::kTheHoleValueRootIndex); | 5121 __ LoadRoot(r1, Heap::kTheHoleValueRootIndex); |
5121 __ mov(ip, Operand(pending_message_obj)); | 5122 __ mov(ip, Operand(pending_message_obj)); |
5122 __ str(r1, MemOperand(ip)); | 5123 __ str(r1, MemOperand(ip)); |
5123 } | 5124 } |
5124 | 5125 |
5125 | 5126 |
5126 void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorICSlot slot) { | 5127 void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorSlot slot) { |
5127 DCHECK(FLAG_vector_stores && !slot.IsInvalid()); | 5128 DCHECK(FLAG_vector_stores && !slot.IsInvalid()); |
5128 __ mov(VectorStoreICTrampolineDescriptor::SlotRegister(), | 5129 __ mov(VectorStoreICTrampolineDescriptor::SlotRegister(), |
5129 Operand(SmiFromSlot(slot))); | 5130 Operand(SmiFromSlot(slot))); |
5130 } | 5131 } |
5131 | 5132 |
5132 | 5133 |
5133 #undef __ | 5134 #undef __ |
5134 | 5135 |
5135 | 5136 |
5136 static Address GetInterruptImmediateLoadAddress(Address pc) { | 5137 static Address GetInterruptImmediateLoadAddress(Address pc) { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5269 DCHECK(interrupt_address == | 5270 DCHECK(interrupt_address == |
5270 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5271 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5271 return OSR_AFTER_STACK_CHECK; | 5272 return OSR_AFTER_STACK_CHECK; |
5272 } | 5273 } |
5273 | 5274 |
5274 | 5275 |
5275 } // namespace internal | 5276 } // namespace internal |
5276 } // namespace v8 | 5277 } // namespace v8 |
5277 | 5278 |
5278 #endif // V8_TARGET_ARCH_ARM | 5279 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |