| 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/compiler.h" | 10 #include "src/compiler.h" |
| (...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(x0); | 1240 context()->Plug(x0); |
| 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 __ Peek(StoreDescriptor::ReceiverRegister(), 0); | 1247 __ Peek(StoreDescriptor::ReceiverRegister(), 0); |
| 1248 __ Mov(StoreDescriptor::NameRegister(), | 1248 __ Mov(StoreDescriptor::NameRegister(), |
| 1249 Operand(isolate()->factory()->home_object_symbol())); | 1249 Operand(isolate()->factory()->home_object_symbol())); |
| 1250 __ Peek(StoreDescriptor::ValueRegister(), offset * kPointerSize); | 1250 __ Peek(StoreDescriptor::ValueRegister(), offset * kPointerSize); |
| 1251 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 1251 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
| 1252 CallStoreIC(); | 1252 CallStoreIC(); |
| 1253 } | 1253 } |
| 1254 | 1254 |
| 1255 | 1255 |
| 1256 void FullCodeGenerator::EmitSetHomeObjectAccumulator( | 1256 void FullCodeGenerator::EmitSetHomeObjectAccumulator(Expression* initializer, |
| 1257 Expression* initializer, int offset, FeedbackVectorICSlot slot) { | 1257 int offset, |
| 1258 FeedbackVectorSlot slot) { |
| 1258 DCHECK(NeedsHomeObject(initializer)); | 1259 DCHECK(NeedsHomeObject(initializer)); |
| 1259 __ Move(StoreDescriptor::ReceiverRegister(), x0); | 1260 __ Move(StoreDescriptor::ReceiverRegister(), x0); |
| 1260 __ Mov(StoreDescriptor::NameRegister(), | 1261 __ Mov(StoreDescriptor::NameRegister(), |
| 1261 Operand(isolate()->factory()->home_object_symbol())); | 1262 Operand(isolate()->factory()->home_object_symbol())); |
| 1262 __ Peek(StoreDescriptor::ValueRegister(), offset * kPointerSize); | 1263 __ Peek(StoreDescriptor::ValueRegister(), offset * kPointerSize); |
| 1263 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 1264 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
| 1264 CallStoreIC(); | 1265 CallStoreIC(); |
| 1265 } | 1266 } |
| 1266 | 1267 |
| 1267 | 1268 |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2201 } | 2202 } |
| 2202 } | 2203 } |
| 2203 | 2204 |
| 2204 // Set both the prototype and constructor to have fast properties, and also | 2205 // Set both the prototype and constructor to have fast properties, and also |
| 2205 // freeze them in strong mode. | 2206 // freeze them in strong mode. |
| 2206 __ CallRuntime(Runtime::kFinalizeClassDefinition, 2); | 2207 __ CallRuntime(Runtime::kFinalizeClassDefinition, 2); |
| 2207 } | 2208 } |
| 2208 | 2209 |
| 2209 | 2210 |
| 2210 void FullCodeGenerator::EmitAssignment(Expression* expr, | 2211 void FullCodeGenerator::EmitAssignment(Expression* expr, |
| 2211 FeedbackVectorICSlot slot) { | 2212 FeedbackVectorSlot slot) { |
| 2212 DCHECK(expr->IsValidReferenceExpressionOrThis()); | 2213 DCHECK(expr->IsValidReferenceExpressionOrThis()); |
| 2213 | 2214 |
| 2214 Property* prop = expr->AsProperty(); | 2215 Property* prop = expr->AsProperty(); |
| 2215 LhsKind assign_type = Property::GetAssignType(prop); | 2216 LhsKind assign_type = Property::GetAssignType(prop); |
| 2216 | 2217 |
| 2217 switch (assign_type) { | 2218 switch (assign_type) { |
| 2218 case VARIABLE: { | 2219 case VARIABLE: { |
| 2219 Variable* var = expr->AsVariableProxy()->var(); | 2220 Variable* var = expr->AsVariableProxy()->var(); |
| 2220 EffectContext context(this); | 2221 EffectContext context(this); |
| 2221 EmitVariableAssignment(var, Token::ASSIGN, slot); | 2222 EmitVariableAssignment(var, Token::ASSIGN, slot); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2296 // RecordWrite may destroy all its register arguments. | 2297 // RecordWrite may destroy all its register arguments. |
| 2297 __ Mov(x10, result_register()); | 2298 __ Mov(x10, result_register()); |
| 2298 int offset = Context::SlotOffset(var->index()); | 2299 int offset = Context::SlotOffset(var->index()); |
| 2299 __ RecordWriteContextSlot( | 2300 __ RecordWriteContextSlot( |
| 2300 x1, offset, x10, x11, kLRHasBeenSaved, kDontSaveFPRegs); | 2301 x1, offset, x10, x11, kLRHasBeenSaved, kDontSaveFPRegs); |
| 2301 } | 2302 } |
| 2302 } | 2303 } |
| 2303 | 2304 |
| 2304 | 2305 |
| 2305 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, | 2306 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
| 2306 FeedbackVectorICSlot slot) { | 2307 FeedbackVectorSlot slot) { |
| 2307 ASM_LOCATION("FullCodeGenerator::EmitVariableAssignment"); | 2308 ASM_LOCATION("FullCodeGenerator::EmitVariableAssignment"); |
| 2308 if (var->IsUnallocated()) { | 2309 if (var->IsUnallocated()) { |
| 2309 // Global var, const, or let. | 2310 // Global var, const, or let. |
| 2310 __ Mov(StoreDescriptor::NameRegister(), Operand(var->name())); | 2311 __ Mov(StoreDescriptor::NameRegister(), Operand(var->name())); |
| 2311 __ Ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); | 2312 __ Ldr(StoreDescriptor::ReceiverRegister(), GlobalObjectMemOperand()); |
| 2312 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); | 2313 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
| 2313 CallStoreIC(); | 2314 CallStoreIC(); |
| 2314 | 2315 |
| 2315 } else if (var->IsGlobalSlot()) { | 2316 } else if (var->IsGlobalSlot()) { |
| 2316 // Global var, const, or let. | 2317 // Global var, const, or let. |
| (...skipping 2832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5149 void FullCodeGenerator::ClearPendingMessage() { | 5150 void FullCodeGenerator::ClearPendingMessage() { |
| 5150 DCHECK(!result_register().is(x10)); | 5151 DCHECK(!result_register().is(x10)); |
| 5151 ExternalReference pending_message_obj = | 5152 ExternalReference pending_message_obj = |
| 5152 ExternalReference::address_of_pending_message_obj(isolate()); | 5153 ExternalReference::address_of_pending_message_obj(isolate()); |
| 5153 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); | 5154 __ LoadRoot(x10, Heap::kTheHoleValueRootIndex); |
| 5154 __ Mov(x13, pending_message_obj); | 5155 __ Mov(x13, pending_message_obj); |
| 5155 __ Str(x10, MemOperand(x13)); | 5156 __ Str(x10, MemOperand(x13)); |
| 5156 } | 5157 } |
| 5157 | 5158 |
| 5158 | 5159 |
| 5159 void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorICSlot slot) { | 5160 void FullCodeGenerator::EmitLoadStoreICSlot(FeedbackVectorSlot slot) { |
| 5160 DCHECK(FLAG_vector_stores && !slot.IsInvalid()); | 5161 DCHECK(FLAG_vector_stores && !slot.IsInvalid()); |
| 5161 __ Mov(VectorStoreICTrampolineDescriptor::SlotRegister(), SmiFromSlot(slot)); | 5162 __ Mov(VectorStoreICTrampolineDescriptor::SlotRegister(), SmiFromSlot(slot)); |
| 5162 } | 5163 } |
| 5163 | 5164 |
| 5164 | 5165 |
| 5165 #undef __ | 5166 #undef __ |
| 5166 | 5167 |
| 5167 | 5168 |
| 5168 void BackEdgeTable::PatchAt(Code* unoptimized_code, | 5169 void BackEdgeTable::PatchAt(Code* unoptimized_code, |
| 5169 Address pc, | 5170 Address pc, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5257 } | 5258 } |
| 5258 | 5259 |
| 5259 return INTERRUPT; | 5260 return INTERRUPT; |
| 5260 } | 5261 } |
| 5261 | 5262 |
| 5262 | 5263 |
| 5263 } // namespace internal | 5264 } // namespace internal |
| 5264 } // namespace v8 | 5265 } // namespace v8 |
| 5265 | 5266 |
| 5266 #endif // V8_TARGET_ARCH_ARM64 | 5267 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |