[self-interest] Re: Self on Linux

Gordon Cichon Gordon at Cichon.de
Thu Feb 4 21:15:20 UTC 1999


Douglas Atique wrote:
> 1) the polymorphic situation I described and
> 2) when a method has been called

Douglas,

The problem with this kind of lookup cache is not really one because
at this point. If a method is called where the map does not fit, control
is transferred to `lookup´ - there is not yet an executing stack frame
that has to be converted into a new one.

> I've been looking in the VM code and thought of the following idea: to
> turn off the SIC, I would make the VM think that even when some code is

Turning off SIC seems to be quite easy: Somewhere there is a table of
active compilers that is initialized to use both SIC and NIC. Either
this initialization can be changed, or there is a primitive method
that can be used for configuring this array. I did not yet spend time
for trying it because I did not have problems with it so far.

> One thing I didn't understand in your port is that there is a lot of SPARC
> assembly code bundled in the VM code. Did you change all that or it
> compiles on i386 unchanged?

I changed it everywhere besides SIC. I plugged in gas (the GNU
assembler) to emit the code, and I rewrote the places where code
is actually generated. I already went through 
- fixing the build system
- fixing the Unix library
- rewriting most assembly primitives and runtime code
- plugging in a new assembler
- switching all what´s necessary to run NIC

SIC, as well as recompile/convert is currently disabled with
`#ifdefs' and guarded by `abort()'. Blocks are not yet tested
because cloning (executing) then does not work yet.

Yesterday, I got an evaluation license for Sniff. Let´s see
if I can `domesticate' the stack frame with it. :-)

To imagine how difficult it is to evaluate `1´ with NIC, I
attached the assembler code that it is generating.

-gordon

-- 
----------------------------------------------------
Gordon Cichon          email: Gordon at Cichon.de

--------- 8< ------ 8< ------ 8< ----------

  movl 4(%esp), %ecx
  movl 3(%ecx), %ecx
  cmpl $0x20b1211, %ecx
  je L0
  jmp 0x80c88f4 <Lookup> (p)
L0: 
  // verified entry point:
  // DI entry point:
  // test for recompilation
  movl 0x1fe00000 <??>, %ecx
  incl %ecx
  movl %ecx, 0x1fe00000 <??>
  cmpl $10240, %ecx
  jne L2
  call 0x80f1fc0 <Recompile> (p)
L2: 
  pushl %ebp
  movl %esp, %ebp
  nop 6
  movl %ebx, -12(%ebp)
  // flush incoming args to stack
  // End Prologue
L3: 
  // stack overflow/interrupt check
  cmpl %esp, 124(%esi)
  jl L4
  .align 4, 3
  call 0x80eb0f0 <InterruptCheck> (p)
  jmp L5
  nop 3
  .align 4
  .data 0
  movl -12(%ebp), %ebx
  movl %ebp, %esp
  popl %ebp
  popl %ecx
  jmpl *12(%ecx)
L5: 
L4: 
L6: 
  movl $0x4 (1), %ebx
  movl %ebx, %eax
  movl -12(%ebp), %ebx
  movl %ebp, %esp
  popl %ebp
  ret 
  // patching stack frame creation code
  subl $16, %esp
  nop 3
  // NLR code
  cmpl %esp, 156(%esi)
  je L7
  movl -12(%ebp), %ebx
  movl %ebp, %esp
  popl %ebp
  popl %ecx
  jmpl *12(%ecx)
L7: 
  movl 152(%esi), %eax
  movl -12(%ebp), %ebx
  movl %ebp, %esp
  popl %ebp
  ret

------------------------------------------------------------------------
eGroup home: http://www.eGroups.com/list/self-interest
Free Web-based e-mail groups by eGroups.com




More information about the Self-interest mailing list