Commit Graph

82 Commits

Author SHA1 Message Date
ValKmjolnir a51b7fe11a optimize codes 2022-01-16 22:48:00 +08:00
ValKmjolnir ac80216ea8 update README.md 2021-12-23 21:46:53 +08:00
ValKmjolnir 1ae354c0cf lexer,parser,import,codegen use the same error module. 2021-12-23 21:15:50 +08:00
ValKmjolnir bde94f8ec6 update error info (except parser)
prepare for nasal_err module
2021-12-23 14:09:54 +08:00
ValKmjolnir 82181b7af4 add debugger framework
with function:backtrace,run,help,show global/local/upvalue,exit
2021-12-20 21:33:22 +08:00
ValKmjolnir 083293e3db little update 2021-12-16 23:53:13 +08:00
ValKmjolnir cabce9370a delete ret stack/ add math.lg
now return address is stored on value stack
2021-12-02 22:23:22 +08:00
ValKmjolnir 7169f25774 delete op_cntpop & counter stack
now the iterator will be type vm_cnt and be stored on value stack.
2021-11-25 18:13:31 +08:00
ValKmjolnir 56c9cb60ab fixed bug of in_foreach and in_forindex 2021-11-22 14:24:28 +08:00
ValKmjolnir e1d5ab2da5 add unix.isdir and unix.isfile 2021-11-15 22:47:52 +08:00
ValKmjolnir b67cd85cb4 2 bugs fixed:
empty string will be true in conditional expressions,but now it is false(and string that is not empty and is not numerable will be true)

foreach(var i;func(){return []}()); will cause sigsegv because codegen generates error op_pop and op_cntpop,now the counter in_foreach and in_forindex change after generating
foreach/forindex expression before block generation.
2021-11-14 23:05:34 +08:00
ValKmjolnir bc9039dd37 change code structure 2021-11-02 22:44:42 +08:00
ValKmjolnir b131a3ea9e add io lib & bug fixed 2021-10-27 23:05:25 +08:00
ValKmjolnir 101714986d optimize nasal_ast and fix bug in opr_slc2 2021-10-20 20:54:23 +08:00
ValKmjolnir a7b1851967 optimize code structure 2021-10-16 21:08:57 +08:00
ValKmjolnir 645a652830 change function name and cli format 2021-10-14 23:22:28 +08:00
ValKmjolnir 414c9c7487 change output format of information of bytecodes 2021-10-13 22:59:15 +08:00
ValKmjolnir 3ab5f00097 optimize source code 2021-10-12 18:26:10 +08:00
ValKmjolnir b77d9a48fb fully functional closure & add benchmark 2021-10-10 14:29:23 +08:00
ValKmjolnir b4f55f0d01 prepare for version 8.0 2021-10-08 15:32:18 +08:00
Li Haokun 52fbd729cc bad access bug fixed 2021-09-13 19:55:03 +08:00
Li Haokun 5ed1b63143 update 2021-09-10 19:13:42 +08:00
Li Haokun 1982ab6b8e security holes fixed 2021-08-19 17:54:36 +08:00
Li Haokun e9bd033883 update 2021-08-09 19:13:39 +08:00
ValKmjolnir 143a59c735 update 2021-08-09 01:02:27 +08:00
Li Haokun b069f3875e update 2021-08-05 19:02:41 +08:00
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 26bbdcf463 bug fixed & raw string print 2021-07-21 00:20:25 +08:00
Li Haokun d9d7a1edfc add trace back info 2021-07-16 17:18:13 +08:00
ValKmjolnir 5de65e584d prepare for debugger 2021-07-16 02:17:53 +08:00
ValKmjolnir e974468881 add const compare instructions 2021-07-03 15:22:23 +08:00
ValKmjolnir 81131520d7 add instruction & changes in codegen
add some instructions that execute const values.
the first symbol called in assignment will use op_load instead of op_meq,op_pop to assign.
2021-06-29 17:18:05 +08:00
ValKmjolnir 855e0e441f avoid unnecessary deep copy by using rvalue ref
and test file update.
bug fixed in test/lexer.nas
2021-06-24 22:10:08 +08:00
ValKmjolnir f0565c7de6 change mcall to call->mcall&allow differen lvalue in assignment 2021-06-21 16:46:47 +08:00
Valk Richard Li 40a1189b18 nothing changed 2021-06-20 01:27:01 +08:00
Valk Richard Li b9aa7f5db2 add statistical information 2021-06-19 00:32:10 +08:00
Valk Richard Li 05fcacde37 bug fixed & delete operand vapp 2021-06-15 00:49:32 +08:00
Valk Richard Li 411c2e5c4c add tips 2021-06-13 01:01: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 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 a499c75932 bug fixed
add operand op_offset to make sure arguments are loaded at correct places,before this commit,arguments are not loaded from a correct offset,which will cause SIGSEGV when calling a function that has complex closure
2021-05-17 21:15:57 +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 2405bada81 change scope from unordered_map to vector 2021-04-19 19:12:41 +08:00
Valk Richard Li d51465cc82 change function of vapp & README update 2021-04-03 23:47:14 +08:00
Valk Richard Li 1f6e1a647e add stl & more efficient scope 2021-04-02 22:19:29 +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 a990fb606a gc changed to mark-sweep 2021-03-27 01:08:05 +08:00
Valk Richard Li ca27c5545a add constant table in vm 2021-03-08 19:45:33 +08:00