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) {
}
void V8::MakeWeak(i::Isolate* isolate,
i::Object** object,
void V8::MakeWeak(i::Object** object,
void* parameters,
RevivableCallback weak_reference_callback,
NearDeathCallback near_death_callback) {
ASSERT(isolate == i::Isolate::Current());
LOG_API(isolate, "MakeWeak");
isolate->global_handles()->MakeWeak(object,
parameters,
weak_reference_callback,
near_death_callback);
i::GlobalHandles::MakeWeak(object,
parameters,
weak_reference_callback,
near_death_callback);
}
void V8::ClearWeak(i::Isolate* isolate, i::Object** obj) {
LOG_API(isolate, "ClearWeak");
isolate->global_handles()->ClearWeakness(obj);
void V8::ClearWeak(i::Object** obj) {
i::GlobalHandles::ClearWeakness(obj);
}
......
......@@ -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();
}
......
......@@ -138,10 +138,10 @@ class GlobalHandles {
// function is invoked (for each handle) with the handle and corresponding
// parameter as arguments. Note: cleared means set to Smi::FromInt(0). The
// reason is that Smi::FromInt(0) does not change during garage collection.
void MakeWeak(Object** location,
void* parameter,
RevivableCallback weak_reference_callback,
NearDeathCallback near_death_callback);
static void MakeWeak(Object** location,
void* parameter,
RevivableCallback weak_reference_callback,
NearDeathCallback near_death_callback);
void RecordStats(HeapStats* stats);
......@@ -158,13 +158,13 @@ class GlobalHandles {
}
// Clear the weakness of a global handle.
void ClearWeakness(Object** location);
static void ClearWeakness(Object** location);
// Clear the weakness of a global handle.
void MarkIndependent(Object** location);
static void MarkIndependent(Object** location);
// Mark the reference to this object externaly unreachable.
void MarkPartiallyDependent(Object** location);
static void MarkPartiallyDependent(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