Print out how many AllocationMementos were found during mark-sweep.
Moreover use the right memory boundary for AllocationMemento lookup during gc. BUG= R=mvstanton@chromium.org Review URL: https://codereview.chromium.org/25655004 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17069 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
72f93382bc
commit
9d732d6594
@ -525,11 +525,10 @@ void Heap::ScavengeObject(HeapObject** p, HeapObject* object) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FLAG_trace_track_allocation_sites &&
|
if (FLAG_trace_track_allocation_sites && object->IsJSObject()) {
|
||||||
AllocationSite::CanTrack(object->map()->instance_type()) &&
|
if (AllocationMemento::FindForJSObject(JSObject::cast(object), true) !=
|
||||||
object->IsJSObject()) {
|
NULL) {
|
||||||
if (AllocationMemento::FindForJSObject(JSObject::cast(object)) != NULL) {
|
object->GetIsolate()->heap()->allocation_mementos_found_++;
|
||||||
object->GetIsolate()->heap()->allocation_mementos_found_on_scavenge_++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ Heap::Heap()
|
|||||||
contexts_disposed_(0),
|
contexts_disposed_(0),
|
||||||
global_ic_age_(0),
|
global_ic_age_(0),
|
||||||
flush_monomorphic_ics_(false),
|
flush_monomorphic_ics_(false),
|
||||||
allocation_mementos_found_on_scavenge_(0),
|
allocation_mementos_found_(0),
|
||||||
scan_on_scavenge_pages_(0),
|
scan_on_scavenge_pages_(0),
|
||||||
new_space_(this),
|
new_space_(this),
|
||||||
old_pointer_space_(NULL),
|
old_pointer_space_(NULL),
|
||||||
@ -1329,7 +1329,7 @@ class ScavengeWeakObjectRetainer : public WeakObjectRetainer {
|
|||||||
void Heap::Scavenge() {
|
void Heap::Scavenge() {
|
||||||
RelocationLock relocation_lock(this);
|
RelocationLock relocation_lock(this);
|
||||||
|
|
||||||
allocation_mementos_found_on_scavenge_ = 0;
|
allocation_mementos_found_ = 0;
|
||||||
|
|
||||||
#ifdef VERIFY_HEAP
|
#ifdef VERIFY_HEAP
|
||||||
if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this);
|
if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this);
|
||||||
@ -1479,10 +1479,9 @@ void Heap::Scavenge() {
|
|||||||
|
|
||||||
scavenges_since_last_idle_round_++;
|
scavenges_since_last_idle_round_++;
|
||||||
|
|
||||||
if (FLAG_trace_track_allocation_sites &&
|
if (FLAG_trace_track_allocation_sites && allocation_mementos_found_ > 0) {
|
||||||
allocation_mementos_found_on_scavenge_ > 0) {
|
|
||||||
PrintF("AllocationMementos found during scavenge = %d\n",
|
PrintF("AllocationMementos found during scavenge = %d\n",
|
||||||
allocation_mementos_found_on_scavenge_);
|
allocation_mementos_found_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1886,8 +1886,8 @@ class Heap {
|
|||||||
|
|
||||||
bool flush_monomorphic_ics_;
|
bool flush_monomorphic_ics_;
|
||||||
|
|
||||||
// AllocationMementos found on scavenge.
|
// AllocationMementos found in new space.
|
||||||
int allocation_mementos_found_on_scavenge_;
|
int allocation_mementos_found_;
|
||||||
|
|
||||||
int scan_on_scavenge_pages_;
|
int scan_on_scavenge_pages_;
|
||||||
|
|
||||||
|
@ -407,6 +407,8 @@ void MarkCompactCollector::CollectGarbage() {
|
|||||||
ASSERT(state_ == PREPARE_GC);
|
ASSERT(state_ == PREPARE_GC);
|
||||||
ASSERT(encountered_weak_collections_ == Smi::FromInt(0));
|
ASSERT(encountered_weak_collections_ == Smi::FromInt(0));
|
||||||
|
|
||||||
|
heap()->allocation_mementos_found_ = 0;
|
||||||
|
|
||||||
MarkLiveObjects();
|
MarkLiveObjects();
|
||||||
ASSERT(heap_->incremental_marking()->IsStopped());
|
ASSERT(heap_->incremental_marking()->IsStopped());
|
||||||
|
|
||||||
@ -449,6 +451,11 @@ void MarkCompactCollector::CollectGarbage() {
|
|||||||
marking_parity_ = EVEN_MARKING_PARITY;
|
marking_parity_ = EVEN_MARKING_PARITY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FLAG_trace_track_allocation_sites &&
|
||||||
|
heap()->allocation_mementos_found_ > 0) {
|
||||||
|
PrintF("AllocationMementos found during mark-sweep = %d\n",
|
||||||
|
heap()->allocation_mementos_found_);
|
||||||
|
}
|
||||||
tracer_ = NULL;
|
tracer_ = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2002,6 +2009,13 @@ int MarkCompactCollector::DiscoverAndPromoteBlackObjectsOnPage(
|
|||||||
int size = object->Size();
|
int size = object->Size();
|
||||||
survivors_size += size;
|
survivors_size += size;
|
||||||
|
|
||||||
|
if (FLAG_trace_track_allocation_sites && object->IsJSObject()) {
|
||||||
|
if (AllocationMemento::FindForJSObject(JSObject::cast(object), true)
|
||||||
|
!= NULL) {
|
||||||
|
heap()->allocation_mementos_found_++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
offset++;
|
offset++;
|
||||||
current_cell >>= 1;
|
current_cell >>= 1;
|
||||||
// Aggressively promote young survivors to the old space.
|
// Aggressively promote young survivors to the old space.
|
||||||
|
@ -9049,7 +9049,8 @@ Handle<String> SeqString::Truncate(Handle<SeqString> string, int new_length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AllocationMemento* AllocationMemento::FindForJSObject(JSObject* object) {
|
AllocationMemento* AllocationMemento::FindForJSObject(JSObject* object,
|
||||||
|
bool in_GC) {
|
||||||
// Currently, AllocationMemento objects are only allocated immediately
|
// Currently, AllocationMemento objects are only allocated immediately
|
||||||
// after JSArrays in NewSpace, and detecting whether a JSArray has one
|
// after JSArrays in NewSpace, and detecting whether a JSArray has one
|
||||||
// involves carefully checking the object immediately after the JSArray
|
// involves carefully checking the object immediately after the JSArray
|
||||||
@ -9057,8 +9058,13 @@ AllocationMemento* AllocationMemento::FindForJSObject(JSObject* object) {
|
|||||||
if (FLAG_track_allocation_sites && object->GetHeap()->InNewSpace(object)) {
|
if (FLAG_track_allocation_sites && object->GetHeap()->InNewSpace(object)) {
|
||||||
Address ptr_end = (reinterpret_cast<Address>(object) - kHeapObjectTag) +
|
Address ptr_end = (reinterpret_cast<Address>(object) - kHeapObjectTag) +
|
||||||
object->Size();
|
object->Size();
|
||||||
if ((ptr_end + AllocationMemento::kSize) <=
|
Address top;
|
||||||
object->GetHeap()->NewSpaceTop()) {
|
if (in_GC) {
|
||||||
|
top = object->GetHeap()->new_space()->FromSpacePageHigh();
|
||||||
|
} else {
|
||||||
|
top = object->GetHeap()->NewSpaceTop();
|
||||||
|
}
|
||||||
|
if ((ptr_end + AllocationMemento::kSize) <= top) {
|
||||||
// There is room in newspace for allocation info. Do we have some?
|
// There is room in newspace for allocation info. Do we have some?
|
||||||
Map** possible_allocation_memento_map =
|
Map** possible_allocation_memento_map =
|
||||||
reinterpret_cast<Map**>(ptr_end);
|
reinterpret_cast<Map**>(ptr_end);
|
||||||
|
@ -7889,7 +7889,8 @@ class AllocationMemento: public Struct {
|
|||||||
DECLARE_VERIFIER(AllocationMemento)
|
DECLARE_VERIFIER(AllocationMemento)
|
||||||
|
|
||||||
// Returns NULL if no AllocationMemento is available for object.
|
// Returns NULL if no AllocationMemento is available for object.
|
||||||
static AllocationMemento* FindForJSObject(JSObject* object);
|
static AllocationMemento* FindForJSObject(JSObject* object,
|
||||||
|
bool in_GC = false);
|
||||||
static inline AllocationMemento* cast(Object* obj);
|
static inline AllocationMemento* cast(Object* obj);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user