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

Side by Side Diff: src/incremental-marking.cc

Issue 7329049: Patch RecordWriteStub after adding it to the stub cache not during generation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 5 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // TODO(gc) consider setting this to some low level so that some 298 // TODO(gc) consider setting this to some low level so that some
299 // debug tests run with incremental marking and some without. 299 // debug tests run with incremental marking and some without.
300 static const intptr_t kActivationThreshold = 0; 300 static const intptr_t kActivationThreshold = 0;
301 #endif 301 #endif
302 302
303 return FLAG_incremental_marking && 303 return FLAG_incremental_marking &&
304 heap_->PromotedSpaceSize() > kActivationThreshold; 304 heap_->PromotedSpaceSize() > kActivationThreshold;
305 } 305 }
306 306
307 307
308 void IncrementalMarking::ActivateGeneratedStub(Code* stub) {
309 ASSERT(RecordWriteStub::GetMode(stub) ==
310 RecordWriteStub::STORE_BUFFER_ONLY);
Lasse Reichstein 2011/07/12 06:44:16 Indent to '(' or four chars from start of statemen
Vyacheslav Egorov (Chromium) 2011/07/12 11:17:11 Done.
311
312 if (!IsMarking()) {
313 // Initially stub is generated in STORE_BUFFER_ONLY mode thus
314 // we don't need to do anything if incremental marking is
315 // not active.
316 } else if (IsCompacting()) {
317 RecordWriteStub::Patch(stub, RecordWriteStub::INCREMENTAL_COMPACTION);
318 } else {
319 RecordWriteStub::Patch(stub, RecordWriteStub::INCREMENTAL);
320 }
321 }
322
323
308 static void PatchIncrementalMarkingRecordWriteStubs( 324 static void PatchIncrementalMarkingRecordWriteStubs(
309 Heap* heap, RecordWriteStub::Mode mode) { 325 Heap* heap, RecordWriteStub::Mode mode) {
310 NumberDictionary* stubs = heap->code_stubs(); 326 NumberDictionary* stubs = heap->code_stubs();
311 327
312 int capacity = stubs->Capacity(); 328 int capacity = stubs->Capacity();
313 for (int i = 0; i < capacity; i++) { 329 for (int i = 0; i < capacity; i++) {
314 Object* k = stubs->KeyAt(i); 330 Object* k = stubs->KeyAt(i);
315 if (stubs->IsKey(k)) { 331 if (stubs->IsKey(k)) {
316 uint32_t key = NumberToUint32(k); 332 uint32_t key = NumberToUint32(k);
317 333
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 if (FLAG_trace_incremental_marking || FLAG_trace_gc) { 618 if (FLAG_trace_incremental_marking || FLAG_trace_gc) {
603 double end = OS::TimeCurrentMillis(); 619 double end = OS::TimeCurrentMillis();
604 double delta = (end - start); 620 double delta = (end - start);
605 steps_took_ += delta; 621 steps_took_ += delta;
606 steps_took_since_last_gc_ += delta; 622 steps_took_since_last_gc_ += delta;
607 } 623 }
608 } 624 }
609 625
610 626
611 } } // namespace v8::internal 627 } } // namespace v8::internal
OLDNEW
« src/code-stubs.cc ('K') | « src/incremental-marking.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698