Commit graph

474 commits

Author SHA1 Message Date
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
f937ee9fe0 Support for e2k architecture (continue...)
[INTERPRETER]
* NEW: Support for e2k architecture (continue...)
2023-08-04 15:55:39 +02:00
Benoît Minisini
8210240eb9 Support for e2k architecture.
[CONFIGURATION]
* NEW: Support for e2k architecture.

[INTERPRETER]
* NEW: Support for e2k architecture.
2023-08-04 13:39:55 +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
a309559bdb '+Inf' and '-Inf' really do not prevent the next pattern to be a reserved keyword anymore.
[COMPILER]
* BUG: '+Inf' and '-Inf' really do not prevent the next pattern to be a reserved keyword anymore.
2023-04-27 14:55:02 +02:00
Benoît Minisini
b03cfc16bf Enable overflow detection when at least 'gcc 8' is used.
[INTERPRETER]
* BUG: Enable overflow detection when at least 'gcc 8' is used.
2023-01-10 17:08:16 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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
Benoît Minisini
f3cfc51374 Connection: Request substitution methods now support "[&1]" and "&1" quoting syntax to quote a table name or a column name.
[INTERPRETER]
* NEW: Enhance 'GB.SubstStringAdd()' and add 'GB.SubstStringUnquote()' API to support custom quoting in 'gb.db'.

[GB.DB]
* NEW: Connection: Request substitution methods now support "[&1]" and "`&1`" quoting syntax to quote a table name or a column name.
2022-09-05 00:59:44 +02:00
Benoît Minisini
0ec57295b7 Remove useless LIKELY() and UNLIKELY() macros. Add a class flag for bytecode strictly older than 3.18.
[COMPILER]
* NEW: Remove useless LIKELY() and UNLIKELY() macros.

[INTERPRETER]
* NEW: Remove useless LIKELY() and UNLIKELY() macros.
* NEW: Add a class flag for bytecode strictly older than 3.18.

[GB.DEBUG]
* BUG: Fix incorrect 'printf' format on 32-bits architectures.
2022-09-03 14:20:13 +02:00
Benoît Minisini
56e9129f85 PROPERTY WRITE now declares a write-only property.
[INTERPRETER]
* NEW: Support for write-only properties.

[COMPILER]
* NEW: PROPERTY WRITE now declares a write-only property.
2022-08-01 22:03:54 +02:00
Benoît Minisini
d053ced083 Add an API to retrieve the last error message.
[INTERPRETER]
* NEW: Add an API to retrieve the last error message.
2022-07-23 15:40:08 +02:00
Benoît Minisini
21d9bd178e Display bytecode statistics in verbose, no background task mode.
[COMPILER]
* NEW: Display bytecode statistics in verbose, no background task mode.
2022-07-22 20:40:20 +02:00
Benoît Minisini
178c665461 In 'gb.openssl', use the API instead of directly including interpreter header files.
[INTERPRETER]
* NEW: Add all comparison constants to 'gambas.h' API header file.

[GB.OPENSSL]
* BUG: Use the API instead of directly including interpreter header files. It breaks compilation on Ubuntu 22.10.1.
2022-05-28 18:51:48 +02:00
gambas
1794f4e072 Add <stdio.h> include to 'gb_system_temp.h', when there is no support for returning the number of CPUs.
[INTERPRETER]
* BUG: Add <stdio.h> include to 'gb_system_temp.h', when there is no support for returning the number of CPUs.
2022-02-21 16:14:31 +01:00
gambas
fc49ac6148 Forgot to commit a file. 2022-01-14 22:02:29 +01:00
gambas
1cc4d42742 Add an API that returns if there is at least one active timer.
[INTERPRETER]
* NEW: Add an API that returns if there is at least one active timer.
2022-01-14 12:34:02 +01:00
gambas
52c5823669 Fix compilation of 'share/gb_system_temp.h' on non-Linux/BSD systems.
[INTERPRETER]
* BUG: Fix compilation of 'share/gb_system_temp.h' on non-Linux/BSD systems.
2022-01-07 11:38:46 +01:00
gambas
558f05fe21 Fix array and allocation management, so that allocating a byte array with a number of elements near the greatest integer does not crash anymore.
[INTERPRETER]
* BUG: Fix array and allocation management, so that allocating a byte array with a number of elements near the greatest integer does not crash anymore.
2021-12-09 23:50:41 +01:00
Benoît Minisini
f3ec57aa2b Merge branch 'master' into 'master'
Call get_nprocs on Cygwin like on Linux

See merge request gambas/gambas!249
2021-12-06 17:29:39 +00:00
gambas
fa133a3c78 The output of 'msgfmt' executions is stored in log files, one by translation.
[COMPILER]
* NEW: The output of 'msgfmt' executions is stored in log files, one by translation.
2021-11-08 01:43:27 +01:00
gambas
c1d255d35c Fix signature of GB.GetProperty() API.
[INTERPRETER]
* BUG: Fix signature of GB.GetProperty() API.
2021-10-27 18:39:30 +02:00
gambas
85cbb94625 Support for debugging a process not run by the IDE.
[INTERPRETER]
* NEW: Support for "remote" debugging, i.e. debugging a process not run by the IDE.
  It is activated by the existence of a symbolic link named '/tmp/gambas-<project name>.debug'
  pointing at the IDE temporary directory. The symbolic link is destroyed by the debuggee, so that
  no other process of the same project can use it.
* BUG: Remove support of two deprecated parameters in '.startup' file.
* NEW: The internal common string buffer size is now equal to 'PATH_MAX'.

[GB.DEBUG]
* NEW: Support for "remote" debugging.
* OPT: The debugger process now opens the output fifo in blocking mode when needed, and the
  debugged process opens the output fifo for reading when needed too.
2021-10-20 02:28:22 +02:00
gambas
165e680dce Fix generation of floating point constants whose value is an integer.
[COMPILER]
* BUG: Fix generation of floating point constants whose value is an integer.
* BUG: Fix a possible memory corruption after the end of the compilation of the first class.
2021-10-17 01:08:30 +02:00
gambas
bc806a189b The parser now does not store integer numbers in its global symbol table anymore. Compile is now about 5% faster.
[COMPILER]
* OPT: The parser now does not store integer numbers in its global symbol table anymore.
* OPT: Some other little optimizations here and here. The compiler is now about 5% faster.

[ARCHIVER]
* NEW: Compile with '-O3' optimization flag.

[INFORMER]
* NEW: Compile with '-O3' optimization flag.

[GB.EVAL]
* OPT: The parser now does not store integer numbers in its global symbol table anymore.
2021-10-14 03:01:14 +02:00
gambas
d651287c43 Now integer constants can be simple integer expressions in array, constant and enumeration declarations.
[COMPILER]
* NEW: Shr, Shl, Asr, Asl, Lsl, Lsr, Rol and Ror can now be used as operators.
* NEW: Now integer constants can be simple integer expressions in array, constant and enumeration declarations.

[GB.EVAL]
* BUG: Fix a compiler warning.
2021-10-12 13:33:45 +02:00
Bastian Germann
695c24646f Call get_nprocs on Cygwin like on Linux 2021-09-15 16:15:19 +02:00
gambas
d5105c8349 Remove an extra newline at the end of the "non freed allocation" warning message.
[INTERPRETER]
* BUG: Remove an extra newline at the end of the "non freed allocation" warning message.
2021-06-16 01:54:12 +02:00
gambas
67d266d79b Call an optional fork helper in each loaded component libraries before starting a task.
[INTERPRETER]
* NEW: Call an optional fork helper in each loaded component libraries before starting a task.
2021-06-05 03:11:54 +02:00