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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 } else { | 1235 } else { |
1236 __ Push(info); | 1236 __ Push(info); |
1237 __ CallRuntime( | 1237 __ CallRuntime( |
1238 pretenure ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure, 1); | 1238 pretenure ? Runtime::kNewClosure_Tenured : Runtime::kNewClosure, 1); |
1239 } | 1239 } |
1240 context()->Plug(v0); | 1240 context()->Plug(v0); |
1241 } | 1241 } |
1242 | 1242 |
1243 | 1243 |
1244 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, | 1244 void FullCodeGenerator::EmitSetHomeObject(Expression* initializer, int offset, |
1245 FeedbackVectorICSlot slot) { | 1245 FeedbackVectorSlot slot) { |
1246 DCHECK(NeedsHomeObject(initializer)); | 1246 DCHECK(NeedsHomeObject(initializer)); |
1247 __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); | 1247 __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp)); |
1248 __ li(StoreDescriptor::NameRegister(), | 1248 __ li(StoreDescriptor::NameRegister(), |
1249 Operand(isolate()->factory()->home_object_symbol())); | 1249 Operand(isolate()->factory()->home_object_symbol())); |
1250 __ ld(StoreDescriptor::ValueRegister(), | 1250 __ ld(StoreDescriptor::ValueRegister(), |
1251 MemOperand(sp, offset * kPointerSize)); | 1251 MemOperand(sp, offset * kPointerSize)); |
1252 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 1252 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
1253 CallStoreIC(); | 1253 CallStoreIC(); |
1254 } | 1254 } |
1255 | 1255 |
1256 | 1256 |
1257 void FullCodeGenerator::EmitSetHomeObjectAccumulator( | 1257 void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, |
1258 Expression* initializer, int offset, FeedbackVectorICSlot slot) { | 1258 int offset, |
| 1259 FeedbackVectorSlot slot) { |
1259 DCHECK(NeedsHomeObject(initializer)); | 1260 DCHECK(NeedsHomeObject(initializer)); |
1260 __ Move(StoreDescriptor::ReceiverRegister(), v0); | 1261 __ Move(StoreDescriptor::ReceiverRegister(), v0); |
1261 __ li(StoreDescriptor::NameRegister(), | 1262 __ li(StoreDescriptor::NameRegister(), |
1262 Operand(isolate()->factory()->home_object_symbol())); | 1263 Operand(isolate()->factory()->home_object_symbol())); |
1263 __ ld(StoreDescriptor::ValueRegister(), | 1264 __ ld(StoreDescriptor::ValueRegister(), |
1264 MemOperand(sp, offset * kPointerSize)); | 1265 MemOperand(sp, offset * kPointerSize)); |
1265 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 1266 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
1266 CallStoreIC(); | 1267 CallStoreIC(); |
1267 } | 1268 } |
1268 | 1269 |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2493 Handle<Code> code = | 2494 Handle<Code> code = |
2494 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); | 2495 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); |
2495 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. | 2496 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. |
2496 CallIC(code, expr->BinaryOperationFeedbackId()); | 2497 CallIC(code, expr->BinaryOperationFeedbackId()); |
2497 patch_site.EmitPatchInfo(); | 2498 patch_site.EmitPatchInfo(); |
2498 context()->Plug(v0); | 2499 context()->Plug(v0); |
2499 } | 2500 } |
2500 | 2501 |
2501 | 2502 |
2502 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2503 void FullCodeGenerator::EmitAssignment(Expression* expr, |
2503 FeedbackVectorICSlot slot) { | 2504 FeedbackVectorSlot slot) { |
2504 DCHECK(expr->IsValidReferenceExpressionOrThis()); | 2505 DCHECK(expr->IsValidReferenceExpressionOrThis()); |
2505 | 2506 |
2506 Property* prop = expr->AsProperty(); | 2507 Property* prop = expr->AsProperty(); |
2507 LhsKind assign_type = Property::GetAssignType(prop); | 2508 LhsKind assign_type = Property::GetAssignType(prop); |
2508 | 2509 |
2509 switch (assign_type) { | 2510 switch (assign_type) { |
2510 case VARIABLE: { | 2511 case VARIABLE: { |
2511 Variable* var = expr->AsVariableProxy()->var(); | 2512 Variable* var = expr->AsVariableProxy()->var(); |
2512 EffectContext context(this); | 2513 EffectContext context(this); |
2513 EmitVariableAssignment(var, Token::ASSIGN, slot); | 2514 EmitVariableAssignment(var, Token::ASSIGN, slot); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2586 // RecordWrite may destroy all its register arguments. | 2587 // RecordWrite may destroy all its register arguments. |
2587 __ Move(a3, result_register()); | 2588 __ Move(a3, result_register()); |
2588 int offset = Context::SlotOffset(var->index()); | 2589 int offset = Context::SlotOffset(var->index()); |
2589 __ RecordWriteContextSlot( | 2590 __ RecordWriteContextSlot( |
2590 a1, offset, a3, a2, kRAHasBeenSaved, kDontSaveFPRegs); | 2591 a1, offset, a3, a2, kRAHasBeenSaved, kDontSaveFPRegs); |
2591 } | 2592 } |
2592 } | 2593 } |
2593 | 2594 |
2594 | 2595 |
2595 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, | 2596 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
2596 FeedbackVectorICSlot slot) { | 2597 FeedbackVectorSlot slot) { |
2597 if (var->IsUnallocated()) { | 2598 if (var->IsUnallocated()) { |
2598 // Global var, const, or let. | 2599 // Global var, const, or let. |
2599 __ mov(StoreDescriptor::ValueRegister(), result_register()); | 2600 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
2600 __ li(StoreDescriptor::NameRegister(), Operand(var->name())); | 2601 __ li(StoreDescriptor::NameRegister(), Operand(var->name())); |
2601 __ ld(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); | 2602 __ ld(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); |
2602 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 2603 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
2603 CallStoreIC(); | 2604 CallStoreIC(); |
2604 | 2605 |
2605 } else if (var->IsGlobalSlot()) { | 2606 } else if (var->IsGlobalSlot()) { |
2606 // Global var, const, or let. | 2607 // Global var, const, or let. |
(...skipping 2544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5151 void FullCodeGenerator::ClearPendingMessage() { | 5152 void FullCodeGenerator::ClearPendingMessage() { |
5152 DCHECK(!result_register().is(a1)); | 5153 DCHECK(!result_register().is(a1)); |
5153 ExternalReference pending_message_obj = | 5154 ExternalReference pending_message_obj = |
5154 ExternalReference::address_of_pending_message_obj(isolate()); | 5155 ExternalReference::address_of_pending_message_obj(isolate()); |
5155 __ LoadRoot(a1, Heap::kTheHoleValueRootIndex); | 5156 __ LoadRoot(a1, Heap::kTheHoleValueRootIndex); |
5156 __ li(at, Operand(pending_message_obj)); | 5157 __ li(at, Operand(pending_message_obj)); |
5157 __ sd(a1, MemOperand(at)); | 5158 __ sd(a1, MemOperand(at)); |
5158 } | 5159 } |
5159 | 5160 |
5160 | 5161 |
5161 void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorICSlot slot) { | 5162 void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorSlot slot) { |
5162 DCHECK(FLAG_vector_stores && !slot.IsInvalid()); | 5163 DCHECK(FLAG_vector_stores && !slot.IsInvalid()); |
5163 __ li(VectorStoreICTrampolineDescriptor::SlotRegister(), | 5164 __ li(VectorStoreICTrampolineDescriptor::SlotRegister(), |
5164 Operand(SmiFromSlot(slot))); | 5165 Operand(SmiFromSlot(slot))); |
5165 } | 5166 } |
5166 | 5167 |
5167 | 5168 |
5168 #undef __ | 5169 #undef __ |
5169 | 5170 |
5170 | 5171 |
5171 void BackEdgeTable::PatchAt(Code* unoptimized_code, | 5172 void BackEdgeTable::PatchAt(Code* unoptimized_code, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5245 reinterpret_cast<uint64_t>( | 5246 reinterpret_cast<uint64_t>( |
5246 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5247 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5247 return OSR_AFTER_STACK_CHECK; | 5248 return OSR_AFTER_STACK_CHECK; |
5248 } | 5249 } |
5249 | 5250 |
5250 | 5251 |
5251 } // namespace internal | 5252 } // namespace internal |
5252 } // namespace v8 | 5253 } // namespace v8 |
5253 | 5254 |
5254 #endif // V8_TARGET_ARCH_MIPS64 | 5255 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |