Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 6824078: Move most of the incremental marking write barrier to generated code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
2830 if (!instr->transition().is_null()) { 2834 if (!instr->transition().is_null()) {
2831 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition()); 2835 __ mov(FieldOperand(object, HeapObject::kMapOffset), instr->transition());
2832 } 2836 }
2833 2837
2834 // Do the store. 2838 // Do the store.
2835 if (instr->is_in_object()) { 2839 if (instr->is_in_object()) {
2836 __ mov(FieldOperand(object, offset), value); 2840 __ mov(FieldOperand(object, offset), value);
2837 if (instr->needs_write_barrier()) { 2841 if (instr->needs_write_barrier()) {
2838 Register temp = ToRegister(instr->TempAt(0)); 2842 Register temp = ToRegister(instr->TempAt(0));
2839 // Update the write barrier for the object for in-object properties. 2843 // Update the write barrier for the object for in-object properties.
2840 __ RecordWrite(object, offset, value, temp, kSaveFPRegs); 2844 __ RecordWriteField(object, offset, value, temp, kSaveFPRegs);
2841 } 2845 }
2842 } else { 2846 } else {
2843 Register temp = ToRegister(instr->TempAt(0)); 2847 Register temp = ToRegister(instr->TempAt(0));
2844 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset)); 2848 __ mov(temp, FieldOperand(object, JSObject::kPropertiesOffset));
2845 __ mov(FieldOperand(temp, offset), value); 2849 __ mov(FieldOperand(temp, offset), value);
2846 if (instr->needs_write_barrier()) { 2850 if (instr->needs_write_barrier()) {
2847 // Update the write barrier for the properties array. 2851 // Update the write barrier for the properties array.
2848 // object is used as a scratch register. 2852 // object is used as a scratch register.
2849 __ RecordWrite(temp, offset, value, object, kSaveFPRegs); 2853 __ RecordWriteField(temp, offset, value, object, kSaveFPRegs);
2850 } 2854 }
2851 } 2855 }
2852 } 2856 }
2853 2857
2854 2858
2855 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { 2859 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) {
2856 ASSERT(ToRegister(instr->context()).is(esi)); 2860 ASSERT(ToRegister(instr->context()).is(esi));
2857 ASSERT(ToRegister(instr->object()).is(edx)); 2861 ASSERT(ToRegister(instr->object()).is(edx));
2858 ASSERT(ToRegister(instr->value()).is(eax)); 2862 ASSERT(ToRegister(instr->value()).is(eax));
2859 2863
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after
3993 ASSERT(osr_pc_offset_ == -1); 3997 ASSERT(osr_pc_offset_ == -1);
3994 osr_pc_offset_ = masm()->pc_offset(); 3998 osr_pc_offset_ = masm()->pc_offset();
3995 } 3999 }
3996 4000
3997 4001
3998 #undef __ 4002 #undef __
3999 4003
4000 } } // namespace v8::internal 4004 } } // namespace v8::internal
4001 4005
4002 #endif // V8_TARGET_ARCH_IA32 4006 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698