Commit graph

905 commits

Author SHA1 Message Date
Benoît Minisini
292383c047 Handle the new bytecode of the Pi() function.
[GB.JIT]
* BUG: Handle the new bytecode of the Pi() function.
2023-10-18 18:46:09 +02:00
Benoît Minisini
8a1d604e32 Support for computed Goto or GoSub in JIT compiler.
[INTERPRETER]
* BUG: Correctly initialize functions without computed Goto or GoSub.

[GB.JIT]
* NEW: Support for computed Goto or GoSub.
2023-10-06 03:31:20 +02:00
Benoît Minisini
0f54fe9ccd Optimize object creation when there is no special method to call ('_new', '_ready', global variable initialization) and no inheritance.
[INTERPRETER]
* OPT: Optimize object creation when there is no special method to call ('_new', '_ready', global variable initialization) and no inheritance.
2023-10-05 18:09:48 +02:00
Benoît Minisini
ee81ba602a Big optimization of the interpreter loop by using a local program counter.
[INTERPRETER]
* OPT: Big optimization of the interpreter loop by using a local program counter.
* NEW: Use one short integer less in the bytecode files for each function using computed Goto.

[COMPILER]
* NEW: Use one short integer less in the bytecode files for each function using computed Goto.
2023-10-01 09:14:13 +02:00
Benoît Minisini
d98df39658 Some interpreter optimizations.
[INTERPRETER]
* OPT: Optimize object release for native integer and float arrays accessors.
* OPT: Shortcut path for adding a small integer or float constant number.

[COMPILER]
* OPT: Shortcut path for adding a small integer or float constant number.

[GB.JIT]
* NEW: Support for new bytecodes.
2023-09-30 00:18:13 +02:00
Benoît Minisini
46b2316e4a Free two more bytecodes.
[COMPILER]
* NEW: Free two more bytecodes.

[INTERPRETER]
* NEW: Free two more bytecodes.
2023-09-29 07:34:48 +02:00
Benoît Minisini
9fd602df70 Add Base() / Base$() and Dec() / FromBase() subroutines.
[COMPILER]
* NEW: Add Base() / Base$() subroutines.
* NEW: Add Dec() / FromBase() subroutines.

[INTERPRRETER]
* NEW: Add Base() / Base$() subroutines.
* NEW: Add Dec() / FromBase() subroutines.
2023-09-29 02:51:42 +02:00
Benoît Minisini
50b34cf8d9 Correctly translate 'On ... Goto / Gosub' jumping backward.
[GB.JIT]
* BUG: Correctly translate 'On ... Goto / Gosub' jumping backward.
2023-09-26 21:49:13 +02:00
Benoît Minisini
f9d3bcc1f5 Fix some typos.
[GB.COMPRESS]
* BUG: Fix some typos.
2023-09-21 23:00:52 +02:00
Benoît Minisini
5fa1961a62 Recover the speed of Gambas 3.18 by moving code.
[INTERPRETER]
* OPT: Recover the speed of Gambas 3.18 by moving code.
2023-08-16 18:04:08 +02:00
Benoît Minisini
7b8a7dbdb7 Optimize conversions from Pointer datatype.
[GB.JIT]
* OPT: Optimize conversions from Pointer datatype.
2023-08-16 16:33:50 +02:00
Benoît Minisini
f563dd0557 Style: Add 'Default' constant. It tells the Style routine to use the current painted control (if it exists) as a context.
[GB.DRAW]
* NEW: Support for 'Style.Default' constant.

[GB.GTK]
* NEW: Style: Add 'Default' constant. It tells the Style routine to use the current painted control (if it exists) as a context.

[GB.GTK3]
* NEW: Style: Add 'Default' constant. It tells the Style routine to use the current painted control (if it exists) as a context.
* BUG: Style: Painting the backgroud correctly takes the background color into account, unless for active state (i.e. pressed buttons).

[GB.QT4]
* NEW: Style: Add 'Default' constant. It tells the Style routine to use the current painted control (if it exists) as a context.
* NEW: 'Style.StateOf()' always adds the 'Style.Default' constant.

[GB.QT5]
* NEW: Style: Add 'Default' constant. It tells the Style routine to use the current painted control (if it exists) as a context.
* NEW: 'Style.StateOf()' always adds the 'Style.Default' constant.
2023-07-29 15:43:17 +02:00
Benoît Minisini
9c1e73a912 SQLRequest can return part of SQL requests without action or table.
[GB.DB]
* NEW: SQLRequest can return part of SQL requests without action or table.
2023-07-14 19:57:37 +02:00
Benoît Minisini
e5ce58b366 Forgot to release tmeporary buffer and result when using RETURNING.
[GB.DB]
* BUG: Forgot to release tmeporary buffer and result when using RETURNING.
2023-07-14 19:42:09 +02:00
Benoît Minisini
257bd622a3 Support for returning the newly inserted record. Add 'Connection.FullVersion' property.
[GB.DB]
* NEW: Connection: 'Create()' now has an optional 'Return' boolean argument
  to tell if the 'Result.Update()' method will fill the Result with the
  contents of the newly inserted record. It is based on the optional
  'INSERT INTO ... RETURNING' SQL feature.
* NEW: Connection: The 'FullVersion' property now return the full version
  string of the database server.
* NEW: Database drivers can tell if they do not support the 'RETURNING'
  keyword.
* NEW: Database drivers now must provide the full version string of they
  database server they connect to.
2023-07-14 12:08:11 +02:00
Benoît Minisini
d431251e2c New component switcher for choosing between QT4 or QT5 extension component.
[DEVELOPMENT ENVIRONMENT]
* NEW: Support for 'gb.gui.qt.ext' component.

[GB.GUI.QT.EXT]
* NEW: New component switcher for choosing between QT4 or QT5 extension component.
2023-07-09 19:35:54 +02:00
Benoît Minisini
4a3ccda95a Add static array read accessors to return new Compress and new Uncompress object of a specific type.
[GB.COMPRESS]
* NEW: Clean-up the code: spaces, indentation...
* NEW: Compress: Add a static array read accessor to return a new Compress object of a specific type.
* NEW: Uncompress: Add a static array read accessor to return a new Uncompress object of a specific type.
2023-04-03 23:53:27 +02:00
Benoît Minisini
06a1d2e33d 'Eval()' now can evaluate several expressions at once, provided that they are separated by newlines. The value of the last expression is returned.
[INTERPRETER]
* NEW: Support for the new Eval() feature.

[GB.EVAL]
* NEW: 'Eval()' now can evaluate several expressions at once, provided that they are separated by newlines. The value of the last expression is returned.
* NEW: 'Eval()' now returns NULL if its last expression returns nothing.
2023-03-29 12:16:47 +02:00
Benoît Minisini
d44be704d3 Sending a void line to the debugger repeats the last command only if the debugger is run from the command line.
[GB.DEBUG]
* NEW: If the 'GB_DEBUG_DEBUG' environment variable is '1', then a message is printed each time the debugger fifo fails and must be reopened.
* NEW: Sending a void line to the debugger repeats the last command only if the debugger is run from the command line.
2023-03-18 01:34:22 +01:00
Benoît Minisini
6b6c1e75b5 Add an API that inverts an image for the 'gb.image.effect' component.
[GB.IMAGE]
* NEW: Add an API that inverts an image for the 'gb.image.effect' component.
2023-03-17 03:11:30 +01:00
Benoît Minisini
d31e7c7aec Make Image.Invert() compatible with the method with the same name in 'gb.image'.
[GB.IMAGE.EFFECT]
* BUG: Make Image.Invert() compatible with the method with the same name in 'gb.image'.
2023-03-17 03:10:13 +01:00
Benoît Minisini
cac1a0f3d0 Make the debugger more robust when writing on a fifo fails. Reopen the fifo if needed.
[GB.DEBUG]
* BUG: Make the debugger more robust when writing on a fifo fails. Reopen the fifo if needed.
2023-03-07 00:09:01 +01:00
Benoît Minisini
203a1db252 Correctly rewrite lines using the 'ERROR' keyword in a one-line 'IF' expression.
[GB.EVAL]
* BUG: Correctly rewrite lines using the 'ERROR' keyword in a one-line 'IF' expression.
2023-02-04 09:29:21 +01:00
Benoît Minisini
ca20ea1cd7 Fix JIT compilation on old compilers that do not support arithmetic overflow check.
[GB.JIT]
* BUG: Fix JIT compilation on old compilers that do not support arithmetic overflow check.
2023-02-02 08:35:20 +01:00
Benoît Minisini
c69f98fdf1 Fix quoting when displaying a string value.
[GB.DEBUG]
* BUG: Fix quoting when displaying a string value.
2023-01-20 15:56:35 +01:00
Benoît Minisini
f7d5eda82c 'gb.image' is now compatible with 'gb.web.gui'.
[GB.IMAGE]
* NEW: Color: ToHTML() is a new method that converts a Gambas color as integer value to an HTML color representation.
2023-01-16 00:54:11 +01:00
Benoît Minisini
57aa63bec2 Fix arithmetic overflow detection on datatype conversion.
[GB.JIT]
* BUG: Fix arithmetic overflow detection on datatype conversion.
2023-01-13 23:20:04 +01:00
Christof Thalhofer
1a8fdb41b7 GambasSelftests integer overflow tests
[DEVELOPMENT ENVIRONMENT]
* NEW: GambasSelftests integer overflow tests
* FIX: GambasSelftests run.sh just tests without JIT

Also refactored GambasSelftests a bit and removed some duplicated code
2023-01-13 11:49:43 +01:00
Benoît Minisini
246cf40553 Don't use '-O3'. It makes benchmarks sometimes slower than using '-O2'.
[CONFIGURATION]
* BUG: Do not use the default CFLAGS forces by autotools. Either use the CFLAGS provided on the command-line, or the default ones of the project.

[INTERPRETER]
* OPT: Don't use '-O3'. It makes benchmarks sometimes slower than using '-O2'.

[COMPILER]
* OPT: Optimize variable initialization.
2023-01-10 21:55:25 +01:00
Benoît Minisini
f05de9b897 Fix rewrite of ERROR instruction.
[GB.EVAL]
* BUG: Fix rewrite of ERROR instruction.
2023-01-05 17:39:29 +01:00
Benoît Minisini
1fd1d16ec8 Convert two global interpreter flags from boolean to bitfield.
[INTERPRETER]
* NEW: Convert two global interpreter flags from boolean to bitfield.
* NEW: Remove a unused JIT API and take the previous into account.

[GB.JIT]
* NEW: Take the boolean to bitfield interpreter flag changes into account.
2023-01-04 18:49:13 +01:00
Benoît Minisini
51a88d26b4 'Error' keyword is now correctly written without spurious spaces around.
[GB.TEST]
* BUG: 'Error' keyword is now correctly written without spurious spaces around.
2023-01-04 17:05:46 +01:00
Benoît Minisini
c24d92c21d Correctly rewrite the 'Error' keyword.
[COMPILER]
* NEW: Synchronize with 'gb.eval' parser.

[GB.EVAL]
* NEW: Synchronize with compiler parser.
* BUG: Correctly rewrite the 'Error' keyword.
2023-01-04 17:04:34 +01:00
Benoît Minisini
7a8610f779 Paint.Rectangle() with a border radius now works as expected with a negative width or height.
[GB.DRAW]
* BUG: Paint.Rectangle() with a border radius now works as expected with a negative width or height.
2023-01-03 14:38:46 +01:00
Benoît Minisini
ffa0611cea Factorize exception management in JIT code.
[GB.JIT]
* OPT: Factorize exception management in JIT code.
2023-01-03 14:25:00 +01:00
Benoît Minisini
3c1a76248b Add Expand() and Shrink() methods to the rectangle classes.
[GB.GEOM]
* NEW: Add Expand() and Shrink() methods to the rectangle classes.
2023-01-02 20:22:30 +01:00
Benoît Minisini
b145355b76 The debugger now indicates if the printed information is from the current stack frame or from another one.
[GB.DEBUG]
* NEW: The debugger now indicates if the printed information is from the current stack frame or from another one.
2022-12-16 08:46:17 +01:00
Benoît Minisini
c10fe0a6c3 Optimization of conditional jumps based on values known to be Boolean.
[COMPILER]
* OPT: Optimization of conditional jumps based on values known to be Boolean.
* BUG: Jump optimization is effective when debugging information is generated.
* BUG: The '/' operator correctly returns a Float if its arguments are Float.

[INTERPRETER]
* OPT: Optimization of conditional jumps based on values known to be Boolean.

[GB.JIT]
* NEW: Support for conditional jumps optimization.
2022-12-10 12:54:42 +01:00
Benoît Minisini
e495a05249 The Image constructor now fills the image data with 'Color.Transparent' color by default.
[GB.IMAGE]
* NEW: The Image constructor now fills the image data with 'Color.Transparent' color by default. To get uninitialized image data, you must specified 'Color.Default' as fill color.
2022-12-10 00:06:50 +01:00
Benoît Minisini
af950247c4 Implement overflow detection in JIT compiler. Some jump optimizations in the compiler and the interpreter.
[COMPILER]
* OPT: Optimize jumps pointing at a JUMP instruction.

[INTERPRETER]
* OPT: Avoid conversion to boolean when possible in conditional jumps.

[GB.JIT]
* NEW: Implement overflow detection in integer arithmetic operations. The UNSAFE keyword disable them to get full speed.
2022-12-09 15:00:55 +01:00
Christof Thalhofer
e56fe65925 test-fast for quick selftest in root dir
[DEVELOPMENT ENVIRONMENT]
* NEW: Add shell script test-fast in root dir for quick selftest
2022-12-05 17:17:35 +01:00
Benoît Minisini
0fcacdebdf Raise a "Mathematic error" if the real or imaginary part of a complex number is not finite.
[GB.COMPLEX]
* NEW: Raise a "Mathematic error" if the real or imaginary part of a complex number is not finite.
2022-11-29 20:52:14 +01:00
Benoît Minisini
92dccf468a Result: 'Editable' is a new property that returns if the result is editable.
[GB.DB]
* NEW: Result: 'Editable' is a new property that returns if the result is editable.
2022-11-15 02:16:24 +01:00
Benoît Minisini
3d628e41b3 Fix JIT compilation of extern function calls.
[INTERPRETER]
* NEW: Add an API for the JIT compiler that retrieves the address of an object or a class for external functions.

[GB.JIT]
* BUG: Fix JIT compilation of extern function calls.
2022-10-17 23:30:21 +02:00
Benoît Minisini
f528f4d4ca Fix JIT compilation of class inheriting from another class and Left$(), Right$() and Mid$() routines.
[INTERPRETER]
* BUG: Fix JIT compilation of class inheriting from another class.

[GB.JIT]
* BUG: Fix compilation of Left$(), Right$() and Mid$() routines.
2022-10-15 19:30:03 +02:00
Benoît Minisini
09adb643df Bool@(), Byte@()... functions can be the target of an affectation now.
[INTERPRETER]
* NEW: Bool@(), Byte@()... functions can be the target of an affectation now.

[COMPILER]
* NEW: Bool@(), Byte@()... functions can be the target of an affectation now.

[GB.JIT]
* NEW: Bool@(), Byte@()... functions can be the target of an affectation now.
2022-10-08 10:26:50 +02:00
Benoît Minisini
1004b39078 Optimization of small integer floating point constants.
[COMPILER]
* OPT: Optimization of small integer floating point constants.

[INTEGER]
* OPT: Optimization of small integer floating point constants.

[GB.JIT]
* OPT: Optimization of small integer floating point constants.
2022-10-07 13:10:22 +02:00
Benoît Minisini
f749ce2030 Save 'errno' before running the debugger, and restore it after.
[GB.DEBUG]
* BUG: Save 'errno' before running the debugger, and restore it after.
2022-10-06 17:45:06 +02:00
Benoît Minisini
56cc729fe0 Fix backward-compatibility with previous bytecode.
[INTERPRETER]
* BUG: Fix backward-compatibility with previous bytecode.
* OPT: Optimizations of local variables and argument assignements.
* BUG: NULL can be serialized on streams correctly now.
2022-10-04 22:49:01 +02:00
Benoît Minisini
50893e77cb Various optimizations of the interpreter execution loop.
[COMPILER]
* OPT: Support for local variable manipulation optimization.

[INTERPRETER]
* OPT: Avoid unneeded type conversion swhen manipulating local variables.
* OPT: Various optimizations of the interpreter execution loop. Apparently a smaller execution loop has a big impact on speed. I guess this is related to the size of the various CPU caches.
2022-10-04 01:04:15 +02:00