Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: src/hydrogen.cc

Issue 5971003: Fix GVN for polymorphic loads.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/hydrogen.cc
===================================================================
--- src/hydrogen.cc (revision 6079)
+++ src/hydrogen.cc (working copy)
@@ -1455,6 +1455,13 @@
HBasicBlock* loop_header) {
if (!instr->IsChange() &&
FLAG_aggressive_loop_invariant_motion) return true;
+
+ // Don't hoist named loads that are part of polymorphic loads.
+ if (instr->IsLoadNamedField() &&
Kevin Millikin (Chromium) 2010/12/20 12:34:34 You could accomplish essentially the same thing by
+ HLoadNamedField::cast(instr)->is_polymorphic()) {
+ return false;
+ }
+
HBasicBlock* block = instr->block();
bool result = true;
if (block != loop_header) {
@@ -3532,9 +3539,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->set_is_polymorphic(true);
PushAndAdd(instr);
subgraphs.Add(subgraph);
} else {
@@ -3573,11 +3581,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));
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-instructions.h » ('j') | src/hydrogen-instructions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698