Commit graph

63 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
gambas
6d35875a56 Correctly raise exceptions on the number of arguments of function calls.
[GB.JIT]
* BUG: Correctly raise exceptions on the number of arguments of function calls.
2018-08-15 08:37:25 +02:00
gambas
0b341e7c91 Compile optional arguments correctly.
[GB.JIT]
* BUG: Compile optional arguments correctly.
2018-08-15 00:01:51 +02:00
gambas
0297c1bafa Load classes without running the _init method, so that the JIT behaviour is closer to the interpreter behaviour.
[INTERPRETER]
* NEW: Add a JIT API for loading classes without running the _init method.

[GB.JIT]
* BUG: Load classes without running the _init method, so that the JIT behaviour is closer to the interpreter behaviour.
2018-08-14 16:46:55 +02:00
gambas
c569a234be Don't leak memory when converting an object to a boolean and correctly pop the arguments from the stack when propagating an exception.
[GB.JIT]
* BUG: Don't leak memory when converting an object to a boolean.
* BUG: Correctly pop the arguments from the stack when propagating an exception.
2018-08-14 12:15:04 +02:00
gambas
ad16238574 Correctly compile subroutines that return an unknown datatype.
[GB.JIT]
* BUG: Correctly compile subroutines that return an unknown datatype.
2018-08-14 10:57:49 +02:00
gambas
698e5dd948 Fix access to objects that can be invalid.
[GB.JIT]
* BUG: Fix access to objects that can be invalid.
2018-08-13 23:01:27 +02:00
gambas
bdb60ecef7 Correctly compile long public constants.
[GB.JIT]
* BUG: Correctly compile long public constants.
2018-08-13 00:24:38 +02:00
gambas
0975e520db JIT: Handle function datatype by raising a type mismatch error.
[INTERPRETER]
* NEW: JIT: Add an API for throwing type mismatch errors.
* BUG: Raise a type mismatch error when converting a function to a variant. Don't panic anymore.

[GB.JIT]
* BUG: Handle function datatype by raising a type mismatch error.
2018-08-11 14:06:46 +02:00
gambas
f882946561 Fix conversions of NULL.
[GB.JIT]
* BUG: Fix conversions of NULL.
2018-08-11 07:55:08 +02:00
gambas
3966bfbca7 Fix compilation of variant values borrowings and NULL values conversions.
[GB.JIT]
* BUG: Fix compilation of variant values borrowings.
* BUG: Fix NULL values conversions.
2018-08-10 13:53:20 +02:00
gambas
4209cffa11 [INTERPRETER]
* NEW: Fix panic error message.

[GB.JIT]
* BUG: Load project classes before try to resolve a unknown symbol.
* BUG: Correctly restore the stack pointer in all cases at function exit.
2018-08-10 13:26:54 +02:00
gambas
acf401ba2d Correctly reset the stack pointer when releasing the stack in error handlers.
[INTERPRETER]
* BUG: Do not clear the 'super' field of the object value returned by NEW, as it does not fix actually anything.

[GB.JIT]
* BUG: Correctly reset the stack pointer when releasing the stack in error handlers.
2018-08-09 11:05:51 +02:00
gambas
bb34431646 Fix a crash in JIT relative to SUPER management.
[INTERPRETER]
* BUG: Clear the 'super' field of the object value returned by NEW.

[GB.JIT]
* BUG: Correctly reset EXEC_super in error catching.
2018-08-06 13:26:49 +02:00
gambas
bba1946700 The datatype of object symbols was incorrectly computed.
[GB.JIT]
* BUG: The datatype of object symbols was incorrectly computed.
2018-07-08 08:24:31 +02:00
gambas
e04ec717c7 JIT: Structures and static arrays have been implemented.
[INTERPRETER]
* NEW: JIT: Support for structures and static arrays.

[GB.JIT]
* NEW: Structures and static arrays have been implemented.
2018-07-07 14:54:23 +02:00
gambas
ed775d62d4 Correctly handle function values used as arguments.
[GB.JIT]
* BUG: Correctly handle function values used as arguments.
2018-07-07 00:58:55 +02:00
gambas
d3c93a05e4 Work on new JIT system continues.
[INTERPRETER]
* NEW: Abort if a stack mismatch is detected after a JIT function has been called.

[GB.JIT]
* NEW: The GB_JIT_CC environment variable allows to define the C compiler that will generate the code.
* OPT: Don't call the compiler through a shell anymore.
* NEW: Support for clang.
* BUG: Don't use the "," operator anymore to write JIT code.
* BUG: Correctly free stack when leaving a function whereas we are still inside a GOSUB.
* BUG: Declare all local variables and arguments as volatile as soon the function uses CATCH or FINALLY.
2018-07-05 07:10:31 +02:00
gambas
527702ea59 Subroutines returning something that are used as instructions correctly drop their return value now.
[GB.JIT]
* BUG: Subroutines returning something that are used as instructions correctly drop their return value now.
2018-07-02 22:37:33 +02:00
gambas
9cf443a04f [INTERPRETER]
* BUG: Take JIT code into account when displaying current position in DEBUG instruction.

[COMPILER]
* BUG: Fix subroutine metadata.
* BUG: Fix subroutine search function.

[GB.JIT]
* BUG: Fix string referencing.
* NEW: Implement date arrays accessors.
* BUG: Fix error management.
* BUG: Fix mathematic functions implementation.
* NEW: Support of functions with a variable number of arguments.
* BUG: Fix support of Long constants.
* BUG: Fix implementation of Collection array operator.
* BUG: Fix READ, EXEC, SHELL and DEBUG instructions.
* BUG: Fix VarPtr().
* BUG: Fix TRUE constant implementation.
2018-07-02 19:37:37 +02:00
gambas
5f4f12acf3 [COMPILER]
* NEW: UNSAFE is a new keyword used in conjunction with FAST. It tells the JIT compiler not to do any safety check (null objects, division by zero, out of array bounds...). It makes the code a bit faster, but prone to segmentation fault.

[INTERPRETER]
* NEW: Support for the UNSAFE keyword.

[GB.JIT]
* NEW: Support for the UNSAFE keyword.
* NEW: Check validity of objects that can be invalid.
2018-06-29 00:10:31 +02:00
gambas
fe08dfa333 Work continues on new JIT system.
[INTERPRETER]
* NEW: JIT: Support for SUPER.
* NEW: JIT: Support for extern functions.
* NEW: Add a flag in Gambas functions to know if they are static or not.

[GB.JIT]
* NEW: Support for SUPER.
* NEW: Support for extern functions.
* BUG: Fix object arrays access.
* OPT: Optimization of Abs, Sgn, Int, Fix, and Pi subroutines.
2018-06-27 19:35:23 +02:00