OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); | 315 __ ldr(prototype, FieldMemOperand(prototype, Map::kPrototypeOffset)); |
316 } | 316 } |
317 | 317 |
318 | 318 |
319 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, | 319 void StubCompiler::GenerateFastPropertyLoad(MacroAssembler* masm, |
320 Register dst, | 320 Register dst, |
321 Register src, | 321 Register src, |
322 bool inobject, | 322 bool inobject, |
323 int index, | 323 int index, |
324 Representation representation) { | 324 Representation representation) { |
325 ASSERT(!FLAG_track_double_fields || !representation.IsDouble()); | 325 ASSERT(!representation.IsDouble()); |
326 int offset = index * kPointerSize; | 326 int offset = index * kPointerSize; |
327 if (!inobject) { | 327 if (!inobject) { |
328 // Calculate the offset into the properties array. | 328 // Calculate the offset into the properties array. |
329 offset = offset + FixedArray::kHeaderSize; | 329 offset = offset + FixedArray::kHeaderSize; |
330 __ ldr(dst, FieldMemOperand(src, JSObject::kPropertiesOffset)); | 330 __ ldr(dst, FieldMemOperand(src, JSObject::kPropertiesOffset)); |
331 src = dst; | 331 src = dst; |
332 } | 332 } |
333 __ ldr(dst, FieldMemOperand(src, offset)); | 333 __ ldr(dst, FieldMemOperand(src, offset)); |
334 } | 334 } |
335 | 335 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 DescriptorArray* descriptors = transition->instance_descriptors(); | 474 DescriptorArray* descriptors = transition->instance_descriptors(); |
475 PropertyDetails details = descriptors->GetDetails(descriptor); | 475 PropertyDetails details = descriptors->GetDetails(descriptor); |
476 Representation representation = details.representation(); | 476 Representation representation = details.representation(); |
477 ASSERT(!representation.IsNone()); | 477 ASSERT(!representation.IsNone()); |
478 | 478 |
479 if (details.type() == CONSTANT) { | 479 if (details.type() == CONSTANT) { |
480 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); | 480 Handle<Object> constant(descriptors->GetValue(descriptor), masm->isolate()); |
481 __ Move(scratch1, constant); | 481 __ Move(scratch1, constant); |
482 __ cmp(value_reg, scratch1); | 482 __ cmp(value_reg, scratch1); |
483 __ b(ne, miss_label); | 483 __ b(ne, miss_label); |
484 } else if (FLAG_track_fields && representation.IsSmi()) { | 484 } else if (representation.IsSmi()) { |
485 __ JumpIfNotSmi(value_reg, miss_label); | 485 __ JumpIfNotSmi(value_reg, miss_label); |
486 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 486 } else if (representation.IsHeapObject()) { |
487 __ JumpIfSmi(value_reg, miss_label); | 487 __ JumpIfSmi(value_reg, miss_label); |
488 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 488 } else if (representation.IsDouble()) { |
489 Label do_store, heap_number; | 489 Label do_store, heap_number; |
490 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); | 490 __ LoadRoot(scratch3, Heap::kHeapNumberMapRootIndex); |
491 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); | 491 __ AllocateHeapNumber(storage_reg, scratch1, scratch2, scratch3, slow); |
492 | 492 |
493 __ JumpIfNotSmi(value_reg, &heap_number); | 493 __ JumpIfNotSmi(value_reg, &heap_number); |
494 __ SmiUntag(scratch1, value_reg); | 494 __ SmiUntag(scratch1, value_reg); |
495 __ vmov(s0, scratch1); | 495 __ vmov(s0, scratch1); |
496 __ vcvt_f64_s32(d0, s0); | 496 __ vcvt_f64_s32(d0, s0); |
497 __ jmp(&do_store); | 497 __ jmp(&do_store); |
498 | 498 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 // face of a transition we can use the old map here because the size of the | 552 // face of a transition we can use the old map here because the size of the |
553 // object and the number of in-object properties is not going to change. | 553 // object and the number of in-object properties is not going to change. |
554 index -= object->map()->inobject_properties(); | 554 index -= object->map()->inobject_properties(); |
555 | 555 |
556 // TODO(verwaest): Share this code as a code stub. | 556 // TODO(verwaest): Share this code as a code stub. |
557 SmiCheck smi_check = representation.IsTagged() | 557 SmiCheck smi_check = representation.IsTagged() |
558 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; | 558 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; |
559 if (index < 0) { | 559 if (index < 0) { |
560 // Set the property straight into the object. | 560 // Set the property straight into the object. |
561 int offset = object->map()->instance_size() + (index * kPointerSize); | 561 int offset = object->map()->instance_size() + (index * kPointerSize); |
562 if (FLAG_track_double_fields && representation.IsDouble()) { | 562 if (representation.IsDouble()) { |
563 __ str(storage_reg, FieldMemOperand(receiver_reg, offset)); | 563 __ str(storage_reg, FieldMemOperand(receiver_reg, offset)); |
564 } else { | 564 } else { |
565 __ str(value_reg, FieldMemOperand(receiver_reg, offset)); | 565 __ str(value_reg, FieldMemOperand(receiver_reg, offset)); |
566 } | 566 } |
567 | 567 |
568 if (!FLAG_track_fields || !representation.IsSmi()) { | 568 if (!representation.IsSmi()) { |
569 // Update the write barrier for the array address. | 569 // Update the write barrier for the array address. |
570 if (!FLAG_track_double_fields || !representation.IsDouble()) { | 570 if (!representation.IsDouble()) { |
571 __ mov(storage_reg, value_reg); | 571 __ mov(storage_reg, value_reg); |
572 } | 572 } |
573 __ RecordWriteField(receiver_reg, | 573 __ RecordWriteField(receiver_reg, |
574 offset, | 574 offset, |
575 storage_reg, | 575 storage_reg, |
576 scratch1, | 576 scratch1, |
577 kLRHasNotBeenSaved, | 577 kLRHasNotBeenSaved, |
578 kDontSaveFPRegs, | 578 kDontSaveFPRegs, |
579 EMIT_REMEMBERED_SET, | 579 EMIT_REMEMBERED_SET, |
580 smi_check); | 580 smi_check); |
581 } | 581 } |
582 } else { | 582 } else { |
583 // Write to the properties array. | 583 // Write to the properties array. |
584 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 584 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
585 // Get the properties array | 585 // Get the properties array |
586 __ ldr(scratch1, | 586 __ ldr(scratch1, |
587 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); | 587 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); |
588 if (FLAG_track_double_fields && representation.IsDouble()) { | 588 if (representation.IsDouble()) { |
589 __ str(storage_reg, FieldMemOperand(scratch1, offset)); | 589 __ str(storage_reg, FieldMemOperand(scratch1, offset)); |
590 } else { | 590 } else { |
591 __ str(value_reg, FieldMemOperand(scratch1, offset)); | 591 __ str(value_reg, FieldMemOperand(scratch1, offset)); |
592 } | 592 } |
593 | 593 |
594 if (!FLAG_track_fields || !representation.IsSmi()) { | 594 if (!representation.IsSmi()) { |
595 // Update the write barrier for the array address. | 595 // Update the write barrier for the array address. |
596 if (!FLAG_track_double_fields || !representation.IsDouble()) { | 596 if (!representation.IsDouble()) { |
597 __ mov(storage_reg, value_reg); | 597 __ mov(storage_reg, value_reg); |
598 } | 598 } |
599 __ RecordWriteField(scratch1, | 599 __ RecordWriteField(scratch1, |
600 offset, | 600 offset, |
601 storage_reg, | 601 storage_reg, |
602 receiver_reg, | 602 receiver_reg, |
603 kLRHasNotBeenSaved, | 603 kLRHasNotBeenSaved, |
604 kDontSaveFPRegs, | 604 kDontSaveFPRegs, |
605 EMIT_REMEMBERED_SET, | 605 EMIT_REMEMBERED_SET, |
606 smi_check); | 606 smi_check); |
(...skipping 29 matching lines...) Expand all Loading... |
636 | 636 |
637 int index = lookup->GetFieldIndex().field_index(); | 637 int index = lookup->GetFieldIndex().field_index(); |
638 | 638 |
639 // Adjust for the number of properties stored in the object. Even in the | 639 // Adjust for the number of properties stored in the object. Even in the |
640 // face of a transition we can use the old map here because the size of the | 640 // face of a transition we can use the old map here because the size of the |
641 // object and the number of in-object properties is not going to change. | 641 // object and the number of in-object properties is not going to change. |
642 index -= object->map()->inobject_properties(); | 642 index -= object->map()->inobject_properties(); |
643 | 643 |
644 Representation representation = lookup->representation(); | 644 Representation representation = lookup->representation(); |
645 ASSERT(!representation.IsNone()); | 645 ASSERT(!representation.IsNone()); |
646 if (FLAG_track_fields && representation.IsSmi()) { | 646 if (representation.IsSmi()) { |
647 __ JumpIfNotSmi(value_reg, miss_label); | 647 __ JumpIfNotSmi(value_reg, miss_label); |
648 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 648 } else if (representation.IsHeapObject()) { |
649 __ JumpIfSmi(value_reg, miss_label); | 649 __ JumpIfSmi(value_reg, miss_label); |
650 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 650 } else if (representation.IsDouble()) { |
651 // Load the double storage. | 651 // Load the double storage. |
652 if (index < 0) { | 652 if (index < 0) { |
653 int offset = object->map()->instance_size() + (index * kPointerSize); | 653 int offset = object->map()->instance_size() + (index * kPointerSize); |
654 __ ldr(scratch1, FieldMemOperand(receiver_reg, offset)); | 654 __ ldr(scratch1, FieldMemOperand(receiver_reg, offset)); |
655 } else { | 655 } else { |
656 __ ldr(scratch1, | 656 __ ldr(scratch1, |
657 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); | 657 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); |
658 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 658 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
659 __ ldr(scratch1, FieldMemOperand(scratch1, offset)); | 659 __ ldr(scratch1, FieldMemOperand(scratch1, offset)); |
660 } | 660 } |
(...skipping 20 matching lines...) Expand all Loading... |
681 } | 681 } |
682 | 682 |
683 // TODO(verwaest): Share this code as a code stub. | 683 // TODO(verwaest): Share this code as a code stub. |
684 SmiCheck smi_check = representation.IsTagged() | 684 SmiCheck smi_check = representation.IsTagged() |
685 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; | 685 ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; |
686 if (index < 0) { | 686 if (index < 0) { |
687 // Set the property straight into the object. | 687 // Set the property straight into the object. |
688 int offset = object->map()->instance_size() + (index * kPointerSize); | 688 int offset = object->map()->instance_size() + (index * kPointerSize); |
689 __ str(value_reg, FieldMemOperand(receiver_reg, offset)); | 689 __ str(value_reg, FieldMemOperand(receiver_reg, offset)); |
690 | 690 |
691 if (!FLAG_track_fields || !representation.IsSmi()) { | 691 if (!representation.IsSmi()) { |
692 // Skip updating write barrier if storing a smi. | 692 // Skip updating write barrier if storing a smi. |
693 __ JumpIfSmi(value_reg, &exit); | 693 __ JumpIfSmi(value_reg, &exit); |
694 | 694 |
695 // Update the write barrier for the array address. | 695 // Update the write barrier for the array address. |
696 // Pass the now unused name_reg as a scratch register. | 696 // Pass the now unused name_reg as a scratch register. |
697 __ mov(name_reg, value_reg); | 697 __ mov(name_reg, value_reg); |
698 __ RecordWriteField(receiver_reg, | 698 __ RecordWriteField(receiver_reg, |
699 offset, | 699 offset, |
700 name_reg, | 700 name_reg, |
701 scratch1, | 701 scratch1, |
702 kLRHasNotBeenSaved, | 702 kLRHasNotBeenSaved, |
703 kDontSaveFPRegs, | 703 kDontSaveFPRegs, |
704 EMIT_REMEMBERED_SET, | 704 EMIT_REMEMBERED_SET, |
705 smi_check); | 705 smi_check); |
706 } | 706 } |
707 } else { | 707 } else { |
708 // Write to the properties array. | 708 // Write to the properties array. |
709 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 709 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
710 // Get the properties array | 710 // Get the properties array |
711 __ ldr(scratch1, | 711 __ ldr(scratch1, |
712 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); | 712 FieldMemOperand(receiver_reg, JSObject::kPropertiesOffset)); |
713 __ str(value_reg, FieldMemOperand(scratch1, offset)); | 713 __ str(value_reg, FieldMemOperand(scratch1, offset)); |
714 | 714 |
715 if (!FLAG_track_fields || !representation.IsSmi()) { | 715 if (!representation.IsSmi()) { |
716 // Skip updating write barrier if storing a smi. | 716 // Skip updating write barrier if storing a smi. |
717 __ JumpIfSmi(value_reg, &exit); | 717 __ JumpIfSmi(value_reg, &exit); |
718 | 718 |
719 // Update the write barrier for the array address. | 719 // Update the write barrier for the array address. |
720 // Ok to clobber receiver_reg and name_reg, since we return. | 720 // Ok to clobber receiver_reg and name_reg, since we return. |
721 __ mov(name_reg, value_reg); | 721 __ mov(name_reg, value_reg); |
722 __ RecordWriteField(scratch1, | 722 __ RecordWriteField(scratch1, |
723 offset, | 723 offset, |
724 name_reg, | 724 name_reg, |
725 receiver_reg, | 725 receiver_reg, |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1583 // ----------------------------------- | 1583 // ----------------------------------- |
1584 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1584 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1585 } | 1585 } |
1586 | 1586 |
1587 | 1587 |
1588 #undef __ | 1588 #undef __ |
1589 | 1589 |
1590 } } // namespace v8::internal | 1590 } } // namespace v8::internal |
1591 | 1591 |
1592 #endif // V8_TARGET_ARCH_ARM | 1592 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |