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

Unified Diff: vm/flow_graph_optimizer.cc

Issue 10829164: Replace InstanceSetterComp instruction with a plain instance call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: 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 | « vm/flow_graph_optimizer.h ('k') | vm/il_printer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/flow_graph_optimizer.cc
===================================================================
--- vm/flow_graph_optimizer.cc (revision 10227)
+++ vm/flow_graph_optimizer.cc (working copy)
@@ -386,6 +386,9 @@
if ((op_kind == Token::kGET) && TryInlineInstanceGetter(instr, comp)) {
return;
}
+ if ((op_kind == Token::kSET) && TryInlineInstanceSetter(instr, comp)) {
+ return;
+ }
if (TryInlineInstanceMethod(instr, comp)) {
return;
}
@@ -414,7 +417,12 @@
bool FlowGraphOptimizer::TryInlineInstanceSetter(BindInstr* instr,
- InstanceSetterComp* comp) {
+ InstanceCallComp* comp) {
+ if (FLAG_enable_type_checks) {
+ // TODO(srdjan): Add assignable check node if --enable_type_checks.
+ return false;
+ }
+
ASSERT(comp->HasICData());
const ICData& ic_data = *comp->ic_data();
if (ic_data.NumberOfChecks() == 0) {
@@ -434,7 +442,9 @@
return false;
}
// Inline implicit instance setter.
- const Field& field = Field::Handle(GetField(class_id, comp->field_name()));
+ const String& field_name =
+ String::Handle(Field::NameFromSetter(comp->function_name()));
+ const Field& field = Field::Handle(GetField(class_id, field_name));
ASSERT(!field.IsNull());
StoreInstanceFieldComp* store = new StoreInstanceFieldComp(
field,
@@ -443,26 +453,11 @@
comp);
store->set_ic_data(comp->ic_data());
instr->set_computation(store);
- // Remove original push arguments.
- for (intptr_t i = 0; i < comp->ArgumentCount(); ++i) {
- comp->ArgumentAt(i)->RemoveFromGraph();
- }
+ RemovePushArguments(comp);
return true;
}
-void FlowGraphOptimizer::VisitInstanceSetter(InstanceSetterComp* comp,
- BindInstr* instr) {
- // TODO(srdjan): Add assignable check node if --enable_type_checks.
- if (comp->HasICData() && !FLAG_enable_type_checks) {
- if (TryInlineInstanceSetter(instr, comp)) {
- return;
- }
- }
- // TODO(srdjan): Polymorphic dispatch to setters or deoptimize.
-}
-
-
enum IndexedAccessType {
kIndexedLoad,
kIndexedStore
« no previous file with comments | « vm/flow_graph_optimizer.h ('k') | vm/il_printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698