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

Side by Side Diff: src/builtins.cc

Issue 6542047: Basic implementation of incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 10 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 ASSERT(dst != src); // Use MoveElements instead. 288 ASSERT(dst != src); // Use MoveElements instead.
289 ASSERT(dst->map() != Heap::fixed_cow_array_map()); 289 ASSERT(dst->map() != Heap::fixed_cow_array_map());
290 ASSERT(len > 0); 290 ASSERT(len > 0);
291 CopyWords(dst->data_start() + dst_index, 291 CopyWords(dst->data_start() + dst_index,
292 src->data_start() + src_index, 292 src->data_start() + src_index,
293 len); 293 len);
294 WriteBarrierMode mode = dst->GetWriteBarrierMode(*no_gc); 294 WriteBarrierMode mode = dst->GetWriteBarrierMode(*no_gc);
295 if (mode == UPDATE_WRITE_BARRIER) { 295 if (mode == UPDATE_WRITE_BARRIER) {
296 Heap::RecordWrites(dst->address(), dst->OffsetOfElementAt(dst_index), len); 296 Heap::RecordWrites(dst->address(), dst->OffsetOfElementAt(dst_index), len);
297 } 297 }
298 IncrementalMarking::RecordWrites(dst);
298 } 299 }
299 300
300 301
301 static void MoveElements(AssertNoAllocation* no_gc, 302 static void MoveElements(AssertNoAllocation* no_gc,
302 FixedArray* dst, 303 FixedArray* dst,
303 int dst_index, 304 int dst_index,
304 FixedArray* src, 305 FixedArray* src,
305 int src_index, 306 int src_index,
306 int len) { 307 int len) {
307 ASSERT(dst->map() != Heap::fixed_cow_array_map()); 308 ASSERT(dst->map() != Heap::fixed_cow_array_map());
308 memmove(dst->data_start() + dst_index, 309 memmove(dst->data_start() + dst_index,
309 src->data_start() + src_index, 310 src->data_start() + src_index,
310 len * kPointerSize); 311 len * kPointerSize);
311 WriteBarrierMode mode = dst->GetWriteBarrierMode(*no_gc); 312 WriteBarrierMode mode = dst->GetWriteBarrierMode(*no_gc);
312 if (mode == UPDATE_WRITE_BARRIER) { 313 if (mode == UPDATE_WRITE_BARRIER) {
313 Heap::RecordWrites(dst->address(), dst->OffsetOfElementAt(dst_index), len); 314 Heap::RecordWrites(dst->address(), dst->OffsetOfElementAt(dst_index), len);
314 } 315 }
316 IncrementalMarking::RecordWrites(dst);
315 } 317 }
316 318
317 319
318 static void FillWithHoles(FixedArray* dst, int from, int to) { 320 static void FillWithHoles(FixedArray* dst, int from, int to) {
319 ASSERT(dst->map() != Heap::fixed_cow_array_map()); 321 ASSERT(dst->map() != Heap::fixed_cow_array_map());
320 MemsetPointer(dst->data_start() + from, Heap::the_hole_value(), to - from); 322 MemsetPointer(dst->data_start() + from, Heap::the_hole_value(), to - from);
321 } 323 }
322 324
323 325
324 static FixedArray* LeftTrimFixedArray(FixedArray* elms, int to_trim) { 326 static FixedArray* LeftTrimFixedArray(FixedArray* elms, int to_trim) {
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 if (entry->contains(pc)) { 1574 if (entry->contains(pc)) {
1573 return names_[i]; 1575 return names_[i];
1574 } 1576 }
1575 } 1577 }
1576 } 1578 }
1577 return NULL; 1579 return NULL;
1578 } 1580 }
1579 1581
1580 1582
1581 } } // namespace v8::internal 1583 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698