| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
| 8 | 8 |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/ic-inl.h" | 10 #include "src/ic-inl.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 361 |
| 362 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, | 362 void NamedStoreHandlerCompiler::GenerateRestoreName(Label* label, |
| 363 Handle<Name> name) { | 363 Handle<Name> name) { |
| 364 if (!label->is_unused()) { | 364 if (!label->is_unused()) { |
| 365 __ Bind(label); | 365 __ Bind(label); |
| 366 __ Mov(this->name(), Operand(name)); | 366 __ Mov(this->name(), Operand(name)); |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 | 369 |
| 370 | 370 |
| 371 void NamedStoreHandlerCompiler::GenerateNegativeHolderLookup( | |
| 372 Register holder_reg, Handle<Name> name, Label* miss) { | |
| 373 if (holder()->IsJSGlobalObject()) { | |
| 374 GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(holder()), | |
| 375 name, scratch1(), miss); | |
| 376 } else if (!holder()->HasFastProperties()) { | |
| 377 GenerateDictionaryNegativeLookup(masm(), miss, holder_reg, name, scratch1(), | |
| 378 scratch2()); | |
| 379 } | |
| 380 } | |
| 381 | |
| 382 | |
| 383 // Generate StoreTransition code, value is passed in x0 register. | 371 // Generate StoreTransition code, value is passed in x0 register. |
| 384 // When leaving generated code after success, the receiver_reg and storage_reg | 372 // When leaving generated code after success, the receiver_reg and storage_reg |
| 385 // may be clobbered. Upon branch to miss_label, the receiver and name registers | 373 // may be clobbered. Upon branch to miss_label, the receiver and name registers |
| 386 // have their original values. | 374 // have their original values. |
| 387 void NamedStoreHandlerCompiler::GenerateStoreTransition( | 375 void NamedStoreHandlerCompiler::GenerateStoreTransition( |
| 388 Handle<Map> transition, Handle<Name> name, Register receiver_reg, | 376 Handle<Map> transition, Handle<Name> name, Register receiver_reg, |
| 389 Register storage_reg, Register value_reg, Register scratch1, | 377 Register storage_reg, Register value_reg, Register scratch1, |
| 390 Register scratch2, Register scratch3, Label* miss_label, Label* slow) { | 378 Register scratch2, Register scratch3, Label* miss_label, Label* slow) { |
| 391 Label exit; | 379 Label exit; |
| 392 | 380 |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 // Do tail-call to the runtime system. | 1083 // Do tail-call to the runtime system. |
| 1096 ExternalReference store_ic_property = ExternalReference( | 1084 ExternalReference store_ic_property = ExternalReference( |
| 1097 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); | 1085 IC_Utility(IC::kStorePropertyWithInterceptor), isolate()); |
| 1098 __ TailCallExternalReference(store_ic_property, 3, 1); | 1086 __ TailCallExternalReference(store_ic_property, 3, 1); |
| 1099 | 1087 |
| 1100 // Return the generated code. | 1088 // Return the generated code. |
| 1101 return GetCode(kind(), Code::FAST, name); | 1089 return GetCode(kind(), Code::FAST, name); |
| 1102 } | 1090 } |
| 1103 | 1091 |
| 1104 | 1092 |
| 1105 Handle<Code> NamedLoadHandlerCompiler::CompileLoadNonexistent( | |
| 1106 Handle<Name> name) { | |
| 1107 NonexistentFrontend(name); | |
| 1108 | |
| 1109 // Return undefined if maps of the full prototype chain are still the | |
| 1110 // same and no global property with this name contains a value. | |
| 1111 __ LoadRoot(x0, Heap::kUndefinedValueRootIndex); | |
| 1112 __ Ret(); | |
| 1113 | |
| 1114 // Return the generated code. | |
| 1115 return GetCode(kind(), Code::FAST, name); | |
| 1116 } | |
| 1117 | |
| 1118 | |
| 1119 // TODO(all): The so-called scratch registers are significant in some cases. For | 1093 // TODO(all): The so-called scratch registers are significant in some cases. For |
| 1120 // example, PropertyAccessCompiler::keyed_store_calling_convention()[3] (x3) is | 1094 // example, PropertyAccessCompiler::keyed_store_calling_convention()[3] (x3) is |
| 1121 // actually | 1095 // actually |
| 1122 // used for KeyedStoreCompiler::transition_map(). We should verify which | 1096 // used for KeyedStoreCompiler::transition_map(). We should verify which |
| 1123 // registers are actually scratch registers, and which are important. For now, | 1097 // registers are actually scratch registers, and which are important. For now, |
| 1124 // we use the same assignments as ARM to remain on the safe side. | 1098 // we use the same assignments as ARM to remain on the safe side. |
| 1125 | 1099 |
| 1126 Register* PropertyAccessCompiler::load_calling_convention() { | 1100 Register* PropertyAccessCompiler::load_calling_convention() { |
| 1127 // receiver, name, scratch1, scratch2, scratch3, scratch4. | 1101 // receiver, name, scratch1, scratch2, scratch3, scratch4. |
| 1128 Register receiver = LoadIC::ReceiverRegister(); | 1102 Register receiver = LoadIC::ReceiverRegister(); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 | 1298 |
| 1325 // Miss case, call the runtime. | 1299 // Miss case, call the runtime. |
| 1326 __ Bind(&miss); | 1300 __ Bind(&miss); |
| 1327 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1301 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 1328 } | 1302 } |
| 1329 | 1303 |
| 1330 | 1304 |
| 1331 } } // namespace v8::internal | 1305 } } // namespace v8::internal |
| 1332 | 1306 |
| 1333 #endif // V8_TARGET_ARCH_ARM64 | 1307 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |