Revision: 6082
Author: [email protected]
Date: Mon Dec 20 05:18:47 2010
Log: Fix GVN for polymorphic loads.
They must not be hoisted above the compare-map-and-branch.
Review URL: http://codereview.chromium.org/5971003
http://code.google.com/p/v8/source/detail?r=6082
Modified:
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/src/hydrogen.h
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Fri Dec 17 05:44:19 2010
+++ /branches/bleeding_edge/src/hydrogen.cc Mon Dec 20 05:18:47 2010
@@ -3532,9 +3532,10 @@
maps.Add(map);
HSubgraph* subgraph = CreateBranchSubgraph(environment());
SubgraphScope scope(this, subgraph);
- HInstruction* instr =
+ HLoadNamedField* instr =
BuildLoadNamedField(object, expr, map, &lookup, false);
instr->set_position(expr->position());
+ instr->ClearFlag(HValue::kUseGVN); // Don't do GVN on polymorphic
loads.
PushAndAdd(instr);
subgraphs.Add(subgraph);
} else {
@@ -3573,11 +3574,11 @@
}
-HInstruction* HGraphBuilder::BuildLoadNamedField(HValue* object,
- Property* expr,
- Handle<Map> type,
- LookupResult* lookup,
- bool smi_and_map_check) {
+HLoadNamedField* HGraphBuilder::BuildLoadNamedField(HValue* object,
+ Property* expr,
+ Handle<Map> type,
+ LookupResult* lookup,
+ bool
smi_and_map_check) {
if (smi_and_map_check) {
AddInstruction(new HCheckNonSmi(object));
AddInstruction(new HCheckMap(object, type));
=======================================
--- /branches/bleeding_edge/src/hydrogen.h Thu Dec 16 05:13:36 2010
+++ /branches/bleeding_edge/src/hydrogen.h Mon Dec 20 05:18:47 2010
@@ -786,11 +786,11 @@
HValue* left,
HValue* right);
HInstruction* BuildIncrement(HValue* value, bool increment);
- HInstruction* BuildLoadNamedField(HValue* object,
- Property* expr,
- Handle<Map> type,
- LookupResult* result,
- bool smi_and_map_check);
+ HLoadNamedField* BuildLoadNamedField(HValue* object,
+ Property* expr,
+ Handle<Map> type,
+ LookupResult* result,
+ bool smi_and_map_check);
HInstruction* BuildLoadNamedGeneric(HValue* object, Property* expr);
HInstruction* BuildLoadKeyedFastElement(HValue* object,
HValue* key,
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev