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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 11027060: Faster 64-bit right-shift for the ia32 compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 13286)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -148,7 +148,8 @@
if (join_entry->phis() != NULL) {
for (intptr_t i = 0; i < join_entry->phis()->length(); ++i) {
PhiInstr* phi = (*join_entry->phis())[i];
- if ((phi != NULL) && (phi->GetPropagatedCid() == kDoubleCid)) {
+ if (phi == NULL) continue;
+ if (phi->GetPropagatedCid() == kDoubleCid) {
phi->set_representation(kUnboxedDouble);
}
}
@@ -520,8 +521,17 @@
return false;
}
break;
+ case Token::kSHR:
+ if (HasOnlyTwoSmi(ic_data)) {
Kevin Millikin (Google) 2012/10/05 12:52:58 Should really be ...TwoSmis.
Florian Schneider 2012/10/05 14:40:31 Done.
+ operands_type = kSmiCid;
+ } else if (HasTwoMintOrSmi(ic_data) &&
+ FlowGraphCompiler::SupportsUnboxedMints()) {
+ operands_type = kMintCid;
+ } else {
+ return false;
+ }
+ break;
case Token::kTRUNCDIV:
- case Token::kSHR:
case Token::kSHL:
if (HasOnlyTwoSmi(ic_data)) {
operands_type = kSmiCid;
@@ -554,9 +564,15 @@
} else if (operands_type == kMintCid) {
Value* left = call->ArgumentAt(0)->value();
Value* right = call->ArgumentAt(1)->value();
- BinaryMintOpInstr* bin_op =
- new BinaryMintOpInstr(op_kind, left, right, call);
- call->ReplaceWith(bin_op, current_iterator());
+ if (op_kind == Token::kSHR) {
+ ShiftMintOpInstr* shift_op =
+ new ShiftMintOpInstr(op_kind, left, right, call);
+ call->ReplaceWith(shift_op, current_iterator());
+ } else {
+ BinaryMintOpInstr* bin_op =
+ new BinaryMintOpInstr(op_kind, left, right, call);
+ call->ReplaceWith(bin_op, current_iterator());
+ }
RemovePushArguments(call);
} else if (op_kind == Token::kMOD) {
// TODO(vegorov): implement fast path code for modulo.
@@ -2983,6 +2999,13 @@
}
+void ConstantPropagator::VisitShiftMintOp(
+ ShiftMintOpInstr* instr) {
+ // TODO(kmillikin): Handle shift operations.
+ SetValue(instr, non_constant_);
+}
+
+
void ConstantPropagator::VisitUnaryMintOp(
UnaryMintOpInstr* instr) {
// TODO(kmillikin): Handle unary operations.

Powered by Google App Engine
This is Rietveld 408576698