~ubuntu-branches/ubuntu/saucy/libv8/saucy

« back to all changes in this revision

Viewing changes to src/incremental-marking.cc

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-04-07 16:26:13 UTC
  • mfrom: (15.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120407162613-dqo1m6w9r3fh8tst
Tags: 3.8.9.16-3
* mipsel build fixes :
  + v8_use_mips_abi_hardfloat=false, this lowers EABI requirements.
  + v8_can_use_fpu_instructions=false, detect if FPU is present.
  + set -Wno-unused-but-set-variable only on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
    MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
226
226
    if (mark_bit.data_only()) {
227
227
      if (incremental_marking_->MarkBlackOrKeepGrey(mark_bit)) {
228
 
        MemoryChunk::IncrementLiveBytes(heap_object->address(),
229
 
                                        heap_object->Size());
 
228
        MemoryChunk::IncrementLiveBytesFromGC(heap_object->address(),
 
229
                                              heap_object->Size());
230
230
      }
231
231
    } else if (Marking::IsWhite(mark_bit)) {
232
232
      incremental_marking_->WhiteToGreyAndPush(heap_object, mark_bit);
263
263
    MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
264
264
    if (mark_bit.data_only()) {
265
265
      if (incremental_marking_->MarkBlackOrKeepGrey(mark_bit)) {
266
 
          MemoryChunk::IncrementLiveBytes(heap_object->address(),
267
 
                                          heap_object->Size());
 
266
          MemoryChunk::IncrementLiveBytesFromGC(heap_object->address(),
 
267
                                                heap_object->Size());
268
268
      }
269
269
    } else {
270
270
      if (Marking::IsWhite(mark_bit)) {
418
418
 
419
419
static void PatchIncrementalMarkingRecordWriteStubs(
420
420
    Heap* heap, RecordWriteStub::Mode mode) {
421
 
  NumberDictionary* stubs = heap->code_stubs();
 
421
  UnseededNumberDictionary* stubs = heap->code_stubs();
422
422
 
423
423
  int capacity = stubs->Capacity();
424
424
  for (int i = 0; i < capacity; i++) {
491
491
    HeapObject* heap_obj = HeapObject::cast(obj);
492
492
    MarkBit mark_bit = Marking::MarkBitFrom(HeapObject::cast(obj));
493
493
    if (Marking::IsBlack(mark_bit)) {
494
 
      MemoryChunk::IncrementLiveBytes(heap_obj->address(),
495
 
                                      -heap_obj->Size());
 
494
      MemoryChunk::IncrementLiveBytesFromGC(heap_obj->address(),
 
495
                                            -heap_obj->Size());
496
496
    }
497
497
    Marking::AnyToGrey(mark_bit);
498
498
  }
505
505
  }
506
506
 
507
507
  is_compacting_ = !FLAG_never_compact && (flag == ALLOW_COMPACTION) &&
508
 
      heap_->mark_compact_collector()->StartCompaction();
 
508
      heap_->mark_compact_collector()->StartCompaction(
 
509
          MarkCompactCollector::INCREMENTAL_COMPACTION);
509
510
 
510
511
  state_ = MARKING;
511
512
 
658
659
      MarkBit mark_bit = Marking::MarkBitFrom(obj);
659
660
      ASSERT(!Marking::IsBlack(mark_bit));
660
661
      Marking::MarkBlack(mark_bit);
661
 
      MemoryChunk::IncrementLiveBytes(obj->address(), obj->Size());
 
662
      MemoryChunk::IncrementLiveBytesFromGC(obj->address(), obj->Size());
662
663
    }
663
664
    state_ = COMPLETE;
664
665
    if (FLAG_trace_incremental_marking) {
671
672
  if (FLAG_cleanup_code_caches_at_gc) {
672
673
    PolymorphicCodeCache* poly_cache = heap_->polymorphic_code_cache();
673
674
    Marking::GreyToBlack(Marking::MarkBitFrom(poly_cache));
674
 
    MemoryChunk::IncrementLiveBytes(poly_cache->address(),
675
 
                                    PolymorphicCodeCache::kSize);
 
675
    MemoryChunk::IncrementLiveBytesFromGC(poly_cache->address(),
 
676
                                          PolymorphicCodeCache::kSize);
676
677
  }
677
678
 
678
679
  Object* context = heap_->global_contexts_list();
685
686
      MarkBit mark_bit = Marking::MarkBitFrom(cache);
686
687
      if (Marking::IsGrey(mark_bit)) {
687
688
        Marking::GreyToBlack(mark_bit);
688
 
        MemoryChunk::IncrementLiveBytes(cache->address(), cache->Size());
 
689
        MemoryChunk::IncrementLiveBytesFromGC(cache->address(), cache->Size());
689
690
      }
690
691
    }
691
692
    context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK);
748
749
  if (FLAG_trace_incremental_marking) {
749
750
    PrintF("[IncrementalMarking] Complete (normal).\n");
750
751
  }
751
 
  heap_->isolate()->stack_guard()->RequestGC();
 
752
  if (!heap_->idle_notification_will_schedule_next_gc()) {
 
753
    heap_->isolate()->stack_guard()->RequestGC();
 
754
  }
752
755
}
753
756
 
754
757
 
776
779
  }
777
780
 
778
781
  if (state_ == SWEEPING) {
779
 
    if (heap_->old_pointer_space()->AdvanceSweeper(bytes_to_process) &&
780
 
        heap_->old_data_space()->AdvanceSweeper(bytes_to_process)) {
 
782
    if (heap_->AdvanceSweepers(static_cast<int>(bytes_to_process))) {
781
783
      bytes_scanned_ = 0;
782
784
      StartMarking(PREVENT_COMPACTION);
783
785
    }
818
820
      SLOW_ASSERT(Marking::IsGrey(obj_mark_bit) ||
819
821
                  (obj->IsFiller() && Marking::IsWhite(obj_mark_bit)));
820
822
      Marking::MarkBlack(obj_mark_bit);
821
 
      MemoryChunk::IncrementLiveBytes(obj->address(), size);
 
823
      MemoryChunk::IncrementLiveBytesFromGC(obj->address(), size);
822
824
    }
823
825
    if (marking_deque_.IsEmpty()) MarkingComplete();
824
826
  }