IsNearDeath needs to include pending nodes
R=svenpanne@chromium.org BUG= Review URL: https://codereview.chromium.org/21466003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16037 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
d5b9616991
commit
eb52c66fd0
@ -5457,6 +5457,7 @@ class Internals {
|
||||
static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3;
|
||||
static const int kNodeStateMask = 0xf;
|
||||
static const int kNodeStateIsWeakValue = 2;
|
||||
static const int kNodeStateIsPendingValue = 3;
|
||||
static const int kNodeStateIsNearDeathValue = 4;
|
||||
static const int kNodeIsIndependentShift = 4;
|
||||
static const int kNodeIsPartiallyDependentShift = 5;
|
||||
@ -5672,8 +5673,10 @@ template <class T>
|
||||
bool Persistent<T>::IsNearDeath() const {
|
||||
typedef internal::Internals I;
|
||||
if (this->IsEmpty()) return false;
|
||||
return I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_)) ==
|
||||
I::kNodeStateIsNearDeathValue;
|
||||
uint8_t node_state =
|
||||
I::GetNodeState(reinterpret_cast<internal::Object**>(this->val_));
|
||||
return node_state == I::kNodeStateIsNearDeathValue ||
|
||||
node_state == I::kNodeStateIsPendingValue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,6 +71,7 @@ class GlobalHandles::Node {
|
||||
STATIC_ASSERT(static_cast<int>(NodeState::kMask) ==
|
||||
Internals::kNodeStateMask);
|
||||
STATIC_ASSERT(WEAK == Internals::kNodeStateIsWeakValue);
|
||||
STATIC_ASSERT(PENDING == Internals::kNodeStateIsPendingValue);
|
||||
STATIC_ASSERT(NEAR_DEATH == Internals::kNodeStateIsNearDeathValue);
|
||||
STATIC_ASSERT(static_cast<int>(IsIndependent::kShift) ==
|
||||
Internals::kNodeIsIndependentShift);
|
||||
|
Loading…
Reference in New Issue
Block a user