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

Unified Diff: runtime/vm/opt_code_generator_ia32.cc

Issue 9526001: Fix issue 1845: Mint BIT_AND Smi was incorrect for negative Smi-s. Jump to slow case on negative Sm… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 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/standalone/src/MediumIntegerTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/opt_code_generator_ia32.cc
===================================================================
--- runtime/vm/opt_code_generator_ia32.cc (revision 4726)
+++ runtime/vm/opt_code_generator_ia32.cc (working copy)
@@ -1015,8 +1015,8 @@
// Supports some mixed Smi/Mint operations.
-// For BIT_AND operation with one operand being Smi, we can throw away
-// any Mint bits above the Smi range.
+// For BIT_AND operation with right operand being Smi, we can throw away
+// any Mint bits above the Smi range as long as the right operand is positive.
// 'allow_smi' is true if Smi and Mint classes have been encountered.
void OptimizingCodeGenerator::GenerateMintBinaryOp(BinaryOpNode* node,
bool allow_smi) {
@@ -1031,6 +1031,8 @@
VisitLoadTwo(node->left(), node->right(), EAX, EDX);
__ testl(EDX, Immediate(kSmiTagMask));
__ j(NOT_ZERO, &slow_case); // Call operator if right is not Smi.
+ __ cmpl(EDX, Immediate(0));
+ __ j(LESS, &slow_case); // Result will not be Smi.
// Test left.
__ testl(EAX, Immediate(kSmiTagMask));
« no previous file with comments | « no previous file | tests/standalone/src/MediumIntegerTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698