| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
float[] backing-array - refine API doc w/ backing-array semantics
|
|
|
|
| |
usage (cast to void*)
|
|
|
|
|
| |
Single non-native sized compound fields, if an opaque array/pointer,
must utilized the native size StructAccessor get/set method.
|
|
|
|
| |
types / removed them)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and string (code generation)
Enhance compound access as delivered by Bug 1022,
to also generate accessors (getter and setter) for
array, pointer and string types.
Allow configuration of array length either via
their internal size (c-header) or config 'ReturnedArrayLength'.
'ReturnedArrayLength' allows specifying a java expression.
Canonical field names of compounds are _now_ specified as
follows for configuration entries:
COMPOUND.FIELD
e.g.
StructA.fieldB
Also allow configuration of pointer fields to be treated as
referenced arrays via 'ReturnedArrayLength'.
Further, allow specifying 'pointer fields' as String values
via 'ReturnsString' configuration.
++++
Implementation details:
- handle above described accessor features
- enhance JavaDoc for generated accessors
- generate native JNI compound and string accessor on demand
- encapsule accessor code generation in their own methods
- enhance exception messages
- enhance type verbosity in debug mode
- verbose debug output via GlueGen.debug()
Tests:
- Features covered by test1.[ch]
and Test1p1JavaEmitter and Test1p2ProcAddressEmitter
- Validated compilation and unit tests for modules:
- joal
- jogl (minor config changes req.)
- jocl (minor config changes req.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C-Enum values for array length
- Parser (HeaderParser.g): Support using C-Enum values for array length specification
- Will throw an exception if enum identifier is unknown or exceeds int-size
- Add StructEmitter supports for compound-arrays
- Add Debug stderr verbose info:
- Struct Emitter prefix 'SE.' - to analyze emitting struct fields (offset+size and accessors)
- Struct Layout prefix 'SL.' - to analyze memory layout (based on MachineDescription.StaticConfig.X86_64_UNIX)
Tested via test1.[ch] BaseClass ..
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
initialization
Follow-up of commit 1eadaf928f4f61aae4de1c8bf33c5b77bdfa882f
- Refine MethodBinding detection for 'requiresStaticInitialization',
i.e. return type is a "compound type" and not a pointer
- JVMUtil_NewDirectByteBufferCopy: Throw FatalError if initializeImpl() has not been called
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
initialization
Follow-up of commit 9843e983a4fc71a64eb3de9cb364a1f4ffa56b3a
Only add static initialization code (java, native)
and hence native code 'JVMUtil_NewDirectByteBufferCopy(..)'
if either required _or_ forced via configuration.
This shall reduce possible sideffects
and dead code.
Add JavaConfiguration:
/**
* Returns true if the static initialization java code calling <code>initializeImpl()</code>
* for the given class will be manually implemented by the end user
* as requested via configuration directive <code>ManualStaticInitCall 'class-name'</code>.
*/
public boolean manualStaticInitCall(String clazzName);
/**
* Returns true if the static initialization java code implementing <code>initializeImpl()</code>
* and the native code implementing:
* <pre>
* static jobject JVMUtil_NewDirectByteBufferCopy(JNIEnv *env, void * source_address, jlong capacity);
* </pre>
* for the given class will be included in the generated code, always,
* as requested via configuration directive <code>ForceStaticInitCode 'class-name'</code>.
* <p>
* If case above code has been generated, static class initialization is generated
* to call <code>initializeImpl()</code>, see {@link #manualStaticInitCall(String)}.
* </p>
*/
public boolean forceStaticInitCode(String clazzName);
|
|
|
|
| |
call-by-value' JavaMethodBindingEmitter, array may still require NIO handling, also consider NIO array length.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Completing commit c3054a01990e55ab35756ea23ab7d7c05f24dd37
by allowing passing compound arrays via 'call-by-value.
- Creating linear temp heap, copying NIO values into it
and passing to C function.
Copy-back if not 'const', see below.
- Respect 'const' qualifier to skip write-back of
temp heap passed to C function
- See tag: // FIXME: Compound and Compound-Arrays
for code changes and validation of completeness
- triggers for compound arrays are:
- javaType.isArrayOfCompoundTypeWrappers()
- type.isArray()
- simplified const query by c-type: FunctionEmitter.isBaseTypeConst(ctype)
+++
Tests: Added call-by-value to test1.[ch] binding test!
|
|
|
|
| |
to 2.2.0)
|
| |
|
|
|
|
|
|
| |
e8bc9edd3c39170af038ab23b8cdca9ffd6f2d56): src/antlr (IMHO no need for 'main')
/src/main/antlr/ -> /src/antlr/
|
|\ |
|
| |
| |
| |
| |
| |
| | |
functions list
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
| |
| |
| | |
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
| |
| |
| |
| |
| | |
Also move the antlr-wrapping targets to be near the one place they are used.
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
| |
| |
| | |
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
| |
| |
| |
| |
| |
| |
| | |
/src/main/antlr/..
This gets the .g files unmixed from the non-generated java files for the cgram/jgram packages.
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
| |
| |
| |
| |
| |
| | |
The annotations are all commented out, uncomment them and reduce the type warnings
during the build.
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
| |
| |
| | |
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
constructor
clone() can't be used without warnigns and is no more efficient that the copy constructor,
replace the call and kill the suppressed warning annotation. While here, mark the
modifier list as private final.
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
returning struct instance
'compound call-by-value' is not efficient.
However, to allow mapping APIs utilizing passing small structs
as arguments and return values - this feature has been added.
+++
To return the struct value, native code needs to
allocate a NIO ByteBuffer and copy the data.
The stack return value can be dismissed afterwards and the
NIO buffer is returned.
We include this functionality for all generated [impl] classes,
native method:
'static jobject JVMUtil_NewDirectByteBufferCopy(JNIEnv *env, void * source_address, jlong capacity)'
(See: 'JavaEmitter.initClassAccessCode')
Since this code requires knowledge of java classes and methods,
for which a reference needs to be acquired, a static initialization method
has been introduced for all generated [impl] classes:
'private static native boolean initializeImpl();'
Per default the this method will be called in the new
static initializer block of the class,
which can be supressed via the configuration element:
'ManualStaticInit <class-name>'
'ManualStaticInit' can be used to issue the 'initializeImpl()'
call in a custom static initializer written by the user.
However, at the time 'initializeImpl()' gets called
the JNI native library must have been loaded, of course!
+++
- See tag: // FIXME: Compound call-by-value
for code changes and validation of completeness
Trigger for compond call-by-value in CMethodBindingEmitter is:
!cArgType.isPointer() && javaArgType.isCompoundTypeWrapper()
Trigger for compond call-by-value in JavaEmitter is:
t.isCompound()
+++
Further more we do tolerate 'javaType.isCPrimitivePointerType()',
i.e. adding comments for offset/size and field entries,
which are all NOP.
This allows to utilize the remaining fields of the native structure.
+++
Tests: Added call-by-value to test1.[ch] binding test!
|
| |
| |
| |
| | |
defer static class initialization
|
| | |
|
| |
| |
| |
| | |
JavaType.getDumpString(): Add more info ..
|
| |
| |
| |
| | |
xcode.clang property files
|
|/
|
|
| |
openal-soft commit adc3413dda197bbd6b879ff98e897b8fbc66cc39)
|
|
|
|
|
|
|
|
| |
reuse
Reuse a single stringbuilder to build all the comment strings and emit them if required.
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
| |
Dumper.dumpFullStats(..)
|
|
|
|
| |
dump diffs per diff-type
|
| |
|
|
|
|
| |
(0.9.25-SNAPSHOT)
|
|
|
|
| |
branch): Using direct regexp for excludes
|
|
|
|
|
|
|
| |
Refactor base semjar unit test class into
com.jogamp.junit.util.VersionSemanticsUtil, part of new gluegen-test-util.jar.
The new gluegen-test-util.jar shall be used by all other modules to test versioning.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TestVersionSemantics adds testing of semantic versioning
of 2.1.5 gluegen-rt.jar against the current version within a unit test.
Currently we expect BACKWARD_COMPATIBLE_USER
and need to toggle this to NON_BACKWARD_COMPATIBLE,
if actually perfoming non compatible major or minor version changes.
The latter is allowed right now, since we increment from 2.1 -> 2.2!
- Added https://github.com/jeluard/semantic-versioning semver.jar (Apache License Version 2.0)
|
|
|
|
| |
(Used in JOGL to mitigate Bug 1004)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
generated_class_user due to Java8 issues.
Java8's annotation processor as embedded within javac does not allow
referencing not-yet existing generated classes in a class source code
which will produce these generated classes via the annotation process.
Example:
+++
import com.jogamp.gluegen.structgen.CStruct;
public class Lala {
@CStruct(name="RenderingConfig", header="TestStruct01.h")
public RenderingConfig config;
}
+++
Above example illustrates that the type 'RenderingConfig'
does not exist at time of processing the annotation.
The type will be created via the annotation process itself.
Even though we pass '-proc:only', i.e. skip java compilation,
Java8's annotation processing via javac fails in such case.
We see this as a bug within javac's annotation processing itself!
+++
This workaround splits the annotation process and using the class as
generated by the former.
To allow this to work, CStruct receives a new field 'jname'
allowing to enforce the java-name of the structure
using a dummy field type like boolean.
@CStruct(name="RenderingConfig", jname="RenderingConfig", header="TestStruct01.h")
public boolean dummy;
Further more CStruct can be annotated on the package, i.e. 'package-info.java',
avoiding the dependency problem altogether.
To support multiple header files and types,
'CStructs' has been introduced using an array of 'CStruct'.
@CStructs({@CStruct(name="RenderingConfig", header="TestStruct01.h"), @CStruct(name="Pixel", header="TestStruct02.h")})
package com.jogamp.gluegen.test.junit.structgen;
Tests:
- Build w/ Java7 and Java8
- Validated 'major version 50' (Java 6) class files (OK)
|
| |
|
|
|
|
| |
analyze llvm-vmkit libGL loading issue)
|
| |
|
|
|
|
| |
recipe (inactive); Misc ..
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
|
|
|
|
| |
This reverts commit fccb2460832aedd1b51372aa1e7881770cb638c9.
|
| |
|
| |
|