OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ic/call-optimization.h" | 7 #include "src/ic/call-optimization.h" |
8 #include "src/ic/handler-compiler.h" | 8 #include "src/ic/handler-compiler.h" |
9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 442 } |
443 | 443 |
444 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, | 444 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(FieldType* field_type, |
445 Register value_reg, | 445 Register value_reg, |
446 Label* miss_label) { | 446 Label* miss_label) { |
447 Register map_reg = scratch1(); | 447 Register map_reg = scratch1(); |
448 Register scratch = scratch2(); | 448 Register scratch = scratch2(); |
449 DCHECK(!value_reg.is(map_reg)); | 449 DCHECK(!value_reg.is(map_reg)); |
450 DCHECK(!value_reg.is(scratch)); | 450 DCHECK(!value_reg.is(scratch)); |
451 __ JumpIfSmi(value_reg, miss_label); | 451 __ JumpIfSmi(value_reg, miss_label); |
452 FieldType::Iterator it = field_type->Classes(); | 452 if (field_type->IsClass()) { |
453 if (!it.Done()) { | |
454 __ Ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); | 453 __ Ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
455 Label do_store; | 454 __ CmpWeakValue(map_reg, Map::WeakCellForMap(field_type->AsClass()), |
456 while (true) { | 455 scratch); |
457 __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); | 456 __ B(ne, miss_label); |
458 it.Advance(); | |
459 if (it.Done()) { | |
460 __ B(ne, miss_label); | |
461 break; | |
462 } | |
463 __ B(eq, &do_store); | |
464 } | |
465 __ Bind(&do_store); | |
466 } | 457 } |
467 } | 458 } |
468 | 459 |
469 | 460 |
470 Register PropertyHandlerCompiler::CheckPrototypes( | 461 Register PropertyHandlerCompiler::CheckPrototypes( |
471 Register object_reg, Register holder_reg, Register scratch1, | 462 Register object_reg, Register holder_reg, Register scratch1, |
472 Register scratch2, Handle<Name> name, Label* miss, PrototypeCheckType check, | 463 Register scratch2, Handle<Name> name, Label* miss, PrototypeCheckType check, |
473 ReturnHolder return_what) { | 464 ReturnHolder return_what) { |
474 Handle<Map> receiver_map = map(); | 465 Handle<Map> receiver_map = map(); |
475 | 466 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 // Return the generated code. | 785 // Return the generated code. |
795 return GetCode(kind(), Code::FAST, name); | 786 return GetCode(kind(), Code::FAST, name); |
796 } | 787 } |
797 | 788 |
798 | 789 |
799 #undef __ | 790 #undef __ |
800 } // namespace internal | 791 } // namespace internal |
801 } // namespace v8 | 792 } // namespace v8 |
802 | 793 |
803 #endif // V8_TARGET_ARCH_IA32 | 794 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |