Oz and Mozart Hackers Mailing List

Re: good news from the inline-opcode-map branch


From: Denys Duchier (duchier@ps.uni-sb.de)
Date: Thu Dec 04 2003 - 21:01:25 CET


Hi Kevin,

Thanks for the files, but I am really puzzled. emulate.ii contains the
right code, but it seems to have disappeared in emulate.s. All the
TRUE_... labels and all the .byte instructions are gone. As far as I
can tell, all the bytecode emulation blocks have been optimized away.

My guess is that for your version of gcc, the trick I used (taking and
storing the addresses of the FAKE_... labels) was not sufficient to
convince gcc that these blocks remained reachable.

Here is what you can try in the if (init) { ... } branch of
emulate.cc's engine().

Option 1.

add a static table like there used to be:

static void * fakeInstrTable[] = {
  && FAKE_ENDOFFILE,
  && FAKE_SKIP,
  ...
  && FAKE_ENDOFCHUNK,
  0};

Option 2.

explicitly fake the possibility that we might actually jump to these
FAKE_... labels.

extern int MaybeJumpHere; // not defined in this file: so cannot be
                          // optimized away. Initialize it to -1.

switch (MaybeJumpHere) {
case ENDOFFILE: goto FAKE_ENDOFFILE;
case SKIP: goto FAKE_SKIP;
...
case ENDOFCHUNK: goto FAKE_ENDOFCHUNK;
default: break; // the only alternative we ever take
}

-- 
Dr. Denys Duchier
Équipe Calligramme
LORIA, Nancy, FRANCE
-
Please send submissions to hackers@mozart-oz.org
and administriva mail to hackers-request@mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.



This archive was generated by hypermail 2b29.