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

Side by Side Diff: src/x64/macro-assembler-x64.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/x64/lithium-codegen-x64.cc ('k') | src/x64/macro-assembler-x64.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_X64_MACRO_ASSEMBLER_X64_H_ 5 #ifndef V8_X64_MACRO_ASSEMBLER_X64_H_
6 #define V8_X64_MACRO_ASSEMBLER_X64_H_ 6 #define V8_X64_MACRO_ASSEMBLER_X64_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"
(...skipping 11 matching lines...) Expand all
22 const int kSmiConstantRegisterValue = 1; 22 const int kSmiConstantRegisterValue = 1;
23 // Actual value of root register is offset from the root array's start 23 // Actual value of root register is offset from the root array's start
24 // to take advantage of negitive 8-bit displacement values. 24 // to take advantage of negitive 8-bit displacement values.
25 const int kRootRegisterBias = 128; 25 const int kRootRegisterBias = 128;
26 26
27 // Convenience for platform-independent signatures. 27 // Convenience for platform-independent signatures.
28 typedef Operand MemOperand; 28 typedef Operand MemOperand;
29 29
30 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET }; 30 enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
31 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK }; 31 enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
32 enum PointersToHereCheck {
33 kPointersToHereMaybeInteresting,
34 kPointersToHereAreAlwaysInteresting
35 };
32 36
33 enum SmiOperationConstraint { 37 enum SmiOperationConstraint {
34 PRESERVE_SOURCE_REGISTER, 38 PRESERVE_SOURCE_REGISTER,
35 BAILOUT_ON_NO_OVERFLOW, 39 BAILOUT_ON_NO_OVERFLOW,
36 BAILOUT_ON_OVERFLOW, 40 BAILOUT_ON_OVERFLOW,
37 NUMBER_OF_CONSTRAINTS 41 NUMBER_OF_CONSTRAINTS
38 }; 42 };
39 43
40 STATIC_ASSERT(NUMBER_OF_CONSTRAINTS <= 8); 44 STATIC_ASSERT(NUMBER_OF_CONSTRAINTS <= 8);
41 45
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // stored. value and scratch registers are clobbered by the operation. 217 // stored. value and scratch registers are clobbered by the operation.
214 // The offset is the offset from the start of the object, not the offset from 218 // The offset is the offset from the start of the object, not the offset from
215 // the tagged HeapObject pointer. For use with FieldOperand(reg, off). 219 // the tagged HeapObject pointer. For use with FieldOperand(reg, off).
216 void RecordWriteField( 220 void RecordWriteField(
217 Register object, 221 Register object,
218 int offset, 222 int offset,
219 Register value, 223 Register value,
220 Register scratch, 224 Register scratch,
221 SaveFPRegsMode save_fp, 225 SaveFPRegsMode save_fp,
222 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, 226 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
223 SmiCheck smi_check = INLINE_SMI_CHECK); 227 SmiCheck smi_check = INLINE_SMI_CHECK,
228 PointersToHereCheck pointers_to_here_check_for_value =
229 kPointersToHereMaybeInteresting);
224 230
225 // As above, but the offset has the tag presubtracted. For use with 231 // As above, but the offset has the tag presubtracted. For use with
226 // Operand(reg, off). 232 // Operand(reg, off).
227 void RecordWriteContextSlot( 233 void RecordWriteContextSlot(
228 Register context, 234 Register context,
229 int offset, 235 int offset,
230 Register value, 236 Register value,
231 Register scratch, 237 Register scratch,
232 SaveFPRegsMode save_fp, 238 SaveFPRegsMode save_fp,
233 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, 239 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
234 SmiCheck smi_check = INLINE_SMI_CHECK) { 240 SmiCheck smi_check = INLINE_SMI_CHECK,
241 PointersToHereCheck pointers_to_here_check_for_value =
242 kPointersToHereMaybeInteresting) {
235 RecordWriteField(context, 243 RecordWriteField(context,
236 offset + kHeapObjectTag, 244 offset + kHeapObjectTag,
237 value, 245 value,
238 scratch, 246 scratch,
239 save_fp, 247 save_fp,
240 remembered_set_action, 248 remembered_set_action,
241 smi_check); 249 smi_check,
250 pointers_to_here_check_for_value);
242 } 251 }
243 252
244 // Notify the garbage collector that we wrote a pointer into a fixed array. 253 // Notify the garbage collector that we wrote a pointer into a fixed array.
245 // |array| is the array being stored into, |value| is the 254 // |array| is the array being stored into, |value| is the
246 // object being stored. |index| is the array index represented as a non-smi. 255 // object being stored. |index| is the array index represented as a non-smi.
247 // All registers are clobbered by the operation RecordWriteArray 256 // All registers are clobbered by the operation RecordWriteArray
248 // filters out smis so it does not update the write barrier if the 257 // filters out smis so it does not update the write barrier if the
249 // value is a smi. 258 // value is a smi.
250 void RecordWriteArray( 259 void RecordWriteArray(
251 Register array, 260 Register array,
252 Register value, 261 Register value,
253 Register index, 262 Register index,
254 SaveFPRegsMode save_fp, 263 SaveFPRegsMode save_fp,
255 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, 264 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
256 SmiCheck smi_check = INLINE_SMI_CHECK); 265 SmiCheck smi_check = INLINE_SMI_CHECK,
266 PointersToHereCheck pointers_to_here_check_for_value =
267 kPointersToHereMaybeInteresting);
268
269 void RecordWriteForMap(
270 Register object,
271 Register map,
272 Register dst,
273 SaveFPRegsMode save_fp);
257 274
258 // For page containing |object| mark region covering |address| 275 // For page containing |object| mark region covering |address|
259 // dirty. |object| is the object being stored into, |value| is the 276 // dirty. |object| is the object being stored into, |value| is the
260 // object being stored. The address and value registers are clobbered by the 277 // object being stored. The address and value registers are clobbered by the
261 // operation. RecordWrite filters out smis so it does not update 278 // operation. RecordWrite filters out smis so it does not update
262 // the write barrier if the value is a smi. 279 // the write barrier if the value is a smi.
263 void RecordWrite( 280 void RecordWrite(
264 Register object, 281 Register object,
265 Register address, 282 Register address,
266 Register value, 283 Register value,
267 SaveFPRegsMode save_fp, 284 SaveFPRegsMode save_fp,
268 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET, 285 RememberedSetAction remembered_set_action = EMIT_REMEMBERED_SET,
269 SmiCheck smi_check = INLINE_SMI_CHECK); 286 SmiCheck smi_check = INLINE_SMI_CHECK,
287 PointersToHereCheck pointers_to_here_check_for_value =
288 kPointersToHereMaybeInteresting);
270 289
271 // --------------------------------------------------------------------------- 290 // ---------------------------------------------------------------------------
272 // Debugger Support 291 // Debugger Support
273 292
274 void DebugBreak(); 293 void DebugBreak();
275 294
276 // Generates function and stub prologue code. 295 // Generates function and stub prologue code.
277 void StubPrologue(); 296 void StubPrologue();
278 void Prologue(bool code_pre_aging); 297 void Prologue(bool code_pre_aging);
279 298
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 masm->popfq(); \ 1616 masm->popfq(); \
1598 } \ 1617 } \
1599 masm-> 1618 masm->
1600 #else 1619 #else
1601 #define ACCESS_MASM(masm) masm-> 1620 #define ACCESS_MASM(masm) masm->
1602 #endif 1621 #endif
1603 1622
1604 } } // namespace v8::internal 1623 } } // namespace v8::internal
1605 1624
1606 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_ 1625 #endif // V8_X64_MACRO_ASSEMBLER_X64_H_
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/macro-assembler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698