aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
Commit message (Collapse)AuthorAgeFilesLines
* Bug 1213 (related): Fix TaskBase, RunnableTask and FunctionTask ↵Sven Gothel2015-09-123-72/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | implementation and semantics - TaskBase - requires 'volatile boolean isExecuted' for atomic query of same semantics - fix isInQueue(): condition was reverse in regars to 'isExecuted' - expose 'Thread getExecutionThread()' as learned within run() method. - RunnableTask - deprecate: 'static invoke(final boolean waitUntilDone, final Runnable runnable)', since it's nonsense, use runnable.run() instead. - 'static RunnableTask invokeOnNewThread(..)' - uses InterruptSource.Thread - Persistent-Wait - Cancelable using InterruptedRuntimeException - FunctionTask - deprecate 'static <U,V> U invoke(final boolean waitUntilDone, final Function<U,V> func, final V... args)', since it's nonsense, use func.eval(args) instead. - 'static FunctionTask<U,V> invokeOnNewThread(..)' - uses InterruptSource.Thread - Persistent-Wait - Cancelable using InterruptedRuntimeException
* Bug 1213: Expose InterruptSource, SourcedInterruptedException and ↵Sven Gothel2015-09-125-12/+414
| | | | | | | | | | | | | | | | | | | | InterruptedRuntimeException - InterruptSource interface declares methods to retrieve the source of a Thread.interrupt() call. - InterruptSource.Thread implements InterruptSource, i.e. allows code running within such thread to learn about the interrupt source (stack trace). - SourcedInterruptedException is a InterruptedException specialization which may include the source of the causing Thread.interrupt() call. - InterruptedRuntimeException An unchecked RuntimeException propagating an InterruptedException where handling of the latter is not desired. The causing InterruptedException may be of type SourcedInterruptedException, hence a detailed stack trace analysis might be possible.
* Bug 1213 - RecursiveThreadGroupLockImpl01Unfairish.unlock() always ↵Sven Gothel2015-09-052-8/+23
| | | | | | | | | | | | | | | | | | | | | | | interrupts original-owner, even if not waiting at unlock() RecursiveThreadGroupLockImpl01Unfairish.unlock(): An interrupt() is always issued from group members on the original owner. This shall only happen, if the original owner is waiting within unlock() for all group members to be unlocked. This extra interrupt causes side-effects, see Bug 1211. Only issue the interrupt to wake-up the original owner iff waiting within unlock! +++ RecursiveLockImpl01CompleteFair: Issue 'Thread.interrupted()' to clear a slipped interrupt call after while-loop.
* RecursiveThreadGroupLockImpl01Unfairish: Add toString() in ↵Sven Gothel2015-08-291-2/+2
| | | | IllegalArgumentException exceptions
* Bug 1145, Bug 1172: Add performance counter for native-jar lookup: Property ↵Sven Gothel2015-08-181-3/+25
| | | | 'jogamp.debug.JNILibLoader.Perf'
* Bug 1145: JNILibLoaderBase.addNativeJarLibsImpl: Proper order: #1 ↵Sven Gothel2015-08-181-48/+50
| | | | | | | single-slim-jar, #2 fat-jar, #3 Classpath + TAG.class We shall attempt the official recommendation of deployment first (single-slim-jar) not wasting time trying a 'nativeLibraryPath' lookup within the classpath.
* Bug 1172: TempJarCache: Only copy native library files from ↵Sven Gothel2015-08-181-19/+23
| | | | | | | | 'natives/os.and.arch', reducing JAR search. Since all native libraries are now contained within 'natives/os.and.arch', we don't need to search the whole JAR file anymore but simply can copy the content of the defined folder - if existing.
* Bug 1145: Fix cc2: Null versions reported using the fat-jar (JogampVersion)Sven Gothel2015-08-181-3/+21
| | | | | | | | In case we run fat-jar file, the package name is 'com.jogamp' and all entries are based upon GlueGen. JogampVersion will fall back trying to find a fat-jar Manifest in case a null Manifest is being passed.
* Bug 1194: Reinstate system-lib search for NativeLibrary.open(..) and ↵Sven Gothel2015-08-182-6/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | PlatformPropsImpl.findSysLib(..). This patch partially reverts of commit d12e4d4ea279998b27457691038e709879dcaca6. NativeLibrary.open(..) requires search of system libraries, since it loads the actual 'tool library' for which we generate the JNI binding. The 'tool library' is preferably the system wide installed version, e.g. libGL.so etc. PlatformPropsImpl.findSysLib(..) also requires finding system libraries as needed for PlatformPropsImpl.queryElfFile(..), i.e. using libjava.so etc. Only the JNI 'glue library', glueing java calls to the 'tool library', shall not use the system wide library search since we shall only use JogAmp provided instances here. This patch also reinstates binary compatibility w/ prev. GlueGen JARs since NativeLibrary.enumerateLibraryPath(..) is public. +++ Further more 'NativeLibrary.enumerateLibraryPath(..)' now adds OSX system framework search _before_ the user path in case 'searchSystemPath && searchSystemPathFirst'. Original code always added this search to the end, which does not match the intended behavior (-> bug).
* Merge branch 'bug1194' of https://github.com/xranby/gluegenSven Gothel2015-08-183-48/+6
|\ | | | | | | | | | | | | Conflicts: src/java/com/jogamp/common/os/NativeLibrary.java Due to commit for Bug 1145, bf4d8786cb732d86db333b43020ecf0af27f60bf
| * Bug 1194: NativeLibrary: Remove dangerous search paths using the JRE ↵Xerxes Rånby2015-08-123-48/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extension mechanism NativeLibrary: API change: Removed searchSystemPathFirst argument to the open and enumerateLibraryPaths methods. Removed the generic sun.boot.library.path system path and the MacOS specific Frameworks paths from enumerateLibraryPaths. JNILibLoaderBase, PlatformPropsImpl & TestElfReader01: Updated to handle the NativeLibrary API change. This change will prevent JogAmp modules to pickup and load unsupported and old SUN JOGL 1 natives that may have been deployed with the JRE.
* | Bug 1145: Fix cc1 NativeLibrary: Add current working directory + ↵Xerxes Rånby2015-08-121-0/+4
|/ | | | | | natives/os-arch/ + library names Fixes Bug 1145 cc1 when using an unpacked fat-jar
* DynamicLibraryBundle.toolDynamicLookupFunction(..): DEBUG: Show ↵Sven Gothel2015-08-051-1/+1
| | | | | | | 'toolGetProcAddressHandle' (Bug 1062) Show 'toolGetProcAddressHandle' in DEBUG mode in DynamicLibraryBundle.toolDynamicLookupFunction(..), allowing to validate source of symbols.
* Fix Bitfield.put(..): Return previous valueSven Gothel2015-08-024-13/+21
|
* SyncedBitfield.clearField: Must be synchronizedSven Gothel2015-08-021-1/+1
|
* IntBitfield: Fix units calculation ( +7 -> +31 for ceiling, using 32bits per ↵Sven Gothel2015-08-021-2/+2
| | | | unit)
* Bitfield: Refine API method names, add clearField(boolean), fix put32(..) ↵Sven Gothel2015-08-025-48/+113
| | | | and bitCount(), add unit test (passed)
* Bitfield: Refine impl. complete get/put 32bit, add copy*(..), add ↵Sven Gothel2015-07-314-53/+278
| | | | synchronized delegation; TODO: Unit tests.
* Bitfield: @since 2.3.2 ..Sven Gothel2015-07-301-1/+2
|
* Bitfield: Use IndexOutOfBoundsException instead of ↵Sven Gothel2015-07-303-28/+28
| | | | ArrayIndexOutOfBoundsException
* Introduce Bitfield interface w/ Int32 and Int32Array impl. deprecating ↵Sven Gothel2015-07-304-14/+381
| | | | | | | | | | | | | IntBitfield IntBitfield's 64bit bit-size is exceeding its use-case, making it less efficient and complicated. Bitfield offers a fast path implementation for 32 bits as well as a int[] implementation. TODO: 32 bit Unaligned putInt32(..) and getInt32(..), currently throwing UnsupportedOperationException for int[] impl.
* PlatformPropsImpl: Add static final Version18 and Version19 VersionNumberSven Gothel2015-07-271-0/+6
|
* Bug 1166: Refine fix of JavaEmitter's JVMUtil_NewDirectByteBufferCopy (2)Sven Gothel2015-07-161-3/+11
| | | | | | | Further refine code, see commit f6a5ac4473135bbc4bc1a5f537e060df45eb4824. - Perform a NULL check on Buffers.newDirectByteBuffer(..) result. - Only copy memory if capacity > 0, incl fetching direct buffer address
* JavaEmitter.staticClassInitCodeCCode: Reuse static stringsSven Gothel2015-07-161-7/+10
|
* Bug 1166: Refine fix of JavaEmitter's JVMUtil_NewDirectByteBufferCopySven Gothel2015-07-161-3/+11
| | | | | | | | | | | See commit e424c28f869269f5a22c22ef017230346b22847a (first patch) Since JVMUtil_NewDirectByteBufferCopy is being called w/ 'size_t' values, e.g. 'count * sizeof(Structure)', we shall validate whether 'capacity' is valid, i.e. <= MAX_INT. After validation, 'capacity' is being cast to 'jint' before being passed to the java method.
* BUG 1166: Fix JavaEmitter JVMUtil_NewDirectByteBufferCopyXerxes Rånby2015-07-081-2/+2
| | | | | | | | | | | Prevents jlong to jint truncation when capacity is passed from jni to java. com.jogamp.common.nio.Buffers newDirectByteBuffer and the underlying java.nio.ByteBuffer allocateDirect only work with capacitys of int size. Signed-off-by: Xerxes Rånby <[email protected]>
* Bug 1153 - GlueGen: Support [const] [native] expressions and conversion to ↵Sven Gothel2015-04-017-342/+942
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | java space, incl. [native] numbers Rewrite ConstantDefinition: Add sub-class CNumber: - containing integer/float values and their original qualifiers [long, double, unsigned] - conversion to java number ConstantDefinition: - holds native expression - optionally holds CNumber representing native expression, if [only] a number - can compute equivalent java expression with result type (JavaExpr) Add static native number reg-expression for number detection and parsing. Add static native number to CNumber conversion methods. +++ Retrieve full LISP tree and convert to serialized expression to be utilized for expressions used in enumerates. Parse enumerates, allowing const native expressions: - Utilize ConstantDefinition either for definite CNumber or expression - Simply add "+1" for new default values, if previous is an expression
* Add ArrayHashMap; Use 'supportNullValue' optimizing ArrayHashSet and ↵Sven Gothel2015-04-012-38/+473
| | | | | | ArrayHashMap; Unify ctor for both impl. Add/Enhance unit tests for both.
* JavaEmitter: Always use 'containingJTypeName' for ↵Sven Gothel2015-03-261-6/+6
| | | | | | | JavaConfiguration.canonicalStructFieldSymbol(..) Patch harmonizes configuration, was also using 'structCTypeName' besides 'containingJTypeName', but surely it makes no sense to use different type names for struct-field configurations.
* Bug 1149: Fix parsing of hexadecimal w/ binary exponent floats in ↵Sven Gothel2015-03-252-36/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | regexp-constant and java-parser. (Due to PCPP -> JCPP) Lack of parsing binary exponent floats is exposed due to using JCPP and correct constant-definitions. - JavaParser.g: - Add support for hexadecimal w/ binary exponent floats - TAB -> 4 spaces - ConstantDefinition.java: - Add RegExp 'fpRegexp', patternDecimalNumber: decimal number w/ support for hexadecimal w/ binary exponent floats. - isDecimalNumber(..): Use patternDecimalNumber instead of try-and-error (NumberFormatException) - patternCPPOperand: exclude patternDecimalNumber! - JavaEmitter.java: - Respect explicit suffix [dD] for double type. - Drop floating point suffixes [fF] - Test: Added tests for hexadecimal w/ binary exponent floats
* Bug 1149 - Replacing PCPP w/ JCPP: Name used CPP impl.Sven Gothel2015-03-241-7/+9
|
* Fix Logging: PlainLogConsoleHandler shall start w/ Level.ALL, add explicit ↵Sven Gothel2015-03-241-7/+26
| | | | Level setter for handler.
* Bug 1149 - Replacing PCPP w/ JCPP, allowing complete macro handling (Part-2: ↵Sven Gothel2015-03-244-5/+17
| | | | JCPP submodule, build, test and doc)
* Bug 1149 - Replacing PCPP w/ JCPP, allowing complete macro handling (Part-1: ↵Sven Gothel2015-03-237-143/+343
| | | | Cleanup / Preparation)
* Fix DynamicLibraryBundle.isToolLibComplete() no tool-lib case, regression of ↵Sven Gothel2015-03-181-1/+4
| | | | | | | | | | | | | | | commit 12feaa7d3b1544098f684d851e3caff1ec88cbc8 Regression of commit 12feaa7d3b1544098f684d851e3caff1ec88cbc8 'isToolLibComplete()' returned false if dynLinkGlobal is null, even if no tool-lib has been used. In which case dynLinkGlobal has not been initialized and hence is always null. 'isToolLibComplete()' now takes no tool-lib into consideration! Currently only 'OVRDynamicLibraryBundleInfo' of JOGL's 'oculusvr' binding used this configuration within JogAmp.
* Bug 1144 - Add 'DelegateImplementation': Requires own MethodBinding for ↵Sven Gothel2015-03-118-58/+128
| | | | | | | | | | | | | | | | | | | | | | delegates impl. / Adding ReturnsOpaque - DelegateImplementation requires own MethodBinding for delegates impl. The delegation name must be included within the FunctionSymbol's aliases _only_ for implementations, where delegation applies. This allows all subsequent type/cfg checks to hit on AliasedSymbol! Hence we need to create individual MethodBinding instances for interfaces and public/private implementations. - Adding ReturnsOpaque Configuration: ReturnsOpaque <Primitive Java Type> <Function Name> This feature is necessary to achieve 'Opaque' functionality for function's return type - instead of types in general. - Fix AliasedSymbolImpl copy-ctor, i.e. this.name = o.name !
* Bug 1134 - LOG AliasedSymbol: Don't issue getAliasedString(), logger takes ↵Sven Gothel2015-03-114-18/+18
| | | | care of that, when it logs.
* Bug 1144 - Add 'DelegateImplementation', manually impl. may delegate to ↵Sven Gothel2015-03-113-9/+106
| | | | | | | | | | | | | | | | | | | | | | | | renamed original 'DelegateImplementation' is a variation of 'ManuallyImplement'. 'ManuallyImplement' emits the interface method, but suppresses the Java and native-code implementation. The latter shall be implemented manually by the user. 'DelegateImplementation' emits the interface method, and the _private_ renamed Java and native-code implementation. Both can be called from the manual user implementation, hence delegation. Configuration: DelegateImplementation <ORIG-SYMBOL> <RENAMED-IMPL-SYMBOL> I.e. delegation model shall apply to <ORIG-SYMBOL> and the Java and native-code implementation renamed to <RENAMED-IMPL-SYMBOL>. The user manual implementation of <ORIG-SYMBOL> may delegate to <RENAMED-IMPL-SYMBOL>.
* Bug 1144 - Add 'DelegateImplementation': Cleanup ↵Sven Gothel2015-03-119-118/+197
| | | | | | | | MethodBinding/FunctionBinding Semantics - Clarify name semantics: name -> [interfaceName, implName, nativeName] - JavaMethodBindingEmitter: Refine native identity via isNativeMethod + isPrivateNativeMethod - ProcAddressEmitter: Remove hack whether we need to wrap .. use isNativeMethod + isPrivateNativeMethod
* Bug 1144 - Add 'DelegateImplementation': Sort JavaMethodBindingEmitter ↵Sven Gothel2015-03-104-48/+51
| | | | argument list; forImplementingMethodCall -> isNativeMethod
* Bug 1144 - Add 'DelegateImplementation': Cleanup JavaConfiguration and use ↵Sven Gothel2015-03-102-65/+83
| | | | manuallyImplement(AliasedSymbol) for FunctionSymbol
* Bug 1134 - Refine err/log message of 'previous definition is here'Sven Gothel2015-03-091-2/+2
|
* Bug 1134 - Add ASTLocusTagProvider for Define and fix newline in c-parser ↵Sven Gothel2015-03-092-3/+16
| | | | (Expose source location for log/error messages)
* Bug 1134 - Fix CMethodBindingEmitter return type '_res' qualifiers (part 2)Sven Gothel2015-03-092-2/+13
| | | | | | | | | Commit 414a0146660cadd35d5ae270f7f819717e9c7374 removed the const/volatile of the local return variable. This change also casts the function calling result to the same - hence removing a possible c-compiler warning of dropping qualifier const.
* Bug 1134 - ProcAddressCMethodBindingEmitter: Use available 'ProcAddrTypedef' ↵Sven Gothel2015-03-092-39/+43
| | | | | | | | | | | | | | | | | for type validation w/ local generated variant (robustness) ProcAddressCMethodBindingEmitter code regarding having the public 'ProcAddrTypedef' (from input header) was simply broken, since it always used the local generated 'ProcAddrTypedef', if 'ProcAddrTypedef' was forced. Hence the public 'ProcAddrTypedef' was ignored in most cases. ProcAddressCMethodBindingEmitter's semantic changed from: needsLocalTypedef -> hasProcAddrTypedef New Code generation: - always generated the local 'ProcAddrTypedef' - if hasProcAddrTypedef, use public 'ProcAddrTypedef' for return type variable - cast local 'ProcAddrTypedef' to public 'ProcAddrTypedef', which renders the native compiler to validate the local and public types.
* Bug 1134 - Fix CMethodBindingEmitter return type '_res' qualifiersSven Gothel2015-03-091-2/+3
| | | | | We cannot have the local variable holding the return type 'const' and assign a value to it later.
* Bug 1134 - Fix aliased typedef struct emissionSven Gothel2015-03-093-71/+89
| | | | | | | | | | | | | | | | | | | | | | - Code regarding 'aliased typedef struct' is tagged in JavaEmitter and HeaderParser: 'NOTE: Struct Name Resolution (JavaEmitter, HeaderParser)' Prefers containing cstruct typedef pointer if available _and_ if cstruct is _not_ a typedef! - Removed: 'HeaderParser.resolveAnonCompound(..)' no more required, since CompoundType always sets its name! Commit cf9f28cf249393f42d7d2835775521dfadee6b92 - JavaEmitter.emitStruct: - Regard above 'aliased typedef struct' NOTE - JavaEmitter.typeToJavaType: - Regard above 'aliased typedef struct' NOTE - ReferencedStructs - Drop duplicate CompoundType instances of same name. This can happen due to const/volatile and ASTLocusTag variants.
* Bug 1134 - Fix IntType 'unsigned'; Type: Use copy-ctor instead of Clonable, ..Sven Gothel2015-03-0920-240/+277
| | | | | | | | | | | | - Fix IntType 'unsigned' - Need to handle 'unsigned' for typedef and !typedef, when exposing 'unsigned' for code emission. - Consider IntType.typedefUnsigned in hash/equals - Type: Use copy-ctor instead of Clonable enhancing strong typing. - add 'Type clone(final ASTLocusTag newLoc)' - Consider Type.typedefCVAttributes in hash/equals
* Bug 1134 - Make ASTLocusTag's text optionalSven Gothel2015-03-093-7/+15
|
* Bug 1134 - Logging's formatter now takes care of Type -> getDebugString() ↵Sven Gothel2015-03-083-43/+72
| | | | | | | when desired, not at 'log' call Removes load to assemble the getDebugString() of Type and JavaType when invoking log function. Note: the log may be skipped if log-level is not reached.