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

Unified Diff: src/global-handles.cc

Issue 1375613005: Version 4.8.2.1 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.8.2
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/global-handles.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index ebb2837730949224e01f9ef54e718d06b4c43bd0..650999f394c5cc7c2e5397afff53c74e3c186d20 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -64,11 +64,7 @@ class GlobalHandles::Node {
class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
index_ = 0;
set_independent(false);
- if (FLAG_scavenge_reclaim_unmodified_objects) {
- set_unmodified(false);
- } else {
- set_partially_dependent(false);
- }
+ set_partially_dependent(false);
set_in_new_space_list(false);
parameter_or_next_free_.next_free = NULL;
weak_callback_ = NULL;
@@ -81,9 +77,6 @@ class GlobalHandles::Node {
set_state(FREE);
set_weakness_type(NORMAL_WEAK);
set_in_new_space_list(false);
- if (FLAG_scavenge_reclaim_unmodified_objects) {
- set_unmodified(false);
- }
parameter_or_next_free_.next_free = *first_free;
*first_free = this;
}
@@ -93,11 +86,7 @@ class GlobalHandles::Node {
object_ = object;
class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
set_independent(false);
- if (FLAG_scavenge_reclaim_unmodified_objects) {
- set_unmodified(false);
- } else {
- set_partially_dependent(false);
- }
+ set_partially_dependent(false);
set_state(NORMAL);
parameter_or_next_free_.parameter = NULL;
weak_callback_ = NULL;
@@ -117,11 +106,7 @@ class GlobalHandles::Node {
object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue);
class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
set_independent(false);
- if (FLAG_scavenge_reclaim_unmodified_objects) {
- set_unmodified(false);
- } else {
- set_partially_dependent(false);
- }
+ set_partially_dependent(false);
weak_callback_ = NULL;
DecreaseBlockUses();
}
@@ -155,23 +140,12 @@ class GlobalHandles::Node {
}
bool is_partially_dependent() {
- CHECK(!FLAG_scavenge_reclaim_unmodified_objects);
return IsPartiallyDependent::decode(flags_);
}
void set_partially_dependent(bool v) {
- CHECK(!FLAG_scavenge_reclaim_unmodified_objects);
flags_ = IsPartiallyDependent::update(flags_, v);
}
- bool is_unmodified() {
- CHECK(FLAG_scavenge_reclaim_unmodified_objects);
- return IsUnmodified::decode(flags_);
- }
- void set_unmodified(bool v) {
- CHECK(FLAG_scavenge_reclaim_unmodified_objects);
- flags_ = IsUnmodified::update(flags_, v);
- }
-
bool is_in_new_space_list() {
return IsInNewSpaceList::decode(flags_);
}
@@ -375,8 +349,6 @@ class GlobalHandles::Node {
// in_new_space_list) and a State.
class NodeState : public BitField<State, 0, 3> {};
class IsIndependent : public BitField<bool, 3, 1> {};
- // The following two fields are mutually exclusive
- class IsUnmodified : public BitField<bool, 4, 1> {};
class IsPartiallyDependent : public BitField<bool, 4, 1> {};
class IsInNewSpaceList : public BitField<bool, 5, 1> {};
class NodeWeaknessType : public BitField<WeaknessType, 6, 2> {};
@@ -674,18 +646,10 @@ void GlobalHandles::IdentifyWeakHandles(WeakSlotCallback f) {
void GlobalHandles::IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v) {
for (int i = 0; i < new_space_nodes_.length(); ++i) {
Node* node = new_space_nodes_[i];
- if (FLAG_scavenge_reclaim_unmodified_objects) {
- if (node->IsStrongRetainer() ||
- (node->IsWeakRetainer() && !node->is_independent() &&
- !node->is_unmodified())) {
+ if (node->IsStrongRetainer() ||
+ (node->IsWeakRetainer() && !node->is_independent() &&
+ !node->is_partially_dependent())) {
v->VisitPointer(node->location());
- }
- } else {
- if (node->IsStrongRetainer() ||
- (node->IsWeakRetainer() && !node->is_independent() &&
- !node->is_partially_dependent())) {
- v->VisitPointer(node->location());
- }
}
}
}
@@ -723,49 +687,6 @@ void GlobalHandles::IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v) {
}
-void GlobalHandles::IdentifyWeakUnmodifiedObjects(
- WeakSlotCallback is_unmodified) {
- for (int i = 0; i < new_space_nodes_.length(); ++i) {
- Node* node = new_space_nodes_[i];
- if (node->IsWeak() && is_unmodified(node->location())) {
- node->set_unmodified(true);
- }
- }
-}
-
-
-void GlobalHandles::MarkNewSpaceWeakUnmodifiedObjectsPending(
- WeakSlotCallbackWithHeap is_unscavenged) {
- for (int i = 0; i < new_space_nodes_.length(); ++i) {
- Node* node = new_space_nodes_[i];
- DCHECK(node->is_in_new_space_list());
- if ((node->is_independent() || node->is_unmodified()) && node->IsWeak() &&
- is_unscavenged(isolate_->heap(), node->location())) {
- node->MarkPending();
- }
- }
-}
-
-
-void GlobalHandles::IterateNewSpaceWeakUnmodifiedRoots(ObjectVisitor* v) {
- for (int i = 0; i < new_space_nodes_.length(); ++i) {
- Node* node = new_space_nodes_[i];
- DCHECK(node->is_in_new_space_list());
- if ((node->is_independent() || node->is_unmodified()) &&
- node->IsWeakRetainer()) {
- // Pending weak phantom handles die immediately. Everything else survives.
- if (node->state() == Node::PENDING &&
- node->weakness_type() != NORMAL_WEAK) {
- node->CollectPhantomCallbackData(isolate(),
- &pending_phantom_callbacks_);
- } else {
- v->VisitPointer(node->location());
- }
- }
- }
-}
-
-
bool GlobalHandles::IterateObjectGroups(ObjectVisitor* v,
WeakSlotCallbackWithHeap can_skip) {
ComputeObjectGroupsAndImplicitReferences();
@@ -836,22 +757,13 @@ int GlobalHandles::PostScavengeProcessing(
// the freed_nodes.
continue;
}
- // Skip dependent or unmodified handles. Their weak callbacks might expect
- // to be
+ // Skip dependent handles. Their weak callbacks might expect to be
// called between two global garbage collection callbacks which
// are not called for minor collections.
- if (FLAG_scavenge_reclaim_unmodified_objects) {
- if (!node->is_independent() && !node->is_unmodified()) {
- continue;
- }
- node->set_unmodified(false);
- } else {
- if (!node->is_independent() && !node->is_partially_dependent()) {
- continue;
- }
- node->clear_partially_dependent();
+ if (!node->is_independent() && !node->is_partially_dependent()) {
+ continue;
}
-
+ node->clear_partially_dependent();
if (node->PostGarbageCollectionProcessing(isolate_)) {
if (initial_post_gc_processing_count != post_gc_processing_count_) {
// Weak callback triggered another GC and another round of
@@ -878,11 +790,7 @@ int GlobalHandles::PostMarkSweepProcessing(
// the freed_nodes.
continue;
}
- if (FLAG_scavenge_reclaim_unmodified_objects) {
- it.node()->set_unmodified(false);
- } else {
- it.node()->clear_partially_dependent();
- }
+ it.node()->clear_partially_dependent();
if (it.node()->PostGarbageCollectionProcessing(isolate_)) {
if (initial_post_gc_processing_count != post_gc_processing_count_) {
// See the comment above.
« no previous file with comments | « src/global-handles.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698