Index: src/global-handles.cc |
diff --git a/src/global-handles.cc b/src/global-handles.cc |
index bfd8357d229cf01f6840755b6f82c08ba1d55d46..8ed6fc9e93b9722f720bc48d01fc0a2d15480f1e 100644 |
--- a/src/global-handles.cc |
+++ b/src/global-handles.cc |
@@ -199,9 +199,9 @@ class GlobalHandles::Node { |
set_independent(true); |
} |
- void MarkPartiallyDependent(GlobalHandles* global_handles) { |
+ void MarkPartiallyDependent() { |
ASSERT(state() != FREE); |
- if (global_handles->isolate()->heap()->InNewSpace(object_)) { |
+ if (GetGlobalHandles()->isolate()->heap()->InNewSpace(object_)) { |
set_partially_dependent(true); |
} |
} |
@@ -231,8 +231,7 @@ class GlobalHandles::Node { |
parameter_or_next_free_.next_free = value; |
} |
- void MakeWeak(GlobalHandles* global_handles, |
- void* parameter, |
+ void MakeWeak(void* parameter, |
RevivableCallback weak_reference_callback, |
NearDeathCallback near_death_callback) { |
ASSERT(state() != FREE); |
@@ -248,7 +247,7 @@ class GlobalHandles::Node { |
} |
} |
- void ClearWeakness(GlobalHandles* global_handles) { |
+ void ClearWeakness() { |
ASSERT(state() != FREE); |
set_state(NORMAL); |
set_parameter(NULL); |
@@ -296,6 +295,7 @@ class GlobalHandles::Node { |
private: |
inline NodeBlock* FindBlock(); |
+ inline GlobalHandles* GetGlobalHandles(); |
inline void IncreaseBlockUses(); |
inline void DecreaseBlockUses(); |
@@ -400,6 +400,11 @@ class GlobalHandles::NodeBlock { |
}; |
+GlobalHandles* GlobalHandles::Node::GetGlobalHandles() { |
+ return FindBlock()->global_handles(); |
+} |
+ |
+ |
GlobalHandles::NodeBlock* GlobalHandles::Node::FindBlock() { |
intptr_t ptr = reinterpret_cast<intptr_t>(this); |
ptr = ptr - index_ * sizeof(Node); |
@@ -507,15 +512,14 @@ void GlobalHandles::MakeWeak(Object** location, |
RevivableCallback weak_reference_callback, |
NearDeathCallback near_death_callback) { |
ASSERT((weak_reference_callback == NULL) != (near_death_callback == NULL)); |
- Node::FromLocation(location)->MakeWeak(this, |
- parameter, |
+ Node::FromLocation(location)->MakeWeak(parameter, |
weak_reference_callback, |
near_death_callback); |
} |
void GlobalHandles::ClearWeakness(Object** location) { |
- Node::FromLocation(location)->ClearWeakness(this); |
+ Node::FromLocation(location)->ClearWeakness(); |
} |
@@ -525,7 +529,7 @@ void GlobalHandles::MarkIndependent(Object** location) { |
void GlobalHandles::MarkPartiallyDependent(Object** location) { |
- Node::FromLocation(location)->MarkPartiallyDependent(this); |
+ Node::FromLocation(location)->MarkPartiallyDependent(); |
} |