[pypy-svn] r52087 - in pypy/branch/fixed-list-ootype/pypy/translator/jvm: . src/pypy test
niko at codespeak.net
niko at codespeak.net
Mon Mar 3 12:47:13 CET 2008
Author: niko
Date: Mon Mar 3 12:47:12 2008
New Revision: 52087
Modified:
pypy/branch/fixed-list-ootype/pypy/translator/jvm/constant.py
pypy/branch/fixed-list-ootype/pypy/translator/jvm/database.py
pypy/branch/fixed-list-ootype/pypy/translator/jvm/generator.py
pypy/branch/fixed-list-ootype/pypy/translator/jvm/src/pypy/PyPy.java
pypy/branch/fixed-list-ootype/pypy/translator/jvm/test/runtest.py
pypy/branch/fixed-list-ootype/pypy/translator/jvm/test/test_builtin.py
pypy/branch/fixed-list-ootype/pypy/translator/jvm/typesystem.py
Log:
all tests pass now: only sig change was the return type
of ll_split_chr became Object[] not ArrayList
Modified: pypy/branch/fixed-list-ootype/pypy/translator/jvm/constant.py
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/jvm/constant.py (original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/jvm/constant.py Mon Mar 3 12:47:12 2008
@@ -188,7 +188,7 @@
PRIORITY = 200
def jtype(self):
- return jPyPyWeakRef
+ return jvm.jPyPyWeakRef
def create_pointer(self, gen):
if not self.value:
Modified: pypy/branch/fixed-list-ootype/pypy/translator/jvm/database.py
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/jvm/database.py (original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/jvm/database.py Mon Mar 3 12:47:12 2008
@@ -499,7 +499,6 @@
def lltype_to_cts(self, OOT):
import sys
res = self._lltype_to_cts(OOT)
- print >> sys.stderr, "lltype_to_cts(%r) -> %r" % (OOT, res)
return res
def _lltype_to_cts(self, OOT):
@@ -531,7 +530,7 @@
# handle externals
if isinstance(OOT, ExternalType):
- return JvmNativeClass(self, OOT)
+ return jvm.JvmNativeClass(self, OOT)
assert False, "Untranslatable type %s!" % OOT
Modified: pypy/branch/fixed-list-ootype/pypy/translator/jvm/generator.py
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/jvm/generator.py (original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/jvm/generator.py Mon Mar 3 12:47:12 2008
@@ -493,7 +493,6 @@
# Determine java type:
jty = self.db.lltype_to_cts(v.concretetype)
import sys
- print >> sys.stderr, "_var_data(%s) -> %r" % (v.name, jty)
# Determine index in stack frame slots:
# note that arguments and locals can be treated the same here
return jty, self.curfunc.var_offset(v, jty)
@@ -842,7 +841,7 @@
greater_equals = lambda self: self._compare_op(jvm.IF_ICMPGE)
def _uint_compare_op(self, cmpopcode):
- PYPYUINTCMP.invoke(self)
+ jvm.PYPYUINTCMP.invoke(self)
self._compare_op(cmpopcode)
u_equals = equals
@@ -876,7 +875,7 @@
long_greater_equals = lambda self: self._long_compare_op(jvm.IFGE)
def _ulong_compare_op(self, cmpopcode):
- PYPYULONGCMP.invoke(self)
+ jvm.PYPYULONGCMP.invoke(self)
self._compare_op(cmpopcode)
ulong_equals = long_equals
Modified: pypy/branch/fixed-list-ootype/pypy/translator/jvm/src/pypy/PyPy.java
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/jvm/src/pypy/PyPy.java (original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/jvm/src/pypy/PyPy.java Mon Mar 3 12:47:12 2008
@@ -724,7 +724,7 @@
return str.substring(start, end);
}
- public static ArrayList ll_split_chr(String str, char c) {
+ public static Object[] ll_split_chr(String str, char c) {
ArrayList list = new ArrayList();
int lastidx = 0, idx = 0;
while ((idx = str.indexOf(c, lastidx)) != -1)
@@ -734,7 +734,7 @@
lastidx = idx+1;
}
list.add(str.substring(lastidx));
- return list;
+ return list.toArray(new String[list.size()]);
}
public static String ll_substring(String str, int start, int cnt) {
Modified: pypy/branch/fixed-list-ootype/pypy/translator/jvm/test/runtest.py
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/jvm/test/runtest.py (original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/jvm/test/runtest.py Mon Mar 3 12:47:12 2008
@@ -118,11 +118,11 @@
return JvmGeneratedSourceWrapper(self._jvm_src)
def _skip_win(self, reason):
- if platform.system() == 'Windows':
+ if hasattr(platform, 'system') and platform.system() == 'Windows':
py.test.skip('Windows --> %s' % reason)
def _skip_powerpc(self, reason):
- if platform.processor() == 'powerpc':
+ if hasattr(platform, 'processor') and platform.processor() == 'powerpc':
py.test.skip('PowerPC --> %s' % reason)
def _skip_llinterpreter(self, reason, skipLL=True, skipOO=True):
Modified: pypy/branch/fixed-list-ootype/pypy/translator/jvm/test/test_builtin.py
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/jvm/test/test_builtin.py (original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/jvm/test/test_builtin.py Mon Mar 3 12:47:12 2008
@@ -3,15 +3,10 @@
from pypy.translator.oosupport.test_template.builtin import BaseTestBuiltin, BaseTestTime
from pypy.translator.jvm.test.runtest import JvmTest
-def skip_win():
- import platform
- if platform.system() == 'Windows':
- py.test.skip("Doesn't work on Windows, yet")
-
class TestJavaBuiltin(JvmTest, BaseTestBuiltin):
def test_os_write_magic(self):
- skip_win()
+ self._skip_win('Not yet')
BaseTestBuiltin.test_os_write_magic(self)
def test_os_path_exists(self):
Modified: pypy/branch/fixed-list-ootype/pypy/translator/jvm/typesystem.py
==============================================================================
--- pypy/branch/fixed-list-ootype/pypy/translator/jvm/typesystem.py (original)
+++ pypy/branch/fixed-list-ootype/pypy/translator/jvm/typesystem.py Mon Mar 3 12:47:12 2008
@@ -345,7 +345,6 @@
return self.methods[methname]
def _add_methods(self):
- from pypy.translator.jvm.generator import Method
for methname, methspec in self.OOTYPE._class_._methods.items():
argtypes = [self.db.annotation_to_cts(arg._type) for arg in
methspec.args]
@@ -384,7 +383,7 @@
def lookup_method(self, methodnm):
jargtypes, jrettype = self.method_types[methodnm]
- return jvmgen.Method.v(self, methodnm, jargtypes, jrettype)
+ return Method.v(self, methodnm, jargtypes, jrettype)
class JvmArrayType(JvmType):
"""
More information about the pypy-svn
mailing list