Commit Graph

58 Commits

Author SHA1 Message Date
Li Haokun a6fe835ed4 variables can be used before definition
change program to command line
change trace back info
change print function of nasal_vec and nasal_hash
2021-08-03 18:55:11 +08:00
ValKmjolnir d7ba29e02c delete slice_stack 2021-07-07 14:46:46 +08:00
ValKmjolnir e974468881 add const compare instructions 2021-07-03 15:22:23 +08:00
ValKmjolnir ee9afe1cf1 change instruction dispatch to computed-goto
bug fixed
prepare for version 7.0
2021-06-26 14:53:10 +08:00
ValKmjolnir a734b99beb performance optimization of vm/lex/parse/test 2021-06-24 00:26:26 +08:00
Valk Richard Li 0f298244a2 update 2021-06-21 01:02:09 +08:00
Valk Richard Li 05fcacde37 bug fixed & delete operand vapp 2021-06-15 00:49:32 +08:00
Valk Richard Li 166fe32839 front end optimization&stack overflow prompt
change parameter type to avoid unnecessary copies of string.
change stack depth from 65536<<4 to 16+(65536<<2).
now you could know stack overflow when it happens
2021-06-07 23:53:43 +08:00
Valk Richard Li a0ff523229 more efficient str2num 2021-06-05 20:42:58 +08:00
Valk Richard Li a3d629a08e 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 b2e85de7a7 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 20cfbfecd9 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 6651fccbe8 parser reports syntax error accurately
still need improvement
2021-05-04 01:13:53 +08:00
Valk Richard Li 2405bada81 change scope from unordered_map to vector 2021-04-19 19:12:41 +08:00
Valk Richard Li 3c89942654 update 2021-04-12 13:21:13 +08:00
Valk Richard Li 1f6e1a647e add stl & more efficient scope 2021-04-02 22:19:29 +08:00
Valk Richard Li e10517b741 bug fixed & test file changes
compare operators now run more efficiently.
2021-03-31 20:59:13 +08:00
Valk Richard Li 7f191f353e add static symbol check & test file update 2021-03-30 15:55:38 +08:00
Valk Richard Li 4202c2081e change id name & add test file 2021-03-30 00:12:48 +08:00
Valk Richard Li 6473b527a1 bug fixed 2021-03-28 17:39:24 +08:00
Valk Richard Li a990fb606a gc changed to mark-sweep 2021-03-27 01:08:05 +08:00
Valk Richard Li 6187ca1d8e delete op_entry 2021-03-04 15:53:34 +08:00
Valk Richard Li f3370ef0f7 change map to unordered_map 2021-03-01 15:54:58 +08:00
Valk Richard Li 6cb0e19ba3 codegen will not generate 'jmp' if 'if' and 'elsif' is the last condition 2021-02-18 11:45:47 +08:00
Valk Richard Li 1d02f7021d 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 e1beb1efe3 change identifier name to avoid misunderstanding 2021-02-15 15:29:55 +08:00
Valk Richard Li afef865f69 bug fixed 2021-02-13 23:57:53 +08:00
Valk Richard Li ee5f9519fe update 2021-02-10 00:12:22 +08:00
Valk Richard Li dfb537bbdc update 2021-01-23 17:57:05 +08:00
Valk Richard Li 324a423751 update 2020-12-20 20:18:02 +08:00
Valk Richard Li 0e0db782f3 update 2020-12-20 13:39:24 +08:00
Valk Richard Li cfc9a97144 update 2020-12-19 23:47:04 +08:00
Valk Richard Li 1c875cd855 update 2020-12-19 21:02:02 +08:00
Valk Richard Li dff899061a preparation for v5.0 2020-12-19 01:26:15 +08:00
Valk Richard Li a913b63f30 update 2020-12-17 22:32:28 +08:00
Valk Richard Li c59fedc3ce update 2020-12-17 00:14:22 +08:00
Valk Richard Li a086af4c33 update 2020-12-15 13:00:24 +08:00
Valk Richard Li c95185e62b update 2020-12-14 23:43:00 +08:00
Valk Richard Li 0fec1e462e update 2020-12-12 01:58:40 +08:00
Valk Richard Li b081a2be1d update 2020-12-11 13:46:56 +08:00
Valk Richard Li 44c98c6c50 update 2020-12-10 23:53:38 +08:00
Valk Richard Li b4527926fe bug fixed 2020-12-09 18:34:49 +08:00
Valk Richard Li 4419508a67 update 2020-12-09 15:33:33 +08:00
Valk Richard Li a943c6e9f9 update 2020-12-04 00:00:29 +08:00
Valk Richard Li 2dfbb88738 bug fixed 2020-12-01 20:43:56 +08:00
Valk Richard Li 3e884bb20a update 2020-12-01 19:35:32 +08:00
Valk Richard Li 6d9141ff2d update 2020-11-30 23:54:32 +08:00
Valk Richard Li 6b94345a4d update 2020-11-29 00:54:54 +08:00
Valk Richard Li 931e6bae0b update 2020-11-20 19:15:12 +08:00
Valk Richard Li ccb2c3abb8 update 2020-11-15 23:24:37 +08:00