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

Unified Diff: lib/compiler/implementation/ssa/codegen.dart

Issue 10378047: Fix bad precedence for >>> operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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 | tests/language/positive_bit_operations_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/codegen.dart
diff --git a/lib/compiler/implementation/ssa/codegen.dart b/lib/compiler/implementation/ssa/codegen.dart
index bba4c84b24d20d54d0b9aeff979f2d74eedb3cc2..4db186fc3a19e2d12810997f879c1e1b85b3bb9f 100644
--- a/lib/compiler/implementation/ssa/codegen.dart
+++ b/lib/compiler/implementation/ssa/codegen.dart
@@ -1121,8 +1121,11 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
visitBitInvokeBinary(HBinaryBitOp node, String op) {
if (node.builtin){
beginExpression(unsignedShiftPrecedences.precedence);
+ int oldPrecedence = this.expectedPrecedence;
+ this.expectedPrecedence = JSPrecedence.SHIFT_PRECEDENCE;
visitInvokeBinary(node, op);
buffer.add(' >>> 0');
+ this.expectedPrecedence = oldPrecedence;
endExpression(unsignedShiftPrecedences.precedence);
} else {
visitInvokeBinary(node, op);
@@ -1145,8 +1148,11 @@ class SsaCodeGenerator implements HVisitor, HBlockInformationVisitor {
visitBitInvokeUnary(HInvokeUnary node, String op) {
if (node.builtin){
beginExpression(unsignedShiftPrecedences.precedence);
+ int oldPrecedence = this.expectedPrecedence;
+ this.expectedPrecedence = JSPrecedence.SHIFT_PRECEDENCE;
visitInvokeUnary(node, op);
buffer.add(' >>> 0');
+ this.expectedPrecedence = oldPrecedence;
endExpression(unsignedShiftPrecedences.precedence);
} else {
visitInvokeUnary(node, op);
« no previous file with comments | « no previous file | tests/language/positive_bit_operations_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698