template <typename T>
-inline bool Handle<T>::is_identical_to(const Handle<T> other) const {
+inline bool Handle<T>::is_identical_to(const Handle<T> o) const {
ASSERT(location_ == NULL || !(*location_)->IsFailure());
- if (location_ == other.location_) return true;
- if (location_ == NULL || other.location_ == NULL) return false;
// Dereferencing deferred handles to check object equality is safe.
- SLOW_ASSERT(IsDereferenceAllowed(NO_DEFERRED_CHECK) &&
- other.IsDereferenceAllowed(NO_DEFERRED_CHECK));
- return *location_ == *other.location_;
+ SLOW_ASSERT(
+ (location_ == NULL || IsDereferenceAllowed(NO_DEFERRED_CHECK)) &&
+ (o.location_ == NULL || o.IsDereferenceAllowed(NO_DEFERRED_CHECK)));
+ if (location_ == o.location_) return true;
+ if (location_ == NULL || o.location_ == NULL) return false;
+ return *location_ == *o.location_;
}
}
HSimulate* simulate = first_simulate_.at(successor_id);
if (simulate == NULL) continue;
- ASSERT(simulate->closure().is_identical_to(
- block->last_environment()->closure()));
+ ASSERT(VerifyClosures(simulate->closure(),
+ block->last_environment()->closure()));
ZapEnvironmentSlot(i, simulate);
}
}
if (!marker->CheckFlag(HValue::kEndsLiveRange)) return;
HSimulate* simulate = marker->next_simulate();
if (simulate != NULL) {
- ASSERT(simulate->closure().is_identical_to(marker->closure()));
+ ASSERT(VerifyClosures(simulate->closure(), marker->closure()));
ZapEnvironmentSlot(marker->index(), simulate);
}
}
}
}
+
+#ifdef DEBUG
+bool HEnvironmentLivenessAnalysisPhase::VerifyClosures(
+ Handle<JSFunction> a, Handle<JSFunction> b) {
+ Heap::RelocationLock for_heap_access(isolate()->heap());
+ AllowHandleDereference for_verification;
+ return a.is_identical_to(b);
+}
+#endif
+
} } // namespace v8::internal
void ZapEnvironmentSlotsForInstruction(HEnvironmentMarker* marker);
void UpdateLivenessAtBlockEnd(HBasicBlock* block, BitVector* live);
void UpdateLivenessAtInstruction(HInstruction* instr, BitVector* live);
+#ifdef DEBUG
+ bool VerifyClosures(Handle<JSFunction> a, Handle<JSFunction> b);
+#endif
int block_count_;