| 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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 index -= object->map()->inobject_properties(); | 810 index -= object->map()->inobject_properties(); |
| 811 | 811 |
| 812 if (index < 0) { | 812 if (index < 0) { |
| 813 // Set the property straight into the object. | 813 // Set the property straight into the object. |
| 814 int offset = object->map()->instance_size() + (index * kPointerSize); | 814 int offset = object->map()->instance_size() + (index * kPointerSize); |
| 815 __ mov(FieldOperand(receiver_reg, offset), eax); | 815 __ mov(FieldOperand(receiver_reg, offset), eax); |
| 816 | 816 |
| 817 // Update the write barrier for the array address. | 817 // Update the write barrier for the array address. |
| 818 // Pass the value being stored in the now unused name_reg. | 818 // Pass the value being stored in the now unused name_reg. |
| 819 __ mov(name_reg, Operand(eax)); | 819 __ mov(name_reg, Operand(eax)); |
| 820 __ RecordWrite(receiver_reg, offset, name_reg, scratch, kDontSaveFPRegs); | 820 __ RecordWriteField(receiver_reg, |
| 821 offset, |
| 822 name_reg, |
| 823 scratch, |
| 824 kDontSaveFPRegs); |
| 821 } else { | 825 } else { |
| 822 // Write to the properties array. | 826 // Write to the properties array. |
| 823 int offset = index * kPointerSize + FixedArray::kHeaderSize; | 827 int offset = index * kPointerSize + FixedArray::kHeaderSize; |
| 824 // Get the properties array (optimistically). | 828 // Get the properties array (optimistically). |
| 825 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); | 829 __ mov(scratch, FieldOperand(receiver_reg, JSObject::kPropertiesOffset)); |
| 826 __ mov(FieldOperand(scratch, offset), eax); | 830 __ mov(FieldOperand(scratch, offset), eax); |
| 827 | 831 |
| 828 // Update the write barrier for the array address. | 832 // Update the write barrier for the array address. |
| 829 // Pass the value being stored in the now unused name_reg. | 833 // Pass the value being stored in the now unused name_reg. |
| 830 __ mov(name_reg, Operand(eax)); | 834 __ mov(name_reg, Operand(eax)); |
| 831 __ RecordWrite(scratch, offset, name_reg, receiver_reg, kDontSaveFPRegs); | 835 __ RecordWriteField(scratch, |
| 836 offset, |
| 837 name_reg, |
| 838 receiver_reg, |
| 839 kDontSaveFPRegs); |
| 832 } | 840 } |
| 833 | 841 |
| 834 // Return the value (register eax). | 842 // Return the value (register eax). |
| 835 __ ret(0); | 843 __ ret(0); |
| 836 } | 844 } |
| 837 | 845 |
| 838 | 846 |
| 839 // Generate code to check that a global property cell is empty. Create | 847 // Generate code to check that a global property cell is empty. Create |
| 840 // the property cell at compilation time if no cell exists for the | 848 // the property cell at compilation time if no cell exists for the |
| 841 // property. | 849 // property. |
| (...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2644 __ cmp(cell_operand, FACTORY->the_hole_value()); | 2652 __ cmp(cell_operand, FACTORY->the_hole_value()); |
| 2645 __ j(equal, &miss); | 2653 __ j(equal, &miss); |
| 2646 | 2654 |
| 2647 // Store the value in the cell. | 2655 // Store the value in the cell. |
| 2648 __ mov(cell_operand, eax); | 2656 __ mov(cell_operand, eax); |
| 2649 Label done; | 2657 Label done; |
| 2650 __ test(eax, Immediate(kSmiTagMask)); | 2658 __ test(eax, Immediate(kSmiTagMask)); |
| 2651 __ j(zero, &done); | 2659 __ j(zero, &done); |
| 2652 | 2660 |
| 2653 __ mov(ecx, eax); | 2661 __ mov(ecx, eax); |
| 2662 __ lea(edx, cell_operand); |
| 2654 // Cells are always in the remembered set. | 2663 // Cells are always in the remembered set. |
| 2655 __ RecordWrite(ebx, edx, ecx, OMIT_REMEMBERED_SET, kDontSaveFPRegs); | 2664 __ RecordWrite(ebx, // Object. |
| 2665 edx, // Address. |
| 2666 ecx, // Value. |
| 2667 OMIT_REMEMBERED_SET, |
| 2668 kDontSaveFPRegs, |
| 2669 OMIT_SMI_CHECK); |
| 2656 | 2670 |
| 2657 // Return the value (register eax). | 2671 // Return the value (register eax). |
| 2658 __ bind(&done); | 2672 __ bind(&done); |
| 2659 | 2673 |
| 2660 // Return the value (register eax). | 2674 // Return the value (register eax). |
| 2661 __ IncrementCounter(COUNTERS->named_store_global_inline(), 1); | 2675 __ IncrementCounter(COUNTERS->named_store_global_inline(), 1); |
| 2662 __ ret(0); | 2676 __ ret(0); |
| 2663 | 2677 |
| 2664 // Handle store cache miss. | 2678 // Handle store cache miss. |
| 2665 __ bind(&miss); | 2679 __ bind(&miss); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2746 __ j(above_equal, &miss, not_taken); | 2760 __ j(above_equal, &miss, not_taken); |
| 2747 } else { | 2761 } else { |
| 2748 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); // Compare smis. | 2762 __ cmp(ecx, FieldOperand(edi, FixedArray::kLengthOffset)); // Compare smis. |
| 2749 __ j(above_equal, &miss, not_taken); | 2763 __ j(above_equal, &miss, not_taken); |
| 2750 } | 2764 } |
| 2751 | 2765 |
| 2752 // Do the store and update the write barrier. Make sure to preserve | 2766 // Do the store and update the write barrier. Make sure to preserve |
| 2753 // the value in register eax. | 2767 // the value in register eax. |
| 2754 __ mov(edx, Operand(eax)); | 2768 __ mov(edx, Operand(eax)); |
| 2755 __ mov(FieldOperand(edi, ecx, times_2, FixedArray::kHeaderSize), eax); | 2769 __ mov(FieldOperand(edi, ecx, times_2, FixedArray::kHeaderSize), eax); |
| 2756 __ RecordWrite(edi, 0, edx, ecx, kDontSaveFPRegs); | 2770 __ RecordWriteArray(edi, edx, ecx, kDontSaveFPRegs); |
| 2757 | 2771 |
| 2758 // Done. | 2772 // Done. |
| 2759 __ ret(0); | 2773 __ ret(0); |
| 2760 | 2774 |
| 2761 // Handle store cache miss. | 2775 // Handle store cache miss. |
| 2762 __ bind(&miss); | 2776 __ bind(&miss); |
| 2763 Handle<Code> ic( | 2777 Handle<Code> ic( |
| 2764 Isolate::Current()->builtins()->builtin(Builtins::KeyedStoreIC_Miss)); | 2778 Isolate::Current()->builtins()->builtin(Builtins::KeyedStoreIC_Miss)); |
| 2765 __ jmp(ic, RelocInfo::CODE_TARGET); | 2779 __ jmp(ic, RelocInfo::CODE_TARGET); |
| 2766 | 2780 |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3710 | 3724 |
| 3711 return GetCode(flags); | 3725 return GetCode(flags); |
| 3712 } | 3726 } |
| 3713 | 3727 |
| 3714 | 3728 |
| 3715 #undef __ | 3729 #undef __ |
| 3716 | 3730 |
| 3717 } } // namespace v8::internal | 3731 } } // namespace v8::internal |
| 3718 | 3732 |
| 3719 #endif // V8_TARGET_ARCH_IA32 | 3733 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |