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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10642026: Do not issue Mint/Smi code sequence if we have only Smi/Smi comnbination. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « no previous file | no next file » | 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 9039)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -132,18 +132,19 @@
bool FlowGraphOptimizer::TryReplaceWithBinaryOp(InstanceCallComp* comp,
Token::Kind op_kind) {
BinaryOpComp::OperandsType operands_type;
- if ((op_kind == Token::kBIT_AND) && HasTwoMintOrSmi(*comp->ic_data())) {
- operands_type = BinaryOpComp::kMintOperands;
- } else if (comp->ic_data()->NumberOfChecks() != 1) {
- // TODO(srdjan): Not yet supported.
- return false;
- } else if (HasTwoSmi(*comp->ic_data())) {
+ if ((comp->ic_data()->NumberOfChecks() == 1) && HasTwoSmi(*comp->ic_data())) {
if (op_kind == Token::kDIV ||
op_kind == Token::kMOD) {
// TODO(srdjan): Not yet supported.
return false;
regis 2012/06/22 20:09:03 With this change, you will not inline kBIT_AND wit
srdjan 2012/06/22 20:36:47 As discussed, the code is correct but complicated.
}
operands_type = BinaryOpComp::kSmiOperands;
+ } else if ((op_kind == Token::kBIT_AND) &&
+ HasTwoMintOrSmi(*comp->ic_data())) {
+ operands_type = BinaryOpComp::kMintOperands;
+ } else if (comp->ic_data()->NumberOfChecks() != 1) {
+ // TODO(srdjan): Not yet supported.
+ return false;
} else if (HasTwoDouble(*comp->ic_data())) {
if (op_kind != Token::kADD &&
op_kind != Token::kSUB &&
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698