[pypy-svn] r64303 - in pypy/trunk: . pypy/translator/jvm pypy/translator/jvm/src
niko at codespeak.net
niko at codespeak.net
Fri Apr 17 19:29:15 CEST 2009
Author: niko
Date: Fri Apr 17 19:29:15 2009
New Revision: 64303
Added:
pypy/trunk/pypy/translator/jvm/src/jasmin.jar (contents, props changed)
Modified:
pypy/trunk/LICENSE
pypy/trunk/pypy/translator/jvm/genjvm.py
Log:
add jasmin.jar into repository so it's always available
Modified: pypy/trunk/LICENSE
==============================================================================
--- pypy/trunk/LICENSE (original)
+++ pypy/trunk/LICENSE Fri Apr 17 19:29:15 2009
@@ -132,3 +132,20 @@
The file 'pypy/translator/jvm/src/jna.jar' is licensed under the GNU
Lesser General Public License of which you can find a copy here:
http://www.gnu.org/licenses/lgpl.html
+
+License for 'pypy/translator/jvm/src/jasmin.jar'
+=============================================
+
+The file 'pypy/translator/jvm/src/jasmin.jar' is copyright (c) 1996-2004 Jon Meyer
+and distributed with permission. The use of Jasmin by PyPy does not imply
+that PyPy is endorsed by Jon Meyer nor any of Jasmin's contributors. Furthermore,
+the following disclaimer applies to Jasmin:
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Modified: pypy/trunk/pypy/translator/jvm/genjvm.py
==============================================================================
--- pypy/trunk/pypy/translator/jvm/genjvm.py (original)
+++ pypy/trunk/pypy/translator/jvm/genjvm.py Fri Apr 17 19:29:15 2009
@@ -79,6 +79,13 @@
self.package = package
self.compiled = False
self.jasmin_files = None
+
+ # Determine various paths:
+ self.thisdir = py.magic.autopath().dirpath()
+ self.rootdir = self.thisdir.join('src')
+ self.srcdir = self.rootdir.join('pypy')
+ self.jnajar = self.rootdir.join('jna.jar')
+ self.jasminjar = self.rootdir.join('jasmin.jar')
# Compute directory where .j files are
self.javadir = self.tmpdir
@@ -109,13 +116,9 @@
def _compile_helper(self):
# HACK: compile the Java helper classes. Should eventually
# use rte.py
- thisdir = py.magic.autopath().dirpath()
- rootdir = thisdir.join('src')
- srcdir = rootdir.join('pypy')
- javafiles = srcdir.listdir('*.java')
- classfiles = srcdir.listdir('*.class')
- jnajar = rootdir.join('jna.jar')
-
+ javafiles = self.srcdir.listdir('*.java')
+ classfiles = self.srcdir.listdir('*.class')
+
recompile = True
if len(classfiles) == len(javafiles):
last_modified_java = max([java.mtime() for java in javafiles])
@@ -128,20 +131,25 @@
javasrcs = [str(jf) for jf in javafiles]
self._invoke([getoption('javac'),
'-nowarn',
- '-d', str(rootdir),
- '-classpath', str(jnajar)
+ '-d', str(self.rootdir),
+ '-classpath', str(self.jnajar)
] + javasrcs,
True)
# copy .class files to classdir
- for classfile in srcdir.listdir('*.class'):
+ for classfile in self.srcdir.listdir('*.class'):
classfile.copy(self.classdir.join('pypy'))
def compile(self):
"""
Compiles the .java sources into .class files, ready for execution.
"""
- jascmd = [getoption('jasmin'), '-g', '-d', str(self.javadir)]
+ jascmd = [
+ getoption('java'),
+ '-jar', str(self.jasminjar),
+ '-g',
+ '-d',
+ str(self.javadir)]
def split_list(files):
"Split the files list into manageable pieces"
@@ -189,7 +197,7 @@
cmd = [getoption('java'),
'-Xmx256M', # increase the heapsize so the microbenchmarks run
'-cp',
- str(self.javadir),
+ str(self.javadir)+":"+str(self.jnajar),
self.package+".Main"] + strargs
print "Invoking java to run the code"
stdout, stderr, retval = self._invoke(cmd, True)
@@ -225,7 +233,6 @@
def check(exechelper):
if py.path.local.sysfind(exechelper) is None:
py.test.skip("%s is not on your path" % exechelper)
- check(getoption('jasmin'))
check(getoption('javac'))
check(getoption('java'))
Added: pypy/trunk/pypy/translator/jvm/src/jasmin.jar
==============================================================================
Binary file. No diff available.
More information about the Pypy-commit
mailing list