Commit graph

2377 commits

Author SHA1 Message Date
Benoît Minisini
d13471c82a Forgot to commit a source file in commit 76196d2c!
[COMPILER]
* BUG: Forgot to commit a source file in commit 76196d2c!
2022-12-12 16:43:41 +01:00
Benoît Minisini
76196d2cd5 Fix parsing of 'Debug' symbol in preprocessor lines. Don't crash anymore if an error is raised while reading command-line arguments.
[COMPILER]
* BUG: Fix parsing of 'Debug' symbol in preprocessor lines.
* BUG: Don't crash anymore if an error is raised while reading command-line arguments.
2022-12-11 16:44:46 +01:00
Benoît Minisini
7480a9b14c Workaround incorrect use of unsigned color constants by the IDE form editor.
[COMPILER]
* NEW: Workaround incorrect use of unsigned color constants by the IDE form editor.
2022-12-10 20:44:10 +01:00
Benoît Minisini
53cd261647 Fix jump optimization again.
[COMPILER]
* BUG: Fix jump optimization again.
2022-12-10 20:36:49 +01:00
Benoît Minisini
bab0f763c5 Do not run jump optimization on ON GOTO / ON GOSUB, it breaks them.
[COMPILER]
* BUG: Do not run jump optimization on ON GOTO / ON GOSUB, it breaks them.
2022-12-10 19:39: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
0acbd1979c Ignore jumps to the end of the function when optimizing jumps.
[COMPILER]
* BUG: Ignore jumps to the end of the function when optimizing jumps.
2022-12-10 00:22:17 +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
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
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
Benoît Minisini
c2c08aef6c The '/' operator does not necessarily return a Float. Fix incorrect optimizations that lead to interpreter crashes.
[COMPILER]
* BUG: The '/' operator does not necessarily return a Float. Fix incorrect optimizations that lead to interpreter crashes.
2022-12-08 15:52:56 +01:00
Benoît Minisini
9e89ea687f Try to make 'gb_overflow.h' compilable everywhere.
[INTERPRETER]
* BUG: Try to make 'gb_overflow.h' compilable everywhere.
2022-12-07 01:24:18 +01:00
Benoît Minisini
68f7c1160a Merge branch 'master' of gitlab.com:gambas/gambas 2022-12-06 20:31:15 +01:00
Benoît Minisini
0a7f10ad52 Integer arithmetic and conversion now raise an error if overflow is detected.
[INTERPRETER]
* NEW: Integer arithmetic and conversion now raise an error if overflow is detected.
2022-12-06 20:30:39 +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
39bf786af9 The parser handles correctly the ERROR keyword again.
[COMPILER]
* BUG: The parser handles correctly the ERROR keyword again.
2022-12-05 13:32:39 +01:00
Benoît Minisini
7a238f4c76 Make the compiler more clever when deciding if an identifier is a reserved keyword or not. Some optimizations in the compiler parser.
[INTERPRETER]
* OPT: Put less code in the main interpreter loop because it became too big again with gcc 12.

[COMPILER]
* OPT: Some optimizations in the parser.
* NEW: Make the compiler more clever when deciding if an identifier is a reserved keyword or not.
2022-12-04 20:00:04 +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
50e5bba9df Finally the divide operator does not return infinities. It raises a "Mathematic error" instead.
[INTERPRETER]
* NEW: Finally the divide operator does not return infinities. It raises a "Mathematic error" instead.
2022-11-29 20:47:26 +01:00
Benoît Minisini
c997255367 The divide operator now returns infinity when the numerator is infinity, and raises "Division by zero" error only if the numerator is zero.
[INTERPRETER]
* NEW: The divide operator now returns infinity when the numerator is infinity, and raises "Division by zero" error only if the numerator is zero.
2022-11-29 15:34:51 +01:00
Benoît Minisini
f947fb176d Add 48x48 version of mimetypes and application icons.
[CONFIGURATION]
* NEW: Add 48x48 version of mimetypes and application icons.
2022-11-29 11:24:48 +01:00
Benoît Minisini
5621991e1f Fix Format$() on numbers when the format string uses "0" character in the exponant part and the exponant is negative.
[INTERPRETER]
* BUG: Fix Format$() on numbers when the format string uses "0" character in the exponant part and the exponant is negative.
2022-11-17 21:40:49 +01:00
Benoît Minisini
22ced08f0d The timezone now can be specified in a string that represents a date.
[INTERPRETER]
* NEW: The timezone now can be specified in a string that represents a
  date, by adding a space followed by "UTC" or "GMT", a plus or minus
  sign, the hours, and optionnaly a colon followed the minutes.
2022-11-17 01:35:05 +01:00
Benoît Minisini
3aa8434179 Add 'Array.Empty' and 'Collection.Empty' properties.
[INTERPRETER]
* NEW: Array: 'Empty' is new property that returns if an array is empty.
* NEW: Collection: 'Empty' is new property that returns if a collection is empty.
2022-11-16 23:03:37 +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
dc2d102a95 Move some code outside of 'gbx_exec_loop.c' source file.
[INTERPRETER]
* OPT: Move some code outside of 'gbx_exec_loop.c' source file. Apparently if the result of the compilation of this source file is too big, the interpreter can be about 150% slower.
2022-10-08 22:39:44 +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
Benoît Minisini
dba45b1fed Don't use 3.18 multiply and divide optimization if current bytecode version is lower than 3.18.
[INTERPRETER]
* BUG: Don't use 3.18 multiply and divide optimization if current bytecode version is lower than 3.18.
2022-10-03 19:10:42 +02:00
Benoît Minisini
d7e373c633 Always check bytecode version when the current class changes during interpreter execution loop.
[INTERPRETER]
* BUG: Always check bytecode version when the current class changes during interpreter execution loop.
2022-10-03 13:46:20 +02:00
Benoît Minisini
df270cbbc0 Fix optimization of dynamic variable writing.
[INTERPRETER]
* BUG: Fix optimization of dynamic variable writing.
2022-10-01 20:04:20 +02:00
Benoît Minisini
5d1db11ab3 Fix optimization of dynamic variable reading.
[INTERPRETER]
* BUG: Fix optimization of dynamic variable reading.
2022-10-01 20:03:37 +02:00
Benoît Minisini
fd66b99f32 Some optimizations of the main interpreter loop.
[INTERPRETER]
* OPT: Some optimizations of the main interpreter loop.
2022-10-01 16:26:08 +02:00
Benoît Minisini
558360ab97 Fix compilation on non-C99 compiler.
[INTERPRETER]
* BUG: Fix compilation on non-C99 compiler.
2022-10-01 01:31:15 +02:00
Benoît Minisini
13aa1311d7 Optimize array access and basic arithmetic operator on integer and floats.
[INTERPRETER]
* OPT: Optimize array access and basic arithmetic operator on integer and floats.
2022-10-01 00:54:05 +02:00
Benoît Minisini
59051975ec Make 'gb.hash' compile on 32 bits architectures.
[GB.HASH]
* BUG: Make 'gb.hash' compile on 32 bits architectures.
2022-09-24 11:50:31 +02:00
Benoît Minisini
1c64c42ada Make 'gb.hash' compile on non-64 bits architectures.
[GB.HASH]
* BUG: Make 'gb.hash' compile on non-64 bits architectures.
2022-09-20 15:06:35 +02:00
Benoît Minisini
7c42524ecd Connection: It's now possible to specify the password in the connection URL.
[GB.DB]
* NEW: Connection: The URL argument of the Connection constructor is now handled by the Gambas part.
* NEW: Connection: It's now possible to specify the password in the connection URL.
2022-09-20 12:54:14 +02:00
Benoît Minisini
219507b53e Forgot to commit two source files.
[GB.HASH]
* BUG: Forgot to commit two source files.
2022-09-18 00:37:54 +02:00
Benoît Minisini
580a51b659 Replace hash native functions by static methods in a 'Hash' class implemented in the 'gb.hash' component.
[COMPILER]
* NEW: Remove Md5() and other hash native functions.

[INTERPRETER]
* NEW: Remove Md5() and other hash native functions.

[GB.HASH]
* NEW: 'Hash' is a new static class with methods that implement The 'Md5', 'Sha1', 'Sha256' and 'Sha512' hash functions.
2022-09-17 22:41:29 +02:00
Benoît Minisini
0b7c342e8e Add Md5(), Sha1(), Sha256() and Sha512() functions.
[CONFIGURATION]
* NEW: Update 'README' and 'README.md' files.

[COMPILER]
* NEW: Add Md5(), Sha1(), Sha256() and Sha512() functions.

[INTERPRETER]
* NEW: Add Md5(), Sha1(), Sha256() and Sha512() functions.

[GB.HASH]
* NEW: This is a new component that implements the Md5(), Sha1(), Sha256() and Sha512() functions.
  The code comes from BusyBox.
2022-09-13 02:48:11 +02:00
Benoît Minisini
0111231df9 Fix compilation.
[GB.EVAL]
* BUG: Fix compilation.
2022-09-12 15:17:22 +02:00
Benoît Minisini
6a793ddeb7 Replace my old depracted gmail mail by the new one.
[CONFIGURATION]
* NEW: Replace my old depracted gmail mail by the new one.
2022-09-12 15:13:13 +02:00
Benoît Minisini
1cec6f118b Free 14 bytecode slots by using 'ADD QUICK' for numbers between -255 and 255 only.
[COMPILER]
* NEW: Free 14 bytecode slots by using 'ADD QUICK' for numbers between -255 and 255 only.
2022-09-12 15:02:39 +02:00