Change the default implementation of DataEquals for Hydrogen instructions.

The former default was true. The new default is false and the default
implementation is UNREACHABLE so it asserts in debug builds.  The function
is overridden in all concrete instruction classes that might have the flag
kUseGVN set.

Review URL: http://codereview.chromium.org/6255013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6493 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 75c6bffb
......@@ -490,7 +490,7 @@ void HInstruction::InsertAfter(HInstruction* previous) {
#ifdef DEBUG
void HInstruction::Verify() const {
void HInstruction::Verify() {
// Verify that input operands are defined before use.
HBasicBlock* cur_block = block();
for (int i = 0; i < OperandCount(); ++i) {
......@@ -517,6 +517,11 @@ void HInstruction::Verify() const {
if (HasSideEffects() && !IsOsrEntry()) {
ASSERT(next()->IsSimulate());
}
// Verify that instructions that can be eliminated by GVN have overridden
// HValue::DataEquals. The default implementation is UNREACHABLE. We
// don't actually care whether DataEquals returns true or false here.
if (CheckFlag(kUseGVN)) DataEquals(this);
}
#endif
......@@ -1388,7 +1393,7 @@ HValue* HAdd::EnsureAndPropagateNotMinusZero(BitVector* visited) {
// Node-specific verification code is only included in debug mode.
#ifdef DEBUG
void HPhi::Verify() const {
void HPhi::Verify() {
ASSERT(OperandCount() == block()->predecessors()->length());
for (int i = 0; i < OperandCount(); ++i) {
HValue* value = OperandAt(i);
......@@ -1400,49 +1405,49 @@ void HPhi::Verify() const {
}
void HSimulate::Verify() const {
void HSimulate::Verify() {
HInstruction::Verify();
ASSERT(HasAstId());
}
void HBoundsCheck::Verify() const {
void HBoundsCheck::Verify() {
HInstruction::Verify();
ASSERT(HasNoUses());
}
void HCheckSmi::Verify() const {
void HCheckSmi::Verify() {
HInstruction::Verify();
ASSERT(HasNoUses());
}
void HCheckNonSmi::Verify() const {
void HCheckNonSmi::Verify() {
HInstruction::Verify();
ASSERT(HasNoUses());
}
void HCheckInstanceType::Verify() const {
void HCheckInstanceType::Verify() {
HInstruction::Verify();
ASSERT(HasNoUses());
}
void HCheckMap::Verify() const {
void HCheckMap::Verify() {
HInstruction::Verify();
ASSERT(HasNoUses());
}
void HCheckFunction::Verify() const {
void HCheckFunction::Verify() {
HInstruction::Verify();
ASSERT(HasNoUses());
}
void HCheckPrototypeMaps::Verify() const {
void HCheckPrototypeMaps::Verify() {
HInstruction::Verify();
ASSERT(HasNoUses());
}
......
This diff is collapsed.
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