| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 (num_parameters - 1 - i) * kPointerSize; | 200 (num_parameters - 1 - i) * kPointerSize; |
| 201 // Load parameter from stack. | 201 // Load parameter from stack. |
| 202 __ mov(eax, Operand(ebp, parameter_offset)); | 202 __ mov(eax, Operand(ebp, parameter_offset)); |
| 203 // Store it in the context. | 203 // Store it in the context. |
| 204 int context_offset = Context::SlotOffset(slot->index()); | 204 int context_offset = Context::SlotOffset(slot->index()); |
| 205 __ mov(Operand(esi, context_offset), eax); | 205 __ mov(Operand(esi, context_offset), eax); |
| 206 // Update the write barrier. This clobbers all involved | 206 // Update the write barrier. This clobbers all involved |
| 207 // registers, so we have to use a third register to avoid | 207 // registers, so we have to use a third register to avoid |
| 208 // clobbering esi. | 208 // clobbering esi. |
| 209 __ mov(ecx, esi); | 209 __ mov(ecx, esi); |
| 210 __ RecordWrite(ecx, context_offset, eax, ebx, kDontSaveFPRegs); | 210 __ RecordWriteContextSlot(ecx, |
| 211 context_offset, |
| 212 eax, |
| 213 ebx, |
| 214 kDontSaveFPRegs); |
| 211 } | 215 } |
| 212 } | 216 } |
| 213 Comment(";;; End allocate local context"); | 217 Comment(";;; End allocate local context"); |
| 214 } | 218 } |
| 215 | 219 |
| 216 // Trace the call. | 220 // Trace the call. |
| 217 if (FLAG_trace) { | 221 if (FLAG_trace) { |
| 218 // We have not executed any compiled code yet, so esi still holds the | 222 // We have not executed any compiled code yet, so esi still holds the |
| 219 // incoming context. | 223 // incoming context. |
| 220 __ CallRuntime(Runtime::kTraceEnter, 0); | 224 __ CallRuntime(Runtime::kTraceEnter, 0); |
| (...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2106 } | 2110 } |
| 2107 | 2111 |
| 2108 | 2112 |
| 2109 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2113 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
| 2110 Register context = ToRegister(instr->context()); | 2114 Register context = ToRegister(instr->context()); |
| 2111 Register value = ToRegister(instr->value()); | 2115 Register value = ToRegister(instr->value()); |
| 2112 __ mov(ContextOperand(context, instr->slot_index()), value); | 2116 __ mov(ContextOperand(context, instr->slot_index()), value); |
| 2113 if (instr->needs_write_barrier()) { | 2117 if (instr->needs_write_barrier()) { |
| 2114 Register temp = ToRegister(instr->TempAt(0)); | 2118 Register temp = ToRegister(instr->TempAt(0)); |
| 2115 int offset = Context::SlotOffset(instr->slot_index()); | 2119 int offset = Context::SlotOffset(instr->slot_index()); |
| 2116 __ RecordWrite(context, offset, value, temp, kSaveFPRegs); | 2120 __ RecordWriteContextSlot(context, offset, value, temp, kSaveFPRegs); |
| 2117 } | 2121 } |
| 2118 } | 2122 } |
| 2119 | 2123 |
| 2120 | 2124 |
| 2121 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2125 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| 2122 Register object = ToRegister(instr->InputAt(0)); | 2126 Register object = ToRegister(instr->InputAt(0)); |
| 2123 Register result = ToRegister(instr->result()); | 2127 Register result = ToRegister(instr->result()); |
| 2124 if (instr->hydrogen()->is_in_object()) { | 2128 if (instr->hydrogen()->is_in_object()) { |
| 2125 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); | 2129 __ mov(result, FieldOperand(object, instr->hydrogen()->offset())); |
| 2126 } else { | 2130 } else { |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2835 if (!instr->transition().is_null()) { | 2839 if (!instr->transition().is_null()) { |
| 2836 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); | 2840 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); |
| 2837 } | 2841 } |
| 2838 | 2842 |
| 2839 // Do the store. | 2843 // Do the store. |
| 2840 if (instr->is_in_object()) { | 2844 if (instr->is_in_object()) { |
| 2841 __ mov(FieldOperand(object, offset), value); | 2845 __ mov(FieldOperand(object, offset), value); |
| 2842 if (instr->needs_write_barrier()) { | 2846 if (instr->needs_write_barrier()) { |
| 2843 Register temp = ToRegister(instr->TempAt(0)); | 2847 Register temp = ToRegister(instr->TempAt(0)); |
| 2844 // Update the write barrier for the object for in-object properties. | 2848 // Update the write barrier for the object for in-object properties. |
| 2845 __ RecordWrite(object, offset, value, temp, kSaveFPRegs); | 2849 __ RecordWriteField(object, offset, value, temp, kSaveFPRegs); |
| 2846 } | 2850 } |
| 2847 } else { | 2851 } else { |
| 2848 Register temp = ToRegister(instr->TempAt(0)); | 2852 Register temp = ToRegister(instr->TempAt(0)); |
| 2849 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset)); | 2853 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset)); |
| 2850 __ mov(FieldOperand(temp, offset), value); | 2854 __ mov(FieldOperand(temp, offset), value); |
| 2851 if (instr->needs_write_barrier()) { | 2855 if (instr->needs_write_barrier()) { |
| 2852 // Update the write barrier for the properties array. | 2856 // Update the write barrier for the properties array. |
| 2853 // object is used as a scratch register. | 2857 // object is used as a scratch register. |
| 2854 __ RecordWrite(temp, offset, value, object, kSaveFPRegs); | 2858 __ RecordWriteField(temp, offset, value, object, kSaveFPRegs); |
| 2855 } | 2859 } |
| 2856 } | 2860 } |
| 2857 } | 2861 } |
| 2858 | 2862 |
| 2859 | 2863 |
| 2860 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 2864 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 2861 ASSERT(ToRegister(instr->context()).is(esi)); | 2865 ASSERT(ToRegister(instr->context()).is(esi)); |
| 2862 ASSERT(ToRegister(instr->object()).is(edx)); | 2866 ASSERT(ToRegister(instr->object()).is(edx)); |
| 2863 ASSERT(ToRegister(instr->value()).is(eax)); | 2867 ASSERT(ToRegister(instr->value()).is(eax)); |
| 2864 | 2868 |
| (...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3998 ASSERT(osr_pc_offset_ == -1); | 4002 ASSERT(osr_pc_offset_ == -1); |
| 3999 osr_pc_offset_ = masm()->pc_offset(); | 4003 osr_pc_offset_ = masm()->pc_offset(); |
| 4000 } | 4004 } |
| 4001 | 4005 |
| 4002 | 4006 |
| 4003 #undef __ | 4007 #undef __ |
| 4004 | 4008 |
| 4005 } } // namespace v8::internal | 4009 } } // namespace v8::internal |
| 4006 | 4010 |
| 4007 #endif // V8_TARGET_ARCH_IA32 | 4011 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |