diff options
author | Kenneth Russel <[email protected]> | 2006-01-01 22:51:07 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2006-01-01 22:51:07 +0000 |
commit | 875a3de8f54704604d006badf0f0747347319025 (patch) | |
tree | 904c468f43c9c818c57bb0f7f17608066172cf29 /src/classes/com/sun/gluegen/JavaMethodBindingEmitter.java | |
parent | 0747964f0b88d0c9da9c38bf9eff96eb6561f0c1 (diff) |
Fixed more problems related to recent restructuring of glue code
generation to support simultaneous 32- and 64-bit ports. Now uses
size() (on Java side) and sizeof (on C side) when creating direct
Buffers for struct accessors rather than passing MachineDescription
down to JavaMethodBindingEmitter and CMethodBindingEmitter. Now uses
64-bit MachineDescription when sizing outgoing arguments and return
types for bound methods.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@506 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/gluegen/JavaMethodBindingEmitter.java')
-rw-r--r-- | src/classes/com/sun/gluegen/JavaMethodBindingEmitter.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/classes/com/sun/gluegen/JavaMethodBindingEmitter.java b/src/classes/com/sun/gluegen/JavaMethodBindingEmitter.java index 031a994e0..5a7e065f7 100644 --- a/src/classes/com/sun/gluegen/JavaMethodBindingEmitter.java +++ b/src/classes/com/sun/gluegen/JavaMethodBindingEmitter.java @@ -89,7 +89,6 @@ public class JavaMethodBindingEmitter extends FunctionEmitter public JavaMethodBindingEmitter(MethodBinding binding, PrintWriter output, - MachineDescription defaultMachDesc, String runtimeExceptionType, boolean emitBody, boolean eraseBufferAndArrayTypes, @@ -99,7 +98,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter boolean forIndirectBufferAndArrayImplementation, boolean isUnimplemented) { - super(output, defaultMachDesc); + super(output); this.binding = binding; this.runtimeExceptionType = runtimeExceptionType; this.emitBody = emitBody; @@ -334,7 +333,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter return getArgumentName(i) + "_offset"; } - protected void emitBody(PrintWriter writer, MachineDescription machDesc) + protected void emitBody(PrintWriter writer) { if (!emitBody) { writer.println(';'); @@ -348,7 +347,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter emitPrologueOrEpilogue(prologue, writer); emitPreCallSetup(binding, writer); //emitReturnVariableSetup(binding, writer); - emitReturnVariableSetupAndCall(binding, writer, machDesc); + emitReturnVariableSetupAndCall(binding, writer); } writer.println(" }"); } @@ -435,7 +434,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter } - protected void emitReturnVariableSetupAndCall(MethodBinding binding, PrintWriter writer, MachineDescription machDesc) { + protected void emitReturnVariableSetupAndCall(MethodBinding binding, PrintWriter writer) { writer.print(" "); JavaType returnType = binding.getJavaReturnType(); boolean needsResultAssignment = false; @@ -507,7 +506,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter } emitPrologueOrEpilogue(epilogue, writer); if (needsResultAssignment) { - emitCallResultReturn(binding, writer, machDesc); + emitCallResultReturn(binding, writer); } } @@ -592,7 +591,7 @@ public class JavaMethodBindingEmitter extends FunctionEmitter return numArgsEmitted; } - protected void emitCallResultReturn(MethodBinding binding, PrintWriter writer, MachineDescription machDesc) { + protected void emitCallResultReturn(MethodBinding binding, PrintWriter writer) { JavaType returnType = binding.getJavaReturnType(); if (returnType.isCompoundTypeWrapper()) { @@ -621,8 +620,8 @@ public class JavaMethodBindingEmitter extends FunctionEmitter // Create temporary ByteBuffer slice // FIXME: probably need Type.getAlignedSize() for arrays of // compound types (rounding up to machine-dependent alignment) - writer.println(" _res.position(_count * " + cReturnType.getSize(machDesc) + ");"); - writer.println(" _res.limit ((1 + _count) * " + cReturnType.getSize(machDesc) + ");"); + writer.println(" _res.position(_count * " + getReturnTypeString(true) + ".size());"); + writer.println(" _res.limit ((1 + _count) * " + getReturnTypeString(true) + ".size());"); writer.println(" ByteBuffer _tmp = _res.slice();"); writer.println(" _tmp.order(ByteOrder.nativeOrder());"); writer.println(" _res.position(0);"); |