Commits

Alex Gaynor  committed 661d7f7

Inline into rbigint so that comparisons can be constant folded.

  • Participants
  • Parent commits 9b895ea

Comments (0)

Files changed (4)

File pypy/module/pypyjit/policy.py

     def look_inside_function(self, func):
         mod = func.__module__ or '?'
 
-        if mod == 'rpython.rlib.rbigint' or mod == 'rpython.rlib.rlocale' or mod == 'rpython.rlib.rsocket':
+        if mod == 'rpython.rlib.rlocale' or mod == 'rpython.rlib.rsocket':
             return False
         if mod.startswith('pypy.interpreter.astcompiler.'):
             return False

File pypy/module/pypyjit/test/test_policy.py

 
 def test_bigint():
     from rpython.rlib.rbigint import rbigint
-    assert not pypypolicy.look_inside_function(rbigint.lt.im_func)
+    assert pypypolicy.look_inside_function(rbigint.lt.im_func)
 
 def test_rlocale():
     from rpython.rlib.rlocale import setlocale

File pypy/module/pypyjit/test_pypy_c/test_misc.py

             jump(..., descr=...)
         """)
 
-
     def test_mixed_type_loop(self):
         def main(n):
             i = 0.0
             jump(..., descr=...)
         """)
 
-
     def test_cached_pure_func_of_equal_fields(self):
         def main(n):
             class A(object):
             jump(..., descr=...)
         """)
 
-
     def test_chain_of_guards(self):
         src = """
         class A(object):
         loops = log.loops_by_filename(self.filepath)
         assert len(loops) == 1
 
-
     def test_unpack_iterable_non_list_tuple(self):
         def main(n):
             import array
             jump(..., descr=...)
         """)
 
-
     def test_dont_trace_every_iteration(self):
         def main(a, b):
             i = sa = 0
         assert log.result == 300 * (-10 % -20)
         assert log.jit_summary.tracing_no == 1
 
-
     def test_overflow_checking(self):
         """
         This test only checks that we get the expected result, not that any
         def main():
             import sys
             def f(a,b):
-                if a < 0: return -1
+                if a < 0:
+                    return -1
                 return a-b
             #
             total = sys.maxint - 2147483647
         #
         self.run_and_check(main, [])
 
-
     def test_global(self):
         log = self.run("""
         i = 0
         # the following assertion fails if the loop was cancelled due
         # to "abort: vable escape"
         assert len(log.loops_by_id("exc_info")) == 1
+
+    def test_long_comparison(self):
+        def main(n):
+            while n:
+                12345L > 123L  # ID: long_op
+                n -= 1
+
+        log = self.run(main, [300])
+        loop, = log.loops_by_id("long_op")
+        assert log.match("""
+        """)

File rpython/rtyper/lltypesystem/rstr.py

             newstr = s2.malloc(len1 + len2)
             newstr.copy_contents_from_str(s1, newstr, 0, 0, len1)
         else:
-            newstr = s1.malloc(len1 + len2)            
+            newstr = s1.malloc(len1 + len2)
             newstr.copy_contents(s1, newstr, 0, 0, len1)
         if typeOf(s2) == Ptr(STR):
             newstr.copy_contents_from_str(s2, newstr, 0, len1, len2)