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

« back to all changes in this revision

Viewing changes to src/mark-compact.h

  • 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:
1
 
// Copyright 2011 the V8 project authors. All rights reserved.
 
1
// Copyright 2012 the V8 project authors. All rights reserved.
2
2
// Redistribution and use in source and binary forms, with or without
3
3
// modification, are permitted provided that the following conditions are
4
4
// met:
198
198
    ASSERT(object->IsHeapObject());
199
199
    if (IsFull()) {
200
200
      Marking::BlackToGrey(object);
201
 
      MemoryChunk::IncrementLiveBytes(object->address(), -object->Size());
 
201
      MemoryChunk::IncrementLiveBytesFromGC(object->address(), -object->Size());
202
202
      SetOverflowed();
203
203
    } else {
204
204
      array_[top_] = object;
374
374
  static const int kNumberOfElements = 1021;
375
375
 
376
376
 private:
377
 
  static const int kChainLengthThreshold = 6;
 
377
  static const int kChainLengthThreshold = 15;
378
378
 
379
379
  intptr_t idx_;
380
380
  intptr_t chain_length_;
407
407
  // object from the forwarding address of the previous live object in the
408
408
  // page as input, and is updated to contain the offset to be used for the
409
409
  // next live object in the same page.  For spaces using a different
410
 
  // encoding (ie, contiguous spaces), the offset parameter is ignored.
 
410
  // encoding (i.e., contiguous spaces), the offset parameter is ignored.
411
411
  typedef void (*EncodingFunction)(Heap* heap,
412
412
                                   HeapObject* old_object,
413
413
                                   int object_size,
441
441
  // Performs a global garbage collection.
442
442
  void CollectGarbage();
443
443
 
444
 
  bool StartCompaction();
 
444
  enum CompactionMode {
 
445
    INCREMENTAL_COMPACTION,
 
446
    NON_INCREMENTAL_COMPACTION
 
447
  };
 
448
 
 
449
  bool StartCompaction(CompactionMode mode);
445
450
 
446
451
  void AbortCompaction();
447
452
 
572
577
  // heap.
573
578
  bool sweep_precisely_;
574
579
 
 
580
  bool reduce_memory_footprint_;
 
581
 
575
582
  // True if we are collecting slots to perform evacuation from evacuation
576
583
  // candidates.
577
584
  bool compacting_;
580
587
 
581
588
  bool collect_maps_;
582
589
 
 
590
  bool flush_monomorphic_ics_;
 
591
 
583
592
  // A pointer to the current stack-allocated GC tracer object during a full
584
593
  // collection (NULL before and after).
585
594
  GCTracer* tracer_;
622
631
 
623
632
  void AfterMarking();
624
633
 
 
634
  // Marks the object black and pushes it on the marking stack.
 
635
  // This is for non-incremental marking.
625
636
  INLINE(void MarkObject(HeapObject* obj, MarkBit mark_bit));
626
637
 
 
638
  INLINE(bool MarkObjectWithoutPush(HeapObject* object));
 
639
  INLINE(void MarkObjectAndPush(HeapObject* value));
 
640
 
 
641
  // Marks the object black.  This is for non-incremental marking.
627
642
  INLINE(void SetMark(HeapObject* obj, MarkBit mark_bit));
628
643
 
 
644
  // Clears the cache of ICs related to this map.
 
645
  INLINE(void ClearCacheOnMap(Map* map));
 
646
 
629
647
  void ProcessNewlyMarkedObject(HeapObject* obj);
630
648
 
631
649
  // Creates back pointers for all map transitions, stores them in
637
655
 
638
656
  // Mark a Map and its DescriptorArray together, skipping transitions.
639
657
  void MarkMapContents(Map* map);
 
658
  void MarkAccessorPairSlot(HeapObject* accessors, int offset);
640
659
  void MarkDescriptorArray(DescriptorArray* descriptors);
641
660
 
642
661
  // Mark the heap roots and all objects reachable from them.
684
703
  // Map transitions from a live map to a dead map must be killed.
685
704
  // We replace them with a null descriptor, with the same key.
686
705
  void ClearNonLiveTransitions();
 
706
  void ClearNonLivePrototypeTransitions(Map* map);
 
707
  void ClearNonLiveMapTransitions(Map* map, MarkBit map_mark);
687
708
 
688
709
  // Marking detaches initial maps from SharedFunctionInfo objects
689
710
  // to make this reference weak. We need to reattach initial maps