| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows via BATCH file execution
Batch file execution test via direct call, i.e.'a.bat',
does not work on some Windows machine, not reproducible here!
A workaround would be to call the batch file explicit via 'CMD /c a.bat':
- works when using 'Software Restriction Policies' (Bug 1015 Comment 2)
- does _not_ work when denying ACL "Traverse Folder / Execute File" permission (Bug 1015 Comment 3)
Due to this bug, we need to use a native execution:
- Performing executable test w/ native exe file instead of batch file
on Windows x86 32bit and 64bit,
- using [1] TinyPE XP-W8 Compatible - x86 32bit and 64bit - 268 bytes
- Tested on: WinXP-32bit, Win7-64bit and Win8-64bit
- Author/License: Ange Albertini, BSD Licence, 2010-2013
- On all other Windows machines (ARM, ..),
we still use direct execution of 'a.bat'
but may add native exe files for missing platforms.
+++
This patch injects said binaries within the java jar file
and copies it into the 'to be tested' temp folder for execution.
[1] TinyPE XP-W8 Compatible - x86 32bit and 64bit - 268 bytes
is included within 'src/native/tinype-corkami',
build manually and imported as 'src/java/com/jogamp/common/util/bin/exe-windows-i586-268b.bin'.
+++
Conflicts:
src/java/com/jogamp/common/util/IOUtil.java
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
exetst.getCanonicalPath() command
Having a test-executable file with SPACE in it's temporary path,
e.g.
Unix: /magic temp/user/
Windows XP: C:\Documents and Settings\user\temp
results to split up commands if using
'Process.exec(String)', since it utilizes
a StringTokenizer to assemble the command String[].
This patch uses 'Process.exec(String[])' avoiding
splitting up SPACE in the full command string/path.
Major impact is on 'Windows XP',
where a SPACE separated TEMP/TMP folder is the default.
Note-1: Commit 9bc3d3f78bb2fb1aa0ccfb02ffb5bdda74420cac
introduced testing executable permission on Windows (Bug 1015)
and rendered this issue visible.
To reproduce the issue on Windows:
+++
set TEMP=C:\Documents and Settings\jogamp\temp
set TMP=C:\Documents and Settings\jogamp\temp
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
+++
Note-2: This bug affects all platforms!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
used properly (Added unit test)
Bug 908 was caused by confusing URI encoded parts (e.g. scheme-specific-part) and it's decoded variant.
This especially happened due to:
- the fact, that the encoded and unencoded variant uses the same String type,
- the URI/URL decoding differs, is not complete (e.g. %20 .. SPACE remains in decoded part),
- and does not comply w/ RFC 2396 and RFC 3986 (encoding), e.g. not all RESERVED chars are encoded.
In branch 'v2.3.0_branch', we will introduce our own Uri and Uri.Encoded class
to solve above issue by replacing all URI usage w/ Uri.
- Backporting results of own Uri class introduction in branch 'v2.3.0_branch'
- Ensure the encoded URI parts are used where required, i.e. IOUtil.compose(..) etc
- TestNetIOURIReservedCharsBug908: Automated test, launching GlueGen jar file from an <i>odd pathname</i>.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on unix and osx)
Tested on Window 7 and Windows 8.1 using 'Using Software Restriction Policies',
i.e. disabled sw-execution in TEMP dir.
On Windows we need to add min. shell code, here 'echo off',
allowing the bat file to be executed if policy allows it.
Reminder: We test the following temp folder
1) java.io.tmpdir/jogamp
2) $XDG_CACHE_HOME/jogamp
3) $TMPDIR/jogamp or $TEMP/jogamp
4) $HOME/.jogamp
+++
Misc:
Proper 'duplicate' validation via 'file1.equals(file2)' test
using the abstract pathname.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In situations, where the native-jar file is not located within
the same parent URI as it's java-jar file, our location mechanism fails.
This patch adds a classloader based native-jar file location mechanism as a fallback,
requiring the native jar file to be included in the users CLASSPATH.
Classloader based location algorithm in JNILibLoaderBase.addNativeJarLibsImpl(..):
- Extract the 'module-name' from the given classFromJavaJar's package name,
i.e. the last package-part: 'jogamp.common.Debug' -> 'common'
Hence it is important to pass a 'classFromJavaJar',
which last package segment reflects the module-name!
- <os.and.arch> -> <os_and_arch_dot>, e.g. linux-amd64 -> linux.amd64 (linux/amd64)
- Locate class 'jogamp.nativetag.<module-name>.<os_and_arch_dot>.TAG',
e.g. 'jogamp.nativetag.common.linux.amd64.TAG'
- Use located class's JarFile URI .. continue as usual
Injection of above mentioned TAG class via gluegen-cpptasks-base.xml macro 'native.tag.jar':
- Creates dummy TAG.java code
- Compiles TAG.java
- Creates the native-jar file
Example:
<native.tag.jar objdir="${build}/obj"
nativejarfile="${build}/gluegen-rt-natives-${os.and.arch}.jar"
manifestfile="${build}/Manifest-rt-natives.temp"
module="common"
includelibs="*gluegen-rt.${native.library.suffix}" />
Note that the manifest file uses a matching Extension-Name:
Extension-Name: jogamp.nativetag.common
|
|
|
|
|
|
|
| |
'[-noawt,-mobile,-core,-android]?' in API-doc, ...
- rename addNativeJarLibsWhenInitialized(..) -> addNativeJarLibsWithTempJarCache(..)
to fix grammar and expose proper semantics.
|
|
|
|
| |
commit GlueGen f4ac27e177f6deb444280d3b375e7d343e38bd08
|
|
|
|
| |
ease review
|
| |
|
|
|
|
|
|
|
| |
accessed from inner class
Otherwise the compiler has to fill in a wrapping access function for the inner
class to call, which is less efficient.
|
| |
|
|
|
|
| |
annotations
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
src/java/com/jogamp/common/os/Platform.java
src/junit/com/jogamp/common/util/TestTempJarCache.java
(re-injected that api-doc of addNativeJarLibsImpl)
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
Bug: 1023
Bug: 1024
|
| |
| |
| |
| | |
of the method.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all 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]>
|
| |
| |
| |
| |
| |
| |
| |
| | |
/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 ..
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
branch): Using direct regexp for excludes
|