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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10917005: Add explicit class checks: LoadVMField. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: removed now unused helper Created 8 years, 4 months 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 11587)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -521,13 +521,14 @@
default:
UNREACHABLE();
}
+ // Check receiver class.
+ AddCheckClass(instr, comp, comp->ArgumentAt(0)->value()->CopyValue());
+
LoadVMFieldComp* load = new LoadVMFieldComp(
comp->ArgumentAt(0)->value(),
length_offset,
Type::ZoneHandle(Type::SmiType()));
load->set_result_cid(kSmiCid);
- load->set_original(comp);
- load->set_ic_data(comp->ic_data());
instr->set_computation(load);
RemovePushArguments(comp);
return true;
@@ -538,14 +539,14 @@
// Target is not only StringBase_get_length.
return false;
}
- ASSERT(HasOneTarget(ic_data));
+ // Check receiver class.
+ AddCheckClass(instr, comp, comp->ArgumentAt(0)->value()->CopyValue());
+
LoadVMFieldComp* load = new LoadVMFieldComp(
comp->ArgumentAt(0)->value(),
String::length_offset(),
Type::ZoneHandle(Type::SmiType()));
load->set_result_cid(kSmiCid);
- load->set_original(comp);
- load->set_ic_data(comp->ic_data());
instr->set_computation(load);
RemovePushArguments(comp);
return true;
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698