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

Side by Side Diff: src/ia32/macro-assembler-ia32.h

Issue 297763006: Improve write barriers in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 6 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
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_
6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_
7 7
8 #include "src/assembler.h" 8 #include "src/assembler.h"
9 #include "src/frames.h" 9 #include "src/frames.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
11 11
12 namespace v8 { 12 namespace v8 {
13 namespace internal { 13 namespace internal {
14 14
15 // Convenience for platform-independent signatures. We do not normally 15 // Convenience for platform-independent signatures. We do not normally
16 // distinguish memory operands from other operands on ia32. 16 // distinguish memory operands from other operands on ia32.
17 typedef Operand MemOperand; 17 typedef Operand MemOperand;
18 18
19 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; 19 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
20 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; 20 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
21 enum PointersToHereCheck {
22 kPointersToHereMaybeInteresting,
23 kPointersToHereAreAlwaysInteresting
24 };
21 25
22 26
23 enum RegisterValueType { 27 enum RegisterValueType {
24 REGISTER_VALUE_IS_SMI, 28 REGISTER_VALUE_IS_SMI,
25 REGISTER_VALUE_IS_INT32 29 REGISTER_VALUE_IS_INT32
26 }; 30 };
27 31
28 32
29 bool AreAliased(Register r1, Register r2, Register r3, Register r4); 33 bool AreAliased(Register r1, Register r2, Register r3, Register r4);
30 34
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // stored. value and scratch registers are clobbered by the operation. 137 // stored. value and scratch registers are clobbered by the operation.
134 // The offset is the offset from the start of the object, not the offset from 138 // The offset is the offset from the start of the object, not the offset from
135 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). 139 // the tagged HeapObject pointer. For use with FieldOperand(reg, off).
136 void RecordWriteField( 140 void RecordWriteField(
137 Register object, 141 Register object,
138 int offset, 142 int offset,
139 Register value, 143 Register value,
140 Register scratch, 144 Register scratch,
141 SaveFPRegsMode save_fp, 145 SaveFPRegsMode save_fp,
142 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, 146 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
143 SmiCheck smi_check = INLINE_SMI_CHECK); 147 SmiCheck smi_check = INLINE_SMI_CHECK,
148 PointersToHereCheck pointers_to_here_check_for_value =
149 kPointersToHereMaybeInteresting);
144 150
145 // As above, but the offset has the tag presubtracted. For use with 151 // As above, but the offset has the tag presubtracted. For use with
146 // Operand(reg, off). 152 // Operand(reg, off).
147 void RecordWriteContextSlot( 153 void RecordWriteContextSlot(
148 Register context, 154 Register context,
149 int offset, 155 int offset,
150 Register value, 156 Register value,
151 Register scratch, 157 Register scratch,
152 SaveFPRegsMode save_fp, 158 SaveFPRegsMode save_fp,
153 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, 159 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
154 SmiCheck smi_check = INLINE_SMI_CHECK) { 160 SmiCheck smi_check = INLINE_SMI_CHECK,
161 PointersToHereCheck pointers_to_here_check_for_value =
162 kPointersToHereMaybeInteresting) {
155 RecordWriteField(context, 163 RecordWriteField(context,
156 offset + kHeapObjectTag, 164 offset + kHeapObjectTag,
157 value, 165 value,
158 scratch, 166 scratch,
159 save_fp, 167 save_fp,
160 remembered_set_action, 168 remembered_set_action,
161 smi_check); 169 smi_check,
170 pointers_to_here_check_for_value);
162 } 171 }
163 172
164 // Notify the garbage collector that we wrote a pointer into a fixed array. 173 // Notify the garbage collector that we wrote a pointer into a fixed array.
165 // |array| is the array being stored into, |value| is the 174 // |array| is the array being stored into, |value| is the
166 // object being stored. |index| is the array index represented as a 175 // object being stored. |index| is the array index represented as a
167 // Smi. All registers are clobbered by the operation RecordWriteArray 176 // Smi. All registers are clobbered by the operation RecordWriteArray
168 // filters out smis so it does not update the write barrier if the 177 // filters out smis so it does not update the write barrier if the
169 // value is a smi. 178 // value is a smi.
170 void RecordWriteArray( 179 void RecordWriteArray(
171 Register array, 180 Register array,
172 Register value, 181 Register value,
173 Register index, 182 Register index,
174 SaveFPRegsMode save_fp, 183 SaveFPRegsMode save_fp,
175 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, 184 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
176 SmiCheck smi_check = INLINE_SMI_CHECK); 185 SmiCheck smi_check = INLINE_SMI_CHECK,
186 PointersToHereCheck pointers_to_here_check_for_value =
187 kPointersToHereMaybeInteresting);
177 188
178 // For page containing |object| mark region covering |address| 189 // For page containing |object| mark region covering |address|
179 // dirty. |object| is the object being stored into, |value| is the 190 // dirty. |object| is the object being stored into, |value| is the
180 // object being stored. The address and value registers are clobbered by the 191 // object being stored. The address and value registers are clobbered by the
181 // operation. RecordWrite filters out smis so it does not update the 192 // operation. RecordWrite filters out smis so it does not update the
182 // write barrier if the value is a smi. 193 // write barrier if the value is a smi.
183 void RecordWrite( 194 void RecordWrite(
184 Register object, 195 Register object,
185 Register address, 196 Register address,
186 Register value, 197 Register value,
187 SaveFPRegsMode save_fp, 198 SaveFPRegsMode save_fp,
188 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, 199 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
189 SmiCheck smi_check = INLINE_SMI_CHECK); 200 SmiCheck smi_check = INLINE_SMI_CHECK,
201 PointersToHereCheck pointers_to_here_check_for_value =
202 kPointersToHereMaybeInteresting);
190 203
191 // For page containing |object| mark the region covering the object's map 204 // For page containing |object| mark the region covering the object's map
192 // dirty. |object| is the object being stored into, |map| is the Map object 205 // dirty. |object| is the object being stored into, |map| is the Map object
193 // that was stored. 206 // that was stored.
194 void RecordWriteForMap( 207 void RecordWriteForMap(
195 Register object, 208 Register object,
196 Handle<Map> map, 209 Handle<Map> map,
197 Register scratch1, 210 Register scratch1,
198 Register scratch2, 211 Register scratch2,
199 SaveFPRegsMode save_fp); 212 SaveFPRegsMode save_fp);
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 } \ 1107 } \
1095 masm-> 1108 masm->
1096 #else 1109 #else
1097 #define ACCESS_MASM(masm) masm-> 1110 #define ACCESS_MASM(masm) masm->
1098 #endif 1111 #endif
1099 1112
1100 1113
1101 } } // namespace v8::internal 1114 } } // namespace v8::internal
1102 1115
1103 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ 1116 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ia32/macro-assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698