Commit Graph

50 Commits

Author SHA1 Message Date
Valk Richard Li b25a1bc3f4 more efficient str2num 2021-06-05 20:42:58 +08:00
Valk Richard Li 8e29a3ec5b bug fixed & more efficient callfv
I changed callfv's way of calling a function with arguments in vm_vec.
now callfv fetches arguments from val_stack directly,so it runs test/fib.nas from 2.4s to 1.9s.

delete operand callf,add operands callfv & callfh.

also,i check val_stack's top to make sure there is not a stack overflow.
2021-06-03 21:49:31 +08:00
Valk Richard Li a68bf85f04 bug fixed
a gc bug which causes  fatal error.
add member value collect to make sure that nasal_val is not collected repeatedly.
use builtin_alloc in builtin function to avoid incorrect collection of value in use(gc_alloc).
change free_list to free_list[vm_type_size] to avoid too many calls of new/delete(but seems useless?)
but the most important thing is fixing this bug.
2021-05-31 19:10:59 +08:00
Valk Richard Li a463af53b7 add license & other changes
parser recognizes syntax errors more accurately.
change some for loop to standard c++11 for(auto iter:obj)
add MIT license
change info in README.md
2021-05-04 17:39:24 +08:00
Valk Richard Li 6adb991c04 parser reports syntax error accurately
still need improvement
2021-05-04 01:13:53 +08:00
Valk Richard Li c5f4736984 change scope from unordered_map to vector 2021-04-19 19:12:41 +08:00
Valk Richard Li 1a233fbe15 update 2021-04-12 13:21:13 +08:00
Valk Richard Li c88620920b add stl & more efficient scope 2021-04-02 22:19:29 +08:00
Valk Richard Li 125fc8a9fe bug fixed & test file changes
compare operators now run more efficiently.
2021-03-31 20:59:13 +08:00
Valk Richard Li b06e1bb5dd add static symbol check & test file update 2021-03-30 15:55:38 +08:00
Valk Richard Li c7316e9780 change id name & add test file 2021-03-30 00:12:48 +08:00
Valk Richard Li be1bcdfe2c bug fixed 2021-03-28 17:39:24 +08:00
Valk Richard Li 144e6f45da gc changed to mark-sweep 2021-03-27 01:08:05 +08:00
Valk Richard Li f60f674845 delete op_entry 2021-03-04 15:53:34 +08:00
Valk Richard Li a421470715 change map to unordered_map 2021-03-01 15:54:58 +08:00
Valk Richard Li 9c9bb52818 codegen will not generate 'jmp' if 'if' and 'elsif' is the last condition 2021-02-18 11:45:47 +08:00
Valk Richard Li 02148f4766 bug fixed & more efficient function call
fixed a bug when different hash calling the same function,'me' will be set to the latest called hash's address.
changed the way of pushing the scope to the stack by copying a new scope from the function's scope address.
use map as the nasal_scop instead of list<map>,it'll be more efficient.
2021-02-17 19:31:44 +08:00
Valk Richard Li 767711c93a change identifier name to avoid misunderstanding 2021-02-15 15:29:55 +08:00
Valk Richard Li 80683c381f bug fixed 2021-02-13 23:57:53 +08:00
Valk Richard Li 3be50116fa update 2021-02-10 00:12:22 +08:00
Valk Richard Li bb746dfbfb update 2021-01-23 17:57:05 +08:00
Valk Richard Li 89540475cf update 2020-12-20 20:18:02 +08:00
Valk Richard Li e03da2f737 update 2020-12-20 13:39:24 +08:00
Valk Richard Li 4617eb8f17 update 2020-12-19 23:47:04 +08:00
Valk Richard Li fed1e20085 update 2020-12-19 21:02:02 +08:00
Valk Richard Li 9f30440286 preparation for v5.0 2020-12-19 01:26:15 +08:00
Valk Richard Li 99189d4f95 update 2020-12-17 22:32:28 +08:00
Valk Richard Li ae16f36baa update 2020-12-17 00:14:22 +08:00
Valk Richard Li 7c026b62b7 update 2020-12-15 13:00:24 +08:00
Valk Richard Li 9eb72f8754 update 2020-12-14 23:43:00 +08:00
Valk Richard Li 71f501a323 update 2020-12-12 01:58:40 +08:00
Valk Richard Li a5825e0e92 update 2020-12-11 13:46:56 +08:00
Valk Richard Li c9aa6cb6c4 update 2020-12-10 23:53:38 +08:00
Valk Richard Li 7f6a521ad7 bug fixed 2020-12-09 18:34:49 +08:00
Valk Richard Li 14852bfc2e update 2020-12-09 15:33:33 +08:00
Valk Richard Li 2bb0f0bf47 update 2020-12-04 00:00:29 +08:00
Valk Richard Li c5d700d0bc bug fixed 2020-12-01 20:43:56 +08:00
Valk Richard Li 33e544387e update 2020-12-01 19:35:32 +08:00
Valk Richard Li f336e5c3ae update 2020-11-30 23:54:32 +08:00
Valk Richard Li fce34c12b3 update 2020-11-29 00:54:54 +08:00
Valk Richard Li f811368491 update 2020-11-20 19:15:12 +08:00
Valk Richard Li d7f1de5d7f update 2020-11-15 23:24:37 +08:00
Valk Richard Li a0a22f701d update 2020-11-14 00:33:11 +08:00
Valk Richard Li 405172b317 update 2020-11-11 00:26:46 +08:00
Valk Richard Li 5c253bac88 print can show more details. 2020-11-10 22:30:54 +08:00
Valk Richard Li 155ce6fc0d update & bug fixed 2020-11-03 19:27:21 +08:00
Valk Richard Li 2923d24e6c update 2020-10-27 19:54:47 +08:00
Valk Richard Li b612f73ff7 update 2020-10-26 22:42:16 +08:00
Valk Richard Li e806b5f0a2 fixed bug of operator 'and' 2020-10-25 22:44:34 +08:00
Valk Richard Li e8341c7b06 change project structure
version 3.0
2020-10-23 14:53:04 +08:00