diff options
author | Kenneth Russel <[email protected]> | 2005-11-09 00:32:37 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-11-09 00:32:37 +0000 |
commit | cf7b8b87f78687b8e4a867d3b18bd7f072a955ee (patch) | |
tree | 739fe8eec21acfe26cf7a684232f1219dbdd43b8 /src/classes/com/sun/gluegen/GlueEmitter.java | |
parent | e42abe5e45c693abc4c06ac5c1928ee2c3fe8d27 (diff) |
Refactored computations of sizes of data types and offsets of fields
in data structures in GlueGen to be performed lazily via SizeThunks.
The concrete size of primitive data types is computed only by passing
a MachineDescription into one of these thunks. Changed generated glue
code for struct accessors to delegate their instantiation and field
access to specialized 32- or 64-bit versions. This should allow one
jar file to support both 32-bit and 64-bit CPUs; the native code is of
course still specialized for the processor and data model. Changed
default build to generate both 32-bit and 64-bit accessors for all
generated data structures. Tested on Windows; more testing, including
build testing, is needed on other platforms.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@426 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/gluegen/GlueEmitter.java')
-rw-r--r-- | src/classes/com/sun/gluegen/GlueEmitter.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/classes/com/sun/gluegen/GlueEmitter.java b/src/classes/com/sun/gluegen/GlueEmitter.java index d6f5fede8..e21bc8764 100644 --- a/src/classes/com/sun/gluegen/GlueEmitter.java +++ b/src/classes/com/sun/gluegen/GlueEmitter.java @@ -50,8 +50,25 @@ public interface GlueEmitter { public void readConfigurationFile(String filename) throws Exception; - /** Set the description of the underlying hardware. */ - public void setMachineDescription(MachineDescription md); + /** Sets the description of the underlying hardware. "md32" + specifies the description of a 32-bit version of the underlying + CPU architecture. "md64" specifies the description of a 64-bit + version of the underlying CPU architecture. At least one must be + specified. When both are specified, the bulk of the glue code is + generated using the 32-bit machine description, but structs are + laid out twice and the base class delegates between the 32-bit + and 64-bit implementation at run time. This allows Java code + which can access both 32-bit and 64-bit versions of the data + structures to be included in the same jar file. <P> + + It is up to the end user to provide the appropriate opaque + definitions to ensure that types of varying size (longs and + pointers in particular) are exposed to Java in such a way that + changing the machine description does not cause different shared + glue code to be generated for the 32- and 64-bit ports. + */ + public void setMachineDescription(MachineDescription md32, + MachineDescription md64); /** * Begin the emission of glue code. This might include opening files, |