currentTime() on ultra-lame systems

Aaron Harsh ajh at rentrak.com
Mon Mar 9 03:21:45 PST 1998


I've started porting kaffe to our Sequent.  I guess that means you'll 
be hearing a lot from me in the near future.  Hopefully not every one 
of my questions will start a flame war.

Neither the interpreter nor the JIT (x86) run out of the box.  The 
interpreter looked easier to debug, so I'm tackling it first.  Please 
let me know if I'm just fooling myself about the JIT being difficult 
to debug.


Anyway, the first problem was that HelloWorldApp wouldn't run (javac 
wouldn't either, so I compiled on another machine).  I turned 
debugging on in machine.c and got output that looked something like 
this:

  Call to method java/lang/System.<clinit>()V.
  000: INVOKESTATIC
    ARG 0-1: 47
  Call to method
  java/lang/System.nullInputStream()Ljava/io/InputStream;.000:
  INVOKESTATIC
  ARG 0-1: 34 
  Call to native java/lang/System.currentTimeMillis()J.
  003: LCONST_0
  004: LCMP 
  - stack 0: long 0
  - stack 2: long 0 
  005: IFLE  
    ARG 0-1: 5 
  - stack 0: int 0  
  010: NEW 
    ARG 0-1: 11
  013: DUP 
  014: INVOKESPECIAL 
    ARG 0-1: 19  
  - stack 0: ref 8F460 
  Call to method java/lang/NullPointerException.<init>()V.
  000: ALOAD_0

with things going downhill from here (eventually ending with an 
assertion failure and a core dump).

Our Sequent's pretty lame, and doesn't have any way that kaffe (or I) 
could figure out to get millisecond timing [1], so the currentTime 
function in support.c just returned 0.  Making currentTime return 1 
fixes this problem, but this begs a couple questions:

- Why is nullInputStream even checking this?

- Should currentTime return (time(0) * 1000) rather than 0 on 
ultra-lame systems?

- Why does this cause a null pointer exception in the first place? 
Does anyone have any thoughts off the top head?  In particular, is 
the NullPointerException the normal case (and my system's just 
handling exceptions improperly), or does it indicate some other 
problem?


[1] I should say that in COFF compatibility mode there's no way to 
get millisecond timing.  If I didn't want to link with third-party 
COFF libraries our Sequent would instantly lose it's ultra-lame 
status.


Thanks in advance for your help

-- 
Aaron Harsh               ajh at rtk.com                 (503)284-7581 x347
Las opiniones aqui expresadas son exclusivamente personales y no representan
las opiniones del Rentrak Home Entertainment, a menos que se especifique
explicitamente lo contrario.



More information about the kaffe mailing list