Commit graph

92 commits

Author SHA1 Message Date
gambas
c99df6c0c5 Add an API to get the luminance of a color.
[GB.IMAGE]
* NEW: Add an API to get the luminance of a color.

[GB.JIT]
* NEW: Cosmetic changes.
2020-05-18 13:22:34 +02:00
gambas
b0eb952028 '&=' on variants is not incorrectly optimized anymore.
[INTERPRETER]
* BUG: '&=' on variants is not incorrectly optimized anymore.

[GB.JIT]
* BUG: '&=' on variants is not incorrectly optimized anymore.
2020-04-16 09:47:59 +02:00
gambas
2165ececd5 JIT optimization of '&=' has been implemented.
[INTERPRETER]
* NEW: Support for JIT '&=' optimization.
* BUG: Fix '&=' optimization on argument variables.
* OPT: Strings greater than 4096 bytes are allocated by 4096 bytes steps.

[GB.JIT]
* NEW: JIT optimization of '&=' has been implemented.
2020-04-06 04:43:12 +02:00
gambas
8f0d4db96c Fix support of '&=' operator optimization.
[GB.JIT]
* BUG: Fix support of '&=' operator optimization.
2020-04-04 17:06:36 +02:00
gambas
23835b8b9a Support for the '&=' operator optimization.
[GB.JIT]
* NEW: Support for the '&=' operator optimization.
2020-04-04 16:29:55 +02:00
gambas
b83205f539 Correctly handle unary minus operator.
[GB.JIT]
* BUG: Correctly handle unary minus operator.
2020-03-10 00:41:05 +01:00
gambas
f0b3762ec1 JIT compiler can compile libraries now.
[INTERPRETER]
* NEW: Internal name of libraries uses a point now between vendor and library name, not a slash anymore.

[GB.DEBUG]
* BUG: Undo "make debugger output writes more robust". Apparently it does not work.

[GB.JIT]
* BUG: Compiling libraries works now.
2020-01-26 07:09:36 +01:00
gambas
6a0e3dbc4d Fix VarPtr() on function arguments.
[GB.JIT]
* BUG: Fix VarPtr() on function arguments.
2020-01-20 03:03:02 +01:00
gambas
191db990d8 Add support for VarPtr() on variant variables.
[GB.JIT]
* NEW: Add support for VarPtr() on variant variables.
2020-01-18 08:17:14 +01:00
gambas
4144d77b49 Fix static arrays management.
[GB.JIT]
* BUG: Fix static arrays management.
2020-01-17 23:51:54 +01:00
gambas
b5affdfa60 Implement fast unsafe compilation of Byte@, Short@... functions, that just access memory without checking anything.
[GB.JIT]
* NEW: Implement fast unsafe compilation of Byte@, Short@... functions, that just access memory without checking anything.
2019-12-23 11:22:36 +01:00
gambas
61af540536 Disable some compiler warnings and remove unnecessary PACKED directives.
[INTERPRETER]
* BUG: Disable some compiler warnings that generate false positives.

[GB.GEOM]
* BUG: Remove unnecessary PACKED directives.
2019-11-15 23:53:25 +01:00
gambas
f08ce22cdc Fix support of read-only arrays.
[INTERPRETER]
* BUG: Read-only arrays are now really read-only.

[GB.JIT]
* BUG: Support for read-only arrays.
2019-09-26 14:25:37 +02:00
gambas
225f2833da Fix again the management of the new new PROPERTY ... USE syntax.
[COMPILER]
* NEW: Don't emit debugging information for generated functions, but emit void sections for backward compatibility.
* NEW: Don't emit source file path in the debugging information.
2019-09-12 03:23:38 +02:00
gambas
4d59c6062d Fix boolean datatype management.
[GB.JIT]
* BUG: Fix boolean datatype management.
2019-08-21 01:23:12 +02:00
gambas
cfb4a9d2a8 Enumerating an unknown datatype does not raise an error automatically anymore.
[GB.JIT]
* BUG: Enumerating an unknown datatype does not raise an error automatically anymore.
2019-06-18 09:50:56 +02:00
gambas
ce37d6ff67 Ignore errors when loading a class for the JIT compiler.
[INTERPRETER]
* BUG: Ignore errors when loading a class for the JIT compiler.

[GB.JIT]
* BUG: Loading a class during JIT compilation can fail. Take that into account.
2019-06-11 22:32:12 +02:00
gambas
9f2da35cbe Emit column position in almost all error messages.
[COMPILER]
* OPT: Some optimizations in symbol table routines.
* NEW: Emit column position in almost all error messages. It makes the compiler 2.5% slower, even with the optimizations.
2019-05-08 06:20:35 +02:00
gambas
3dd1fd493e Fix the JIT compiler: '_init' method, Lock instruction, Object datatype, and DO / REPEAT loops at the beginning of a function now work correctly.
[INTERPRETER]
* BUG: JIT compiler does not run static initializers anymore when loading a class. Otherwise bytecode can be modified before being compiled, leading to a JIT compiler crash.

[COMPILER]
* BUG: Fix LOCK subroutine meta-information.

[GB.JIT]
* NEW: Don't display abortion debugging message if there is no compilation to abort.
* BUG: Object variables are correctly managed now.
* BUG: DO...LOOP and REPEAT...UNTIL at the beginning of the function now is correctly compiled in all cases.
2019-04-04 22:58:06 +02:00
gambas
a0bcf85bd4 Active file descriptor watches and active timers are now automatically transferred to the component declaring a custom event loop.
[INTERPRETER]
* BUG: Active file descriptor watches and active timers are now automatically transferred to the component declaring a custom event loop. Consequently, a process started before the declaration of the event loop will have its termination signal correctly catched.
* NEW: Use waitpid() instead of wait4().

[GB.GTK]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.

[GB.GTK3]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.

[GB.QT4]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.

[GB.QT5]
* BUG: Declare the event loop hook last so that active file descriptor watches and active transfer are automatically transferred.
2019-03-12 03:46:30 +01:00
gambas
3f7095bbd9 Run JIT compilation in the background to make programs start faster.
[INTERPRETER]
* OPT: JIT compilation is run in two steps.

[GB.JIT]
* OPT: Run JIT compilation in the background.
* NEW: JIT.Debug is a new property that allows to enable JIT debugging messages at runtime.
2019-03-11 16:34:50 +01:00
gambas
fe55f495f4 Fix the default value of optional Object function arguments.
[GB.JIT]
* BUG: Fix the default value of optional Object function arguments.
2019-01-20 22:50:35 +01:00
gambas
5c3ce53f61 Fix Debug instruction and support for the new Assert instruction.
[GB.JIT]
* BUG: Fix Debug instruction.
* BUG: Support for the new Assert instruction.
2019-01-11 01:46:13 +01:00
gambas
26448880a1 Support for 'tcc' compiler.
[GB.JIT]
* NEW: Support for 'tcc' compiler.
2019-01-08 01:53:38 +01:00
gambas
17bbc13df6 Do not use loop initial declaration in generated C code for old gcc versions.
[GB.JIT]
* BUG: Do not use loop initial declaration in generated C code for old gcc versions.
2019-01-03 10:29:44 +01:00
gambas
b897cec6cf Remove the include of <stdio.h> from JIT header file.
[GB.JIT]
* BUG: Remove the include of <stdio.h> from JIT header file.
2018-12-09 03:50:14 +01:00
gambas
df275f7c9b Forgot to call JIT function when the call is dynamic, i.e. if the object owning the method has an anonymous datatype (Object or Variant).
[INTERPRETER]
* BUG: Forgot to call JIT function when the call is dynamic, i.e. if the object owning the method has an anonymous datatype (Object or Variant).

[GB.JIT]
* BUG: Save the initial stack pointer of a function in the function stack instead of using the interpreter stack.
2018-12-07 01:03:47 +01:00
gambas
52c1243c35 Correctly set the stack pointer before raising an exception in JIT code.
[GB.JIT]
* BUG: Correctly set the stack pointer before raising an exception in JIT code.
2018-12-04 00:48:02 +01:00
gambas
3652b82b3e Let the caller always release the function arguments.
[GB.JIT]
* BUG: Let the caller always release the function arguments.
2018-11-27 02:59:21 +01:00
gambas
62d9bf8676 Void optional arguments are compiled correctly again.
[GB.JIT]
* BUG: Void optional arguments are compiled correctly again.
2018-11-26 11:54:39 +01:00
gambas
7fa5bd5220 Set the SP stack pointer before calling the conversion function to workaround the compiler optimizations and prevent a memory leak at function end if the conversion fails and an exception is raised.
[GB.JIT]
* BUG: Set the SP stack pointer before calling the conversion function to workaround the compiler optimizations and prevent a memory leak at function end if the conversion fails and an exception is raised.
2018-11-26 01:20:09 +01:00
gambas
c0c1adaabc Correctly compile variable argument methods.
[GB.JIT]
* BUG: Correctly compile variable argument methods.
2018-11-24 21:33:18 +01:00
gambas
baaf962ab0 JIT now handles "no return value" errors correctly.
[INTERPRETER]
* BUG: Process.Wait() now handles error output correctly.

[GB.JIT]
* BUG: Display compiler error correctly.
* BUG: Handle "no return value" errors correctly.
2018-11-24 20:00:45 +01:00
gambas
7cd9c0b7ad Use 'volatile' to prevent the compiler from optimizing access to stack pointer in exception handling.
[GB.JIT]
* BUG: Use 'volatile' to prevent the compiler from optimizing access to stack pointer in exception handling.
2018-11-23 06:29:50 +01:00
gambas
f0f113da2b Correctly restore EP after it has been used by the translation of the TRY instruction.
[GB.JIT]
* BUG: Correctly restore EP after it has been used by the translation of the TRY instruction.
2018-11-16 01:33:51 +01:00
gambas
dcac5c2a26 Handle TRY inside JIT functions correctly.
[INTERPRETER]
* BUG: Handle TRY inside JIT functions correctly.

[GB.DEBUG]
* NEW: Add explicit messages when something fails during initialization.

[GB.JIT]
* BUG: Handle TRY correctly.
2018-11-02 21:44:40 +01:00
gambas
1c6a9c1b52 Define the TRUE/FALSE constant in the generated code again.
[GB.JIT]
* NEW: Define the TRUE/FALSE constant in the generated code again.
2018-10-16 19:30:28 +02:00
bgermann
dace3b09ac Remove boolean definitions except in gb_common.h 2018-10-15 18:48:01 +02:00
gambas
31929e1e44 Overriding public variables is forbidden, and JIT compiler correctly handles public constants.
[INTERPRETER]
* NEW: Overriding public variables was useless, and is now forbidden to help JIT compiler optimizations.

[GB.JIT]
* BUG: Correctly compile dynamic accesses to public constants.
2018-10-08 16:36:38 +02:00
gambas
46f21a7f7b Strip png files with ImageMagick convert command. 2018-09-19 20:53:00 +02:00
gambas
88220d483b Let the interpreter correctly manage exceptions when calling non-JIT code from JIT code.
[INTERPRETER]
* BUG: JIT: Let the interpreter correctly manage exceptions when calling non-JIT code from JIT code.

[GB.JIT]
* BUG: Correctly initialize CP during exception handler.
2018-09-10 20:11:59 +02:00
gambas
f00acc7104 Default value of optional arguments are correctly referenced now.
[GB.JIT]
* BUG: Default value of optional arguments are correctly referenced now.
2018-09-06 07:41:29 +02:00
gambas
7a680d738b Correctly compile void function arguments.
[GB.JIT]
* BUG: Correctly compile void function arguments.
2018-08-29 11:22:56 +02:00
gambas
fc2cbe819a Rename 'ClassStat' class as '_ClassStat' to avoid a possible name collision.
[GB.JIT]
* NEW: Rename 'ClassStat' class as '_ClassStat' to avoid a possible name collision.
2018-08-28 17:05:11 +02:00
gambas
706a605cc3 Correctly restore the stack after calling a method through the interpreter, and handle null values as object values having a null address automatically.
[INTERPRETER]
* NEW: Creating a NULL value now clears the object address field so that it can be freely interpreted as a Object value with a null address by the JIT compiled code.

[GB.JIT]
* BUG: Correctly restore stack after calling a method through the interpreter.
2018-08-22 09:30:27 +02:00
gambas
7ab07bd95f Correctly handle optional object arguments.
[GB.JIT]
* BUG: Correctly handle optional object arguments.
2018-08-20 19:57:47 +02:00
gambas
7492efcc0e Always load the class before accessing a static variable, as it may not be ready.
[INTERPRETER]
* BUG: FIx JIT class loading API.

[GB.JIT]
* BUG: Always load the class before accessing a static variable, as it may not be ready.
2018-08-18 15:28:19 +02:00
gambas
07ccec7358 Compile correctly optional arguments initialization.
[GB.JIT]
* BUG: Compile correctly optional arguments initialization.
2018-08-18 12:03:44 +02:00
gambas
d371614662 Correctly compile conversion from object to boolean.
[GB.JIT]
* BUG: Correctly compile conversion from object to boolean.
2018-08-17 01:04:53 +02:00
gambas
979e22f6e9 Correctly load classes from archives other than the main project one during JIT compilation.
[INTERPRETER]
* NEW: When creating a new class, set its component immediately if we know the archive it comes from.

[GB.JIT]
* BUG: Correctly load classes from archives other than the main project one.
2018-08-16 01:50:45 +02:00