Commit graph

1493 commits

Author SHA1 Message Date
Benoît Minisini
b891f3a81e Add a new process objet to the internal process object list after signals have been checked.
[INTERPRETER]
* BUG: Add a new process objet to the internal process object list after signals have been checked.
2023-10-31 13:26:18 +01:00
Benoît Minisini
1608babe38 Enhance the Gambas code analyzer to speed up the new highlighting component.
[COMPILER]
* BUG: Synchronize reserved words enumeration with reserved words table.

[GB.EVAL]
* NEW: Highlight: 'Analyze()' got a new optional boolean parameter that stops the analyze when the "%>" token is encountered.
* NEW: Highlight: 'IsFunction' is a new property that returns if 'Highlight.Analyze()' got a function declaration.
* NEW: Highlight: 'LengthBefore' is a new property that returns the number of analyzed characters before the possible rewrite.
2023-10-28 23:36:10 +02:00
Benoît Minisini
489ee69382 Fix a bad optimization in fast array accessors.
[INTERPRETER]
* BUG: Fix a bad optimization in fast array accessors.
2023-10-28 02:01:41 +02:00
Benoît Minisini
4248a5c43d INPUT ignores leading spaces characters now.
[INTERPRETER]
* NEW: INPUT ignores leading spaces characters now.
2023-10-26 02:39:00 +02:00
Benoît Minisini
ac0f2ba85e Make "%>" a keyword for syntax analyze of gambas code embedded into a WebPage. Some other fixes in the interpreter and the compiler.
[INTERPRETER]
* BUG: A global class find does now a global class lookup. It seems more logical.
* BUG: When loading a class fails, display an accurate error message.

[COMPILER]
* BUG: Embedded arrays do not raise warnings on being uninitialized anymore.
* NEW: Make "%>" a keyword for syntax analyze of gambas code embedded into a WebPage.
2023-10-24 04:29:01 +02:00
Benoît Minisini
b610a6a2d1 FromURL() does not decode '+' into a space before having encountered the '?' query delimiter character.
[INTERPRETER]
* BUG: FromURL() does not decode '+' into a space before having encountered the '?' query delimiter character.
2023-10-18 21:33:06 +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
bdea5c8a7c Fix compilation on Ubuntu Trusty.
[INTERPRETER]
* BUG: Fix compilation on Ubuntu Trusty.
2023-10-05 22:44:36 +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
c6ef469966 Optimize stack pointer manipulations in the main interpreter loop.
[INTERPRETER]
* OPT: Optimize stack pointer manipulations in the main interpreter loop. About 10% speed gain according to the benchmarks!
2023-10-04 12:17:31 +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
c600f69be3 Implementation of computed Goto and GoSub.
[INTERPRETER]
* NEW: Implementation of computed Goto and GoSub.

[COMPILER]
* NEW: Implementation of computed Goto and GoSub.
* NEW: There is a maximum of 255 labels by function now. This limit may be removed.
2023-09-30 22:00:00 +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
542d72d39d Do not try to disable CTE support if gcc does not have the corresponding flag.
[CONFIGURATION]
* BUG: Do not try to disable CTE support if gcc does not have the corresponding flag.

[INTERPRETER]
* BUG: Do not try to disable CTE support if gcc does not have the corresponding flag.
2023-09-29 17:34:48 +02:00
Benoît Minisini
ce140f53a6 Disable gcc indirect branch tracking for main interpreter function. This Intel security feature makes the interpreter 20% slower!
[INTERPRETER]
* OPT: Disable gcc indirect branch tracking for main interpreter function. This Intel security feature makes the interpreter 20% slower!
2023-09-29 16:35:51 +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
9c6c65107b Some support for older versions of gcc without overflow detection.
[INTERPRETER]
* BUG: Some support for older versions of gcc without overflow detection.
2023-09-29 03:21:07 +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
a1ebbfdd3f Fix a typo in an error message.
[INTERPRETER]
* BUG: Fix a typo in an error message.
2023-09-28 02:55:41 +02:00
Benoît Minisini
dabe089ff7 Prevent some optimizations that cannot work in a just-in-time context.
[INTEPRETER]
* BUG: Prevent some optimizations that cannot work in a just-in-time context.
2023-08-16 19:30:07 +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
c10a03cb59 Don't crash if the argument of 'SizeOf()' is incorrect, but raise an error instead.
[INTERPRETER]
* BUG: Don't crash if the argument of 'SizeOf()' is incorrect, but raise an error instead.
2023-08-16 13:07:35 +02:00
Benoît Minisini
090dd4e048 Fix '&=' operator optimization on global string variables.
[INTERPRETER]
* BUG: Fix '&=' operator optimization on global string variables.
2023-06-13 21:24:08 +02:00
Benoît Minisini
fc640da3bd Allow to open a directory in direct mode for reading only, as Linux allows that.
[INTERPRETER]
* NEW: Allow to open a directory in direct mode for reading only, as Linux allows that.
2023-05-13 03:01:39 +02:00
Benoît Minisini
bfe5a88537 Fix common integer loop optimization.
[INTERPRETER]
* BUG: Fix common integer loop optimization.
2023-04-13 12:05:09 +02:00
Benoît Minisini
e826acb35a Correctly read the project name in the '.startup' file.
[INTERPRETER]
* BUG: Correctly read the project name in the '.startup' file.
2023-04-12 23:23:19 +02:00
Benoît Minisini
fcc386d0f6 When a signal handler is set, ensure that the signal is not blocked.
[INTERPRETER]
* BUG: When a signal handler is set, ensure that the signal is not blocked.
2023-04-12 20:55:05 +02:00
Benoît Minisini
516736852d Correctly free environment declared in the project configuration at program exit.
[INTERPRETER]
* BUG: Correctly free environment declared in the project configuration at program exit.
2023-04-02 05:36:17 +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
d42aad3a65 'Object.Data()' is a new method that returns the address of the data of an object.
[INTERPRETER]
* NEW: 'Object.Data()' is a new method that returns the address of the data of an object.
2023-03-27 00:51:44 +02:00
Benoît Minisini
38519f8b3e Alloc() now fills the allocated memory with zeros when used with two arguments.
[INTERPRETER]
* NEW: Alloc() now fills the allocated memory with zeros when used with two arguments.
2023-03-25 01:12:02 +01:00
Benoît Minisini
2f81de1876 When using an intermediate temporary stream, copy the behaviour flags from the original stream.
[INTERPRETER]
* BUG: When using an intermediate temporary stream, copy the behaviour flags from the original stream.
2023-03-24 21:26:45 +01:00
Benoît Minisini
7cd804982b Fix a test that leads to a crash when gcc optimizations are enabled.
[INTERPRETER]
* BUG: Fix a test that leads to a crash when gcc optimizations are enabled.
2023-03-24 20:57:42 +01:00
Benoît Minisini
30c5e0af42 Add implicit conversion of Boolean, Byte and Short values into Pointer.
[INTERPRETER]
* NEW: Add implicit conversion of Boolean, Byte and Short values into Pointer.
2023-03-20 23:31:51 +01:00
Benoît Minisini
44bdb9486f Support for environment variables set at startup.
[INTERPRETER]
* NEW: Set environment variables at startup from the '.environment' file.

[COMPILER]
* NEW: Generate the '.environment' files with the list of environment variables that must be set at startup.

[ARCHIVER]
* NEW: Add the '.environment' file to the archive.
2023-03-18 01:36:19 +01:00
Benoît Minisini
648b123f07 The support for external debugging now uses the project name, not the executable name, which may be different.
[INTERPRETER]
* BUG: The support for external debugging now uses the project name stored
  in the '.startup' file, not the executable name, which may be different.

[COMPILER]
* NEW: Write the name of the project in the '.startup' file.
2023-03-17 03:12:52 +01:00
Benoît Minisini
11db600d2c 'Application.TempDir' is a new property that returns the temporary directory used by the interpreter for the current process.
[INTERPRETER]
* NEW: 'Application.TempDir' is a new property that returns the temporary directory used by the interpreter for the current process.
2023-03-14 19:13:56 +01:00
Benoît Minisini
78f4986c3c Forked processes now use fast exit, to avoir a possible crash.
[INTERPRETER]
* BUG: Forked processes now use fast exit, to avoir a possible crash.
2023-03-04 17:26:58 +01:00
Benoît Minisini
97534cc720 Delete temporary files when the QUIT instruction is used.
[INTERPRETER]
* BUG: Delete temporary files when the QUIT instruction is used.
2023-02-12 00:29:53 +01:00
Benoît Minisini
54f62f479e 'WAIT' with no argument now behaves as before when no component specific WAIT handler is defined.
[INTERPRETER]
* BUG: 'WAIT' with no argument now behaves as before when no component specific WAIT handler is defined.
2023-02-02 10:05:38 +01:00
Benoît Minisini
46c13a4b9b 'System.IgnoreOverflow = True' now never raises an error.
[INTERPRETER]
* BUG: 'System.IgnoreOverflow = True' now never raises an error.
2023-01-12 13:22:16 +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
caacdd9c2f Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported. Fix reference leak in drag & drop target management of Qt components.
[INTERPRETER]
* NEW: 'GB.Push()' now can handle Variant values.

[GB.GTK]
* NEW: Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported.

[GB.GTK3]
* NEW: Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported.

[GB.QT4]
* BUG: Fix reference leak in drag & drop target management.
* NEW: Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported.

[GB.QT5]
* BUG: Fix reference leak in drag & drop target management.
* NEW: Control.Drag() now calls Drag(), so that 'text/uri' mimetype is supported.
2023-01-09 02:45:52 +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
95574a9170 'System.IgnoreOverflow' is a new property that allows to ignore overflows in arithmetic operations.
[INTERPRETER]
* NEW: 'System.IgnoreOverflow' is a new property that allows to ignore overflows in arithmetic operations.
* OPT: Replace most of boolean global interpreter flags by bitfields.
2023-01-04 17:06:41 +01:00
Benoît Minisini
cdece09186 Check all child terminations when we detect that the SIGCHLD handler has been replaced by an idiotic library like 'glib'.
[INTERPRETER]
* BUG: Check all child terminations when we detect that the SIGCHLD handler has been replaced by an idiotic library like 'glib'.
2023-01-01 11:24:44 +01:00
Benoît Minisini
b2e95aa882 Prevent Add(), Remove() and Resize() methods on read-only arrays.
[INTERPRETER]
* BUG: Prevent Add(), Remove() and Resize() methods on read-only arrays.
2022-12-24 14:07:03 +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
e082046379 Suppression de deux étiquettes inutiles dans la boucle de l'interpréteur.
[INTERPRETER]
* BUG: Suppression de deux étiquettes inutiles dans la boucle de l'interpréteur.
2022-12-09 20:05:39 +01:00
Benoît Minisini
5d0c54bca2 Some fixes in overflow detection.
[INTERPRETER]
* BUG: Fix overflow detection in conversion functions.
* BUG: Check for overflow detection only if the '__has_builtin' pseudo-macro is implemented by the compiler.
2022-12-09 16:07:12 +01:00