Commit cc055d2d authored by ager@chromium.org's avatar ager@chromium.org

Destroyed global handles should not be touched. Added extra

assertions to get errors when first touching the destroyed handle
instead of getting the error when allocating a new handle at some
later point.
Review URL: http://codereview.chromium.org/9741

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@725 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2889b1ea
...@@ -96,6 +96,7 @@ class GlobalHandles::Node : public Malloced { ...@@ -96,6 +96,7 @@ class GlobalHandles::Node : public Malloced {
// Make this handle weak. // Make this handle weak.
void MakeWeak(void* parameter, WeakReferenceCallback callback) { void MakeWeak(void* parameter, WeakReferenceCallback callback) {
LOG(HandleEvent("GlobalHandle::MakeWeak", handle().location())); LOG(HandleEvent("GlobalHandle::MakeWeak", handle().location()));
ASSERT(state_ != DESTROYED);
if (state_ != WEAK && !IsNearDeath()) { if (state_ != WEAK && !IsNearDeath()) {
GlobalHandles::number_of_weak_handles_++; GlobalHandles::number_of_weak_handles_++;
if (object_->IsJSGlobalObject()) { if (object_->IsJSGlobalObject()) {
...@@ -109,6 +110,7 @@ class GlobalHandles::Node : public Malloced { ...@@ -109,6 +110,7 @@ class GlobalHandles::Node : public Malloced {
void ClearWeakness() { void ClearWeakness() {
LOG(HandleEvent("GlobalHandle::ClearWeakness", handle().location())); LOG(HandleEvent("GlobalHandle::ClearWeakness", handle().location()));
ASSERT(state_ != DESTROYED);
if (state_ == WEAK || IsNearDeath()) { if (state_ == WEAK || IsNearDeath()) {
GlobalHandles::number_of_weak_handles_--; GlobalHandles::number_of_weak_handles_--;
if (object_->IsJSGlobalObject()) { if (object_->IsJSGlobalObject()) {
......
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