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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 112243002: Some cleanups, fixes. Parts of the cid guessing CL that was revrted. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('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 31039)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -96,12 +96,21 @@
}
+static bool NoneIsDynamic(const GrowableArray<intptr_t>& cids) {
+ for (intptr_t i = 0; i < cids.length(); i++) {
+ if (cids[i] == kDynamicCid) {
+ return false;
+ }
+ }
+ return true;
+}
+
+
// Attempt to build ICData for call using propagated class-ids.
bool FlowGraphOptimizer::TryCreateICData(InstanceCallInstr* call) {
ASSERT(call->HasICData());
if (call->ic_data()->NumberOfChecks() > 0) {
// This occurs when an instance call has too many checks.
- // TODO(srdjan): Replace IC call with megamorphic call.
return false;
}
GrowableArray<intptr_t> class_ids(call->ic_data()->num_args_tested());
@@ -110,7 +119,7 @@
intptr_t cid = call->PushArgumentAt(i)->value()->Type()->ToCid();
class_ids.Add(cid);
}
- if (class_ids[0] != kDynamicCid) {
+ if (NoneIsDynamic(class_ids)) {
Florian Schneider 2013/12/11 10:41:08 I'd prefer naming this helper the opposite: e.g. O
srdjan 2013/12/11 21:54:59 Aggreed. However, decided to inline the loop and e
ArgumentsDescriptor args_desc(
Array::Handle(ArgumentsDescriptor::New(call->ArgumentCount(),
call->argument_names())));
@@ -6906,20 +6915,17 @@
}
-void ConstantPropagator::VisitBinaryMintOp(
- BinaryMintOpInstr* instr) {
+void ConstantPropagator::VisitBinaryMintOp(BinaryMintOpInstr* instr) {
HandleBinaryOp(instr, instr->op_kind(), *instr->left(), *instr->right());
}
-void ConstantPropagator::VisitShiftMintOp(
- ShiftMintOpInstr* instr) {
+void ConstantPropagator::VisitShiftMintOp(ShiftMintOpInstr* instr) {
HandleBinaryOp(instr, instr->op_kind(), *instr->left(), *instr->right());
}
-void ConstantPropagator::VisitUnaryMintOp(
- UnaryMintOpInstr* instr) {
+void ConstantPropagator::VisitUnaryMintOp(UnaryMintOpInstr* instr) {
// TODO(kmillikin): Handle unary operations.
SetValue(instr, non_constant_);
}
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698