Commit 7b82ad9b authored by dcarney@chromium.org's avatar dcarney@chromium.org

de-isolate remaining persistent calls

R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/16153003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14868 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 26e7936e
This diff is collapsed.
...@@ -625,23 +625,19 @@ i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) { ...@@ -625,23 +625,19 @@ i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) {
} }
void V8::MakeWeak(i::Isolate* isolate, void V8::MakeWeak(i::Object** object,
i::Object** object,
void* parameters, void* parameters,
RevivableCallback weak_reference_callback, RevivableCallback weak_reference_callback,
NearDeathCallback near_death_callback) { NearDeathCallback near_death_callback) {
ASSERT(isolate == i::Isolate::Current()); i::GlobalHandles::MakeWeak(object,
LOG_API(isolate, "MakeWeak"); parameters,
isolate->global_handles()->MakeWeak(object, weak_reference_callback,
parameters, near_death_callback);
weak_reference_callback,
near_death_callback);
} }
void V8::ClearWeak(i::Isolate* isolate, i::Object** obj) { void V8::ClearWeak(i::Object** obj) {
LOG_API(isolate, "ClearWeak"); i::GlobalHandles::ClearWeakness(obj);
isolate->global_handles()->ClearWeakness(obj);
} }
......
...@@ -199,9 +199,9 @@ class GlobalHandles::Node { ...@@ -199,9 +199,9 @@ class GlobalHandles::Node {
set_independent(true); set_independent(true);
} }
void MarkPartiallyDependent(GlobalHandles* global_handles) { void MarkPartiallyDependent() {
ASSERT(state() != FREE); ASSERT(state() != FREE);
if (global_handles->isolate()->heap()->InNewSpace(object_)) { if (GetGlobalHandles()->isolate()->heap()->InNewSpace(object_)) {
set_partially_dependent(true); set_partially_dependent(true);
} }
} }
...@@ -231,8 +231,7 @@ class GlobalHandles::Node { ...@@ -231,8 +231,7 @@ class GlobalHandles::Node {
parameter_or_next_free_.next_free = value; parameter_or_next_free_.next_free = value;
} }
void MakeWeak(GlobalHandles* global_handles, void MakeWeak(void* parameter,
void* parameter,
RevivableCallback weak_reference_callback, RevivableCallback weak_reference_callback,
NearDeathCallback near_death_callback) { NearDeathCallback near_death_callback) {
ASSERT(state() != FREE); ASSERT(state() != FREE);
...@@ -248,7 +247,7 @@ class GlobalHandles::Node { ...@@ -248,7 +247,7 @@ class GlobalHandles::Node {
} }
} }
void ClearWeakness(GlobalHandles* global_handles) { void ClearWeakness() {
ASSERT(state() != FREE); ASSERT(state() != FREE);
set_state(NORMAL); set_state(NORMAL);
set_parameter(NULL); set_parameter(NULL);
...@@ -296,6 +295,7 @@ class GlobalHandles::Node { ...@@ -296,6 +295,7 @@ class GlobalHandles::Node {
private: private:
inline NodeBlock* FindBlock(); inline NodeBlock* FindBlock();
inline GlobalHandles* GetGlobalHandles();
inline void IncreaseBlockUses(); inline void IncreaseBlockUses();
inline void DecreaseBlockUses(); inline void DecreaseBlockUses();
...@@ -400,6 +400,11 @@ class GlobalHandles::NodeBlock { ...@@ -400,6 +400,11 @@ class GlobalHandles::NodeBlock {
}; };
GlobalHandles* GlobalHandles::Node::GetGlobalHandles() {
return FindBlock()->global_handles();
}
GlobalHandles::NodeBlock* GlobalHandles::Node::FindBlock() { GlobalHandles::NodeBlock* GlobalHandles::Node::FindBlock() {
intptr_t ptr = reinterpret_cast<intptr_t>(this); intptr_t ptr = reinterpret_cast<intptr_t>(this);
ptr = ptr - index_ * sizeof(Node); ptr = ptr - index_ * sizeof(Node);
...@@ -507,15 +512,14 @@ void GlobalHandles::MakeWeak(Object** location, ...@@ -507,15 +512,14 @@ void GlobalHandles::MakeWeak(Object** location,
RevivableCallback weak_reference_callback, RevivableCallback weak_reference_callback,
NearDeathCallback near_death_callback) { NearDeathCallback near_death_callback) {
ASSERT((weak_reference_callback == NULL) != (near_death_callback == NULL)); ASSERT((weak_reference_callback == NULL) != (near_death_callback == NULL));
Node::FromLocation(location)->MakeWeak(this, Node::FromLocation(location)->MakeWeak(parameter,
parameter,
weak_reference_callback, weak_reference_callback,
near_death_callback); near_death_callback);
} }
void GlobalHandles::ClearWeakness(Object** location) { void GlobalHandles::ClearWeakness(Object** location) {
Node::FromLocation(location)->ClearWeakness(this); Node::FromLocation(location)->ClearWeakness();
} }
...@@ -525,7 +529,7 @@ void GlobalHandles::MarkIndependent(Object** location) { ...@@ -525,7 +529,7 @@ void GlobalHandles::MarkIndependent(Object** location) {
void GlobalHandles::MarkPartiallyDependent(Object** location) { void GlobalHandles::MarkPartiallyDependent(Object** location) {
Node::FromLocation(location)->MarkPartiallyDependent(this); Node::FromLocation(location)->MarkPartiallyDependent();
} }
......
...@@ -138,10 +138,10 @@ class GlobalHandles { ...@@ -138,10 +138,10 @@ class GlobalHandles {
// function is invoked (for each handle) with the handle and corresponding // function is invoked (for each handle) with the handle and corresponding
// parameter as arguments. Note: cleared means set to Smi::FromInt(0). The // parameter as arguments. Note: cleared means set to Smi::FromInt(0). The
// reason is that Smi::FromInt(0) does not change during garage collection. // reason is that Smi::FromInt(0) does not change during garage collection.
void MakeWeak(Object** location, static void MakeWeak(Object** location,
void* parameter, void* parameter,
RevivableCallback weak_reference_callback, RevivableCallback weak_reference_callback,
NearDeathCallback near_death_callback); NearDeathCallback near_death_callback);
void RecordStats(HeapStats* stats); void RecordStats(HeapStats* stats);
...@@ -158,13 +158,13 @@ class GlobalHandles { ...@@ -158,13 +158,13 @@ class GlobalHandles {
} }
// Clear the weakness of a global handle. // Clear the weakness of a global handle.
void ClearWeakness(Object** location); static void ClearWeakness(Object** location);
// Clear the weakness of a global handle. // Clear the weakness of a global handle.
void MarkIndependent(Object** location); static void MarkIndependent(Object** location);
// Mark the reference to this object externaly unreachable. // Mark the reference to this object externaly unreachable.
void MarkPartiallyDependent(Object** location); static void MarkPartiallyDependent(Object** location);
static bool IsIndependent(Object** location); static bool IsIndependent(Object** location);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment