| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 index -= object->map()->inobject_properties(); | 807 index -= object->map()->inobject_properties(); |
| 808 | 808 |
| 809 if (index < 0) { | 809 if (index < 0) { |
| 810 // Set the property straight into the object. | 810 // Set the property straight into the object. |
| 811 int offset = object->map()->instance_size() + (index * kPointerSize); | 811 int offset = object->map()->instance_size() + (index * kPointerSize); |
| 812 __ mov(FieldOperand(receiver_reg, offset), eax); | 812 __ mov(FieldOperand(receiver_reg, offset), eax); |
| 813 | 813 |
| 814 // Update the write barrier for the array address. | 814 // Update the write barrier for the array address. |
| 815 // Pass the value being stored in the now unused name_reg. | 815 // Pass the value being stored in the now unused name_reg. |
| 816 __ mov(name_reg, Operand(eax)); | 816 __ mov(name_reg, Operand(eax)); |
| 817 __ RecordWrite(receiver_reg, offset, name_reg, scratch, kDontSaveFPRegs); | 817 __ RecordWriteField(receiver_reg, |
| 818 offset, |
| 819 name_reg, |
| 820 scratch, |
| 821 kDontSaveFPRegs); |
| 818 } else { | 822 } else { |
| 819 // Write to the properties array. | 823 // Write to the properties array. |
| 820 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 824 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
| 821 // Get the properties array (optimistically). | 825 // Get the properties array (optimistically). |
| 822 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); | 826 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); |
| 823 __ mov(FieldOperand(scratch, offset), eax); | 827 __ mov(FieldOperand(scratch, offset), eax); |
| 824 | 828 |
| 825 // Update the write barrier for the array address. | 829 // Update the write barrier for the array address. |
| 826 // Pass the value being stored in the now unused name_reg. | 830 // Pass the value being stored in the now unused name_reg. |
| 827 __ mov(name_reg, Operand(eax)); | 831 __ mov(name_reg, Operand(eax)); |
| 828 __ RecordWrite(scratch, offset, name_reg, receiver_reg, kDontSaveFPRegs); | 832 __ RecordWriteField(scratch, |
| 833 offset, |
| 834 name_reg, |
| 835 receiver_reg, |
| 836 kDontSaveFPRegs); |
| 829 } | 837 } |
| 830 | 838 |
| 831 // Return the value (register eax). | 839 // Return the value (register eax). |
| 832 __ ret(0); | 840 __ ret(0); |
| 833 } | 841 } |
| 834 | 842 |
| 835 | 843 |
| 836 // Generate code to check that a global property cell is empty. Create | 844 // Generate code to check that a global property cell is empty. Create |
| 837 // the property cell at compilation time if no cell exists for the | 845 // the property cell at compilation time if no cell exists for the |
| 838 // property. | 846 // property. |
| (...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 __ cmp(cell_operand, Factory::the_hole_value()); | 2644 __ cmp(cell_operand, Factory::the_hole_value()); |
| 2637 __ j(equal, &miss); | 2645 __ j(equal, &miss); |
| 2638 | 2646 |
| 2639 // Store the value in the cell. | 2647 // Store the value in the cell. |
| 2640 __ mov(cell_operand, eax); | 2648 __ mov(cell_operand, eax); |
| 2641 Label done; | 2649 Label done; |
| 2642 __ test(eax, Immediate(kSmiTagMask)); | 2650 __ test(eax, Immediate(kSmiTagMask)); |
| 2643 __ j(zero, &done); | 2651 __ j(zero, &done); |
| 2644 | 2652 |
| 2645 __ mov(ecx, eax); | 2653 __ mov(ecx, eax); |
| 2654 __ lea(edx, cell_operand); |
| 2646 // Cells are always in the remembered set. | 2655 // Cells are always in the remembered set. |
| 2647 __ RecordWrite(ebx, edx, ecx, OMIT_REMEMBERED_SET, kDontSaveFPRegs); | 2656 __ RecordWrite(ebx, // Object. |
| 2657 edx, // Address. |
| 2658 ecx, // Value. |
| 2659 OMIT_REMEMBERED_SET, |
| 2660 kDontSaveFPRegs, |
| 2661 OMIT_SMI_CHECK); |
| 2648 | 2662 |
| 2649 // Return the value (register eax). | 2663 // Return the value (register eax). |
| 2650 __ bind(&done); | 2664 __ bind(&done); |
| 2651 | 2665 |
| 2652 // Return the value (register eax). | 2666 // Return the value (register eax). |
| 2653 __ IncrementCounter(&Counters::named_store_global_inline, 1); | 2667 __ IncrementCounter(&Counters::named_store_global_inline, 1); |
| 2654 __ ret(0); | 2668 __ ret(0); |
| 2655 | 2669 |
| 2656 // Handle store cache miss. | 2670 // Handle store cache miss. |
| 2657 __ bind(&miss); | 2671 __ bind(&miss); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2736 __ j(above_equal, &miss, not_taken); | 2750 __ j(above_equal, &miss, not_taken); |
| 2737 } else { | 2751 } else { |
| 2738 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); // Compare smis. | 2752 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); // Compare smis. |
| 2739 __ j(above_equal, &miss, not_taken); | 2753 __ j(above_equal, &miss, not_taken); |
| 2740 } | 2754 } |
| 2741 | 2755 |
| 2742 // Do the store and update the write barrier. Make sure to preserve | 2756 // Do the store and update the write barrier. Make sure to preserve |
| 2743 // the value in register eax. | 2757 // the value in register eax. |
| 2744 __ mov(edx, Operand(eax)); | 2758 __ mov(edx, Operand(eax)); |
| 2745 __ mov(FieldOperand(edi, ecx, times_2, FixedArray::kHeaderSize), eax); | 2759 __ mov(FieldOperand(edi, ecx, times_2, FixedArray::kHeaderSize), eax); |
| 2746 __ RecordWrite(edi, 0, edx, ecx, kDontSaveFPRegs); | 2760 __ RecordWriteArray(edi, edx, ecx, kDontSaveFPRegs); |
| 2747 | 2761 |
| 2748 // Done. | 2762 // Done. |
| 2749 __ ret(0); | 2763 __ ret(0); |
| 2750 | 2764 |
| 2751 // Handle store cache miss. | 2765 // Handle store cache miss. |
| 2752 __ bind(&miss); | 2766 __ bind(&miss); |
| 2753 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss)); | 2767 Handle<Code> ic(Builtins::builtin(Builtins::KeyedStoreIC_Miss)); |
| 2754 __ jmp(ic, RelocInfo::CODE_TARGET); | 2768 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 2755 | 2769 |
| 2756 // Return the generated code. | 2770 // Return the generated code. |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3698 | 3712 |
| 3699 return GetCode(flags); | 3713 return GetCode(flags); |
| 3700 } | 3714 } |
| 3701 | 3715 |
| 3702 | 3716 |
| 3703 #undef __ | 3717 #undef __ |
| 3704 | 3718 |
| 3705 } } // namespace v8::internal | 3719 } } // namespace v8::internal |
| 3706 | 3720 |
| 3707 #endif // V8_TARGET_ARCH_IA32 | 3721 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |