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 #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/ic/call-optimization.h" | 9 #include "src/ic/call-optimization.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 __ Ldr(scratch, | 420 __ Ldr(scratch, |
421 FieldMemOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); | 421 FieldMemOperand(scratch, DescriptorArray::GetValueOffset(descriptor))); |
422 __ Cmp(value_reg, scratch); | 422 __ Cmp(value_reg, scratch); |
423 __ B(ne, miss_label); | 423 __ B(ne, miss_label); |
424 } | 424 } |
425 | 425 |
426 | 426 |
427 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, | 427 void NamedStoreHandlerCompiler::GenerateFieldTypeChecks(HeapType* field_type, |
428 Register value_reg, | 428 Register value_reg, |
429 Label* miss_label) { | 429 Label* miss_label) { |
| 430 Register map_reg = scratch1(); |
| 431 Register scratch = scratch2(); |
| 432 DCHECK(!value_reg.is(map_reg)); |
| 433 DCHECK(!value_reg.is(scratch)); |
430 __ JumpIfSmi(value_reg, miss_label); | 434 __ JumpIfSmi(value_reg, miss_label); |
431 HeapType::Iterator<Map> it = field_type->Classes(); | 435 HeapType::Iterator<Map> it = field_type->Classes(); |
432 if (!it.Done()) { | 436 if (!it.Done()) { |
433 __ Ldr(scratch1(), FieldMemOperand(value_reg, HeapObject::kMapOffset)); | 437 __ Ldr(map_reg, FieldMemOperand(value_reg, HeapObject::kMapOffset)); |
434 Label do_store; | 438 Label do_store; |
435 while (true) { | 439 while (true) { |
436 __ CompareMap(scratch1(), it.Current()); | 440 __ CmpWeakValue(map_reg, Map::WeakCellForMap(it.Current()), scratch); |
437 it.Advance(); | 441 it.Advance(); |
438 if (it.Done()) { | 442 if (it.Done()) { |
439 __ B(ne, miss_label); | 443 __ B(ne, miss_label); |
440 break; | 444 break; |
441 } | 445 } |
442 __ B(eq, &do_store); | 446 __ B(eq, &do_store); |
443 } | 447 } |
444 __ Bind(&do_store); | 448 __ Bind(&do_store); |
445 } | 449 } |
446 } | 450 } |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // Return the generated code. | 746 // Return the generated code. |
743 return GetCode(kind(), Code::FAST, name); | 747 return GetCode(kind(), Code::FAST, name); |
744 } | 748 } |
745 | 749 |
746 | 750 |
747 #undef __ | 751 #undef __ |
748 } | 752 } |
749 } // namespace v8::internal | 753 } // namespace v8::internal |
750 | 754 |
751 #endif // V8_TARGET_ARCH_IA32 | 755 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |