Remove invalid HCheckValue case in check elimination.

Also eliminate a useless copy of the map set in case of
HCheckMaps.

R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/256593011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21033 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
bmeurer@chromium.org 2014-04-29 04:59:37 +00:00
parent cf3a3a8844
commit 01041ce92e

View File

@ -72,10 +72,6 @@ class HCheckTable : public ZoneObject {
ReduceCheckMaps(HCheckMaps::cast(instr)); ReduceCheckMaps(HCheckMaps::cast(instr));
break; break;
} }
case HValue::kCheckValue: {
ReduceCheckValue(HCheckValue::cast(instr));
break;
}
case HValue::kLoadNamedField: { case HValue::kLoadNamedField: {
ReduceLoadNamedField(HLoadNamedField::cast(instr)); ReduceLoadNamedField(HLoadNamedField::cast(instr));
break; break;
@ -305,7 +301,7 @@ class HCheckTable : public ZoneObject {
if (entry != NULL) { if (entry != NULL) {
// entry found; // entry found;
MapSet a = entry->maps_; MapSet a = entry->maps_;
MapSet i = instr->map_set()->Copy(phase_->zone()); const UniqueSet<Map>* i = instr->map_set();
if (a->IsSubset(i)) { if (a->IsSubset(i)) {
// The first check is more strict; the second is redundant. // The first check is more strict; the second is redundant.
if (entry->check_ != NULL) { if (entry->check_ != NULL) {
@ -368,18 +364,6 @@ class HCheckTable : public ZoneObject {
} }
} }
void ReduceCheckValue(HCheckValue* instr) {
// Canonicalize HCheckValues; they might have their values load-eliminated.
HValue* value = instr->Canonicalize();
if (value == NULL) {
instr->DeleteAndReplaceWith(instr->value());
INC_STAT(removed_);
} else if (value != instr) {
instr->DeleteAndReplaceWith(value);
INC_STAT(redundant_);
}
}
void ReduceLoadNamedField(HLoadNamedField* instr) { void ReduceLoadNamedField(HLoadNamedField* instr) {
// Reduce a load of the map field when it is known to be a constant. // Reduce a load of the map field when it is known to be a constant.
if (!IsMapAccess(instr->access())) { if (!IsMapAccess(instr->access())) {