Changes between Initial Version and Version 1 of Ticket #14090, comment 11


Ignore:
Timestamp:
Aug 18, 2017 6:05:40 PM (18 months ago)
Author:
facundo.dominguez
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14090, comment 11

    initial v1  
    11When we moved {{{inline-java}}} to use a ghc plugin, we stopped using the static pointer table. But it would have broken because of this.
    22
    3 {{{inline-java}}} was using the static pointer table to store java bytecode. At runtime, the SPT was traversed looking for the bytecode to pass it to the JVM. The bytecode was inserted in the SPT by creating some static forms which were never accessed other than through the SPT traversal.
     3{{{inline-java}}} was using the static pointer table to store java bytecode. At runtime, the SPT was traversed looking for the bytecode to pass it to the JVM. The bytecode was inserted in the SPT by creating some static forms which were never accessed other than through the SPT traversal. A traversal consists in obtaining the keys with {{{staticPtrKeys}}}, then using `unsafeLookupStaticPtr` to get the value of each, then doing something hacky to determine if the returned thunk is some bytecode. We recognized the bytecode because we stored it together with some magic number that we could recover from the thunk using {{{GHC.Prim.unpackClosure#}}}.
    44
    55But as I said, inline-java doesn't use the SPT anymore. Maybe mnislaih has another use case.