Reviewers: Vyacheslav Egorov,

Description:
Fixed type transitions for mod on ia32.

Previously we got stuck in the int32 state, because this handled everything
without a type transition. Note that other platforms do not have this bug.


Please review this at http://codereview.chromium.org/10083044/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/ia32/code-stubs-ia32.cc


Index: src/ia32/code-stubs-ia32.cc
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc
index 471114cbe4f219e04cb4b921de79326f6d3bebff..02cd83117c8240f03d1b7d480056d5d5938ca080 100644
--- a/src/ia32/code-stubs-ia32.cc
+++ b/src/ia32/code-stubs-ia32.cc
@@ -1745,7 +1745,13 @@ void BinaryOpStub::GenerateInt32Stub(MacroAssembler* masm) {
     }

     case Token::MOD: {
-      // For MOD we go directly to runtime in the non-smi case.
+      Label not_smi, both_smi;
+      __ JumpIfNotSmi(edx, &not_smi, Label::kNear);
+      __ JumpIfSmi(eax, &both_smi, Label::kNear);
+      __ bind(&not_smi);
+      GenerateTypeTransition(masm);
+      __ bind(&both_smi);
+ // If both operands are Smis, use the runtime to calculate the result.
       break;
     }
     case Token::BIT_OR:


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to