Chromium Code Reviews| Index: src/global-handles.cc |
| diff --git a/src/global-handles.cc b/src/global-handles.cc |
| index f9c4a4f580213f833f2833b07ad74459cd32a6a8..4a7292547f1c06b6c180bf09671abfd1492f143e 100644 |
| --- a/src/global-handles.cc |
| +++ b/src/global-handles.cc |
| @@ -78,6 +78,7 @@ class GlobalHandles::Node { |
| #endif |
| void Initialize(int index, Node** first_free) { |
| + object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue); |
|
vogelheim
2016/01/25 12:00:19
nitpick: Wouldn't it be better for debugging to di
jochen (gone - plz use gerrit)
2016/01/25 13:05:48
since we recycle handles, they're expected to cons
|
| index_ = static_cast<uint8_t>(index); |
| DCHECK(static_cast<int>(index_) == index); |
| set_state(FREE); |
| @@ -250,9 +251,9 @@ class GlobalHandles::Node { |
| } |
| void MakeWeak(void* parameter, WeakCallback weak_callback) { |
| - DCHECK(weak_callback != NULL); |
| + DCHECK(weak_callback != nullptr); |
| DCHECK(IsInUse()); |
| - CHECK(object_ != NULL); |
| + CHECK_NE(object_, reinterpret_cast<Object*>(kGlobalHandleZapValue)); |
| set_state(WEAK); |
| set_weakness_type(NORMAL_WEAK); |
| set_parameter(parameter); |
| @@ -264,7 +265,7 @@ class GlobalHandles::Node { |
| v8::WeakCallbackType type) { |
| DCHECK(phantom_callback != nullptr); |
| DCHECK(IsInUse()); |
| - CHECK(object_ != nullptr); |
| + CHECK_NE(object_, reinterpret_cast<Object*>(kGlobalHandleZapValue)); |
| set_state(WEAK); |
| switch (type) { |
| case v8::WeakCallbackType::kParameter: |