Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Creating a new byte-code compatible java vm  (Read 3661 times)
0 Members and 1 Guest are viewing this topic.
Offline zingbat

Senior Member




Java games rock!


« Posted 2005-11-01 13:36:51 »

Are there any legal implications if someone creates a new bytecode compatible java vm ?

The java vm is a great thing but there are some things that are being implemented too slowly or probably never will. For example:

=> No problem with size. You distribute it with whatever packages you want.

=> JIT detects machine instructions that can greatly improve vector and matricial calculations.

=> JIT automatically detects the present of a gpu and generates gpu machine instructions when apropriate.

=> Being able to disable array bound checks for some operations.

=> Having a fast and dirty math option.

=> Having a better interface with C native code that will optionaly inline it and removing unnecessary call machine instruction and stack operations.

When i had an Amiga i used to make mini-games entirely in 68000 assembler for the cpu and the fat agnus assembler language for bliting and sprites. It wasn't that hard. OK so this isn't exactly the Amiga but how hard could it be making a compatible jvm like this ?
Offline elias

Senior Member





« Reply #1 - Posted 2005-11-01 13:55:09 »

...

OK so this isn't exactly the Amiga but how hard could it be making a compatible jvm like this ?


Pretty damn hard Smiley So hard that you'll soon see Jeff come along and try to explain to you how much magic is involved in a high performance JVM. If I were you, and I really really wanted to create my own jvm, I'd take one of the existing open source JVMs out there and modify them.

To answer your first question - it is perfectly legal to create a byte code compatible VM(*).

 - elias

(*) Barring software patents, of course. Creating a VM could easily stumple upon some lame sw pat. from Kodak or someone else.

Offline princec

JGO Kernel


Medals: 378
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2005-11-01 15:25:26 »

So make the VM in the UK then Wink

It's legal to do whatever you like with it but you can't call it Java unless it passes the TCK. And of course it's such a bloody difficult thing to make.

Take a look at Blackdown.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline zingbat

Senior Member




Java games rock!


« Reply #3 - Posted 2005-11-01 16:18:05 »

What would be the hardest part to implement for a javavm in terms of algorithms ?

Edit: In the meantime i found an interesting link about the subject

http://orp.sourceforge.net/
Offline princec

JGO Kernel


Medals: 378
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2005-11-01 19:25:01 »

All the parts are really hard stuff. I wouldn't even think of attempting it without a nice big team and a commercial interest.
On the other hand if you just want to write a bytecode interpreter I expect you could get reasonable enough performance from that to run the kinds of games that I write. Hm. (Wanders off to run Ultratron in interpreted mode) Well, blimey, yes, it would seem that interpreted mode is easily fast enough to push a few hundred sprites around at 60fps.

Cas Smiley

Offline zingbat

Senior Member




Java games rock!


« Reply #5 - Posted 2005-11-01 21:11:02 »

That would be a start. How complicated can be writing a c++ program to load a 1.4 class file and interpret it ?
Offline elias

Senior Member





« Reply #6 - Posted 2005-11-02 07:06:14 »

Loading and interpreting a 1.4 class shouldn't be that hard, however, you won't get anything useful out of it without the vast standard library. So there are two issues, implementing a VM, and implementing the standard library. If you don't need anything from the std. library and are happy with interpreted performance, you should be able to manage it.

 - elias

Offline princec

JGO Kernel


Medals: 378
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #7 - Posted 2005-11-02 09:30:15 »

Fortunately the Classpath project addresses that issue reasonably well.

Cas Smiley

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #8 - Posted 2005-11-02 10:17:20 »

Alien Flux + O.S. bytecode interpreter (I suppose there's several already) + Classpath + (what was the name of that OpenGL-DX wrapper again?) on XBox anyone?  Smiley

Offline princec

JGO Kernel


Medals: 378
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #9 - Posted 2005-11-02 12:13:14 »

I'd use Jet to deploy on Xbox.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #10 - Posted 2005-11-02 13:15:21 »

Creating an arbitrary virtual machine is a no brainer (ie easy), but like everybody else said, it won't do much.  Anything other than System.out.println() will be a pita.
Offline zingbat

Senior Member




Java games rock!


« Reply #11 - Posted 2005-11-02 15:56:52 »

I was looking at the ORP page and there are some things that caught my atention:

Open Source

Quote
To date, an open source research platform that allows interchangeable modules implementing Just-In-Time compilers (JITs) and Garbage Collection (GC) has not been available to the academic research community. ORP (Open Runtime Platform) is an open source research infrastructure project that provides these features thus enabling the rapid evolution of systems research of dynamic compilation and memory management.

Uses GNU Classpath

Quote
Initially ORP interoperates with GNU Classpath. More info is at: http://www.gnu.org/software/classpath/classpath.html.
GNU Classpath is an open source library for the Java* language.

Will compile with mingw or cyguns (obviously).

Quote
win Current ORP source code compiles and runs on IA32 Linux and IA32 Windows 2000. Future updates will include JITs and GCs for IA64. GNU Make makefiles are included for Linux builds. Microsoft VC++ 5.0 project files are included for the Windows 2000 build.

Already comes with a functional JIT

Quote
The basic system incorporates a fast code generating JIT as well as an optimizing JIT. It also includes several GC algorithms, ranging from a simple mark-sweep algorithm to an advanced train algorithm. MRL academic papers on these topics are listed at: http://www.intel.com/research/mrl/library/java-pubs.htm.


Im going to download this and see if i can compile it. Maybe the source is well organize enough to make some small changes.

The most important thing to me would be adding support for native computation of vectors and matrices and removing those nasty array bounds checks.

Being able to inline native assembler code would be very nice but i don't know how this could be done without breaking compatibility with the java vm.
Offline Mark Thornton

Senior Member





« Reply #12 - Posted 2005-11-02 16:19:24 »

removing those nasty array bounds checks.
I think this gets more attention than it deserves. In a number of important cases the HotSpot server can remove these checks safely (or at least hoist them out of loops). Even when they remain they aren't as expensive as many people seem to think (and a lot less expensive than overrunning buffers as Microsoft can no doubt attest).
Offline zingbat

Senior Member




Java games rock!


« Reply #13 - Posted 2005-11-02 20:14:01 »

I think Carmack complained about this when in his Java adventure. It may be more important with apps that use physics packages more intensively.

On another note i tried to compile the orp javavm and it didn't work with mingw lol. Im going to try with cygnus windows later.
Offline Mark Thornton

Senior Member





« Reply #14 - Posted 2005-11-03 11:25:18 »

It may be more important with apps that use physics packages more intensively.
Very likely. However I don't think that just turning of the checks is the correct approach. It would be far preferable to improve the JIT's ability to tell when the checks weren't necessary. For example good Pascal compilers were able to eliminate more checks when the integer subrange types were used appropriately.
Could we add attributes to declarations in Java that made similar assertions. Then so long as the assertion was true the JIT could make more aggressive optimizations. If an assertion was found false then either an exception could be thrown, or the optimizations unwound and the application left to continue and fail in the normal manner when the bad value was used.
Also would it be reasonable for a JIT to take notice of assert statements even when they were 'disabled' --- but of course only when the assert condition is helpful to the optimiser.
Offline zingbat

Senior Member




Java games rock!


« Reply #15 - Posted 2005-11-03 12:15:25 »

Thats a nice idea using the asser clause to provide hints to the vm. It reminds me of a trick used on the new Pentiums where you can insert hint bytes on the machine code to tell the cpu a cycle will succed or fail most of the time.

It's also very easy to extend this hint trick you mentioned without breacking compatibility. For example:

1  
assert ("opt-hint: safe cycle" != null);


The assert would allways succed of course but the vm would detect this expression (or something similar) as an optimization jint and try to interpret it.

This stuff is very interesting. I wish i had more time to work on this stuff.
Offline princec

JGO Kernel


Medals: 378
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #16 - Posted 2005-11-03 13:09:04 »

Annotations would be better.

Cas Smiley

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (29 views)
2014-09-12 09:08:26

Norakomi (57 views)
2014-09-10 13:57:51

TehJavaDev (76 views)
2014-09-10 06:39:09

Tekkerue (38 views)
2014-09-09 02:24:56

mitcheeb (58 views)
2014-09-08 06:06:29

BurntPizza (45 views)
2014-09-07 01:13:42

Longarmx (30 views)
2014-09-07 01:12:14

Longarmx (35 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19

mitcheeb (40 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!