Commit Graph

280 Commits

Author SHA1 Message Date
Jose Narvaez 44a5809224 Fixed possible division by zero in 'codegen.c' reported by 'clang-analyzer' 2014-06-13 10:09:28 +01:00
Yukihiro "Matz" Matsumoto c2f6c33fef reserve a register for a block parameter in a for statement body; ref #2375 2014-06-10 13:15:19 +09:00
Yukihiro "Matz" Matsumoto 6c524af646 NODE_FOR does not introduce new local variables 2014-06-10 00:03:54 +09:00
Yukihiro "Matz" Matsumoto 4c69a9d09e codedump should display proper L(n) for OP_STRING op 2014-06-09 23:37:20 +09:00
Yukihiro "Matz" Matsumoto 41b46ca1ed register<nlocals may not have a local variable name (e.g. a block arg); fix #2258 2014-05-16 00:04:55 +09:00
Mitchell Blank Jr 493025c3af print_r() and print_lv() should only be compiled in for ENABLE_STDIO 2014-05-14 14:13:56 -07:00
Yukihiro "Matz" Matsumoto 2be348a0f1 mv opcode.h -> include/mruby/opcode.h and remove duplication from mruby-eval gem 2014-05-14 23:14:08 +09:00
Yukihiro "Matz" Matsumoto 9184d254e2 resize register number in LVAR section from 32bits to 16bits 2014-05-14 17:32:30 +09:00
Yukihiro "Matz" Matsumoto 10459a5eb2 Merge branch 'dump_lv' of https://github.com/take-cheeze/mruby into take-cheeze-dump_lv 2014-05-14 11:27:41 +09:00
take_cheeze f2450928b2 Remove unnecessary newline in OP_GETGLOBAL codedump. 2014-05-13 22:47:43 +09:00
take_cheeze 5073d14e28 Remove lv_len and use nlocals - 1 instead.
Check that `lv`'s length is always `nlocals - 1`.
2014-04-29 22:06:59 +09:00
take_cheeze 4c7f9897c2 Support local variables information dumping. 2014-04-29 20:47:50 +09:00
Yukihiro "Matz" Matsumoto 0bdc87d239 indent codedump when file/line info is not available; ref #2147 2014-04-29 19:08:47 +09:00
take_cheeze 46d8c08a14 Use int32_t as line variable type. 2014-04-28 22:17:40 +09:00
take_cheeze 197f3cb901 Print file name and line number in codedump if available. 2014-04-28 22:12:45 +09:00
Yukihiro "Matz" Matsumoto b1ec92f7cd fix OP_BLKPUSH dump format 2014-04-28 11:59:46 +09:00
Yukihiro "Matz" Matsumoto 2e59cd43de prevent printf warning 2014-04-28 08:30:57 +09:00
Yukihiro "Matz" Matsumoto b53e69f18d better codedump formatting 2014-04-28 08:02:47 +09:00
Yukihiro "Matz" Matsumoto 3244ddf0c3 presreve local variables names in irep->lv 2014-04-28 07:29:37 +09:00
cremno 91c22f32f4 rename mrb_str_buf_append to mrb_str_cat_str
The new name is better and less confusing, because:
  - `mrb_str_append` calls `mrb_str_to_str` and this function doesn't
  - `mrb_str_buf_append` _is_ `mrb_str_cat` for `mrb_value` strings
2014-04-27 22:33:22 +02:00
Yukihiro "Matz" Matsumoto bbc237044d NODE_SUPER should preserve stack region for block; ref #2136 2014-04-27 09:22:35 +09:00
Yukihiro "Matz" Matsumoto 26758d89bd NODE_DEF should preserve stack region for lambda; ref #2136 2014-04-27 09:05:23 +09:00
mirichi 71395aba52 area of implicit nil is not enough to nregs 2014-04-26 20:20:23 +09:00
Yukihiro "Matz" Matsumoto 5bf327497f bit more peephole optimization for NODE_LVAR 2014-04-26 17:19:52 +09:00
Yukihiro "Matz" Matsumoto 2202e412ea Merge branch 'master' of github.com:mruby/mruby 2014-04-26 01:53:15 +09:00
Yukihiro "Matz" Matsumoto 44ec41a772 should use plain int for index, since i may be printed using %d; close #2127 2014-04-26 01:52:30 +09:00
Yukihiro "Matz" Matsumoto c15da653b2 Merge pull request #2118 from ksss/range-bool
RRange excl flag use mrb_bool insteard of int
2014-04-26 01:30:04 +09:00
Yukihiro "Matz" Matsumoto 48f36d3f0e better integer size assertion suggested by usak 2014-04-25 04:33:08 +09:00
Yukihiro "Matz" Matsumoto 83c1399af0 eliminate plain int except for a few cases like arena_index 2014-04-25 04:01:57 +09:00
Yukihiro "Matz" Matsumoto 320f0711f0 remove -Wsign-compare warnings 2014-04-25 02:33:33 +09:00
ksss f1d85c2f97 mrb_range_new excl flag use mrb_bool insteard of int 2014-04-24 13:18:57 +00:00
take_cheeze c0eaaf3559 Move src/re.h to include/mruby/re.h . 2014-04-16 22:39:57 +09:00
Yukihiro "Matz" Matsumoto 19c3c957fc add assertion before casting 2014-04-03 20:23:39 +09:00
Yukihiro "Matz" Matsumoto 5be2bfb523 too much peephole optimization; close #1992 2014-04-03 10:14:38 +09:00
take_cheeze 2239350348 Add test for backquote.
* Implement code generation of NODE_DXSTR.
* Fix NOVAL NODE_XSTR.
2014-03-28 13:02:52 +09:00
Yukihiro "Matz" Matsumoto 2c44f96e78 reduce hash creation by using update method 2014-03-21 09:31:44 +09:00
Yukihiro "Matz" Matsumoto 45b0e1f788 should be able to create hash with 127+ entries; close #1894 2014-03-21 09:18:10 +09:00
Yukihiro "Matz" Matsumoto 3e24e06b29 add a space after C reserved words 2014-03-18 23:57:29 +09:00
Yukihiro "Matz" Matsumoto c476c1b528 symbol length type to be mrb_int 2014-03-15 15:43:40 +09:00
Yukihiro "Matz" Matsumoto 2bd099c842 remove new_label(s) where label position can be obtained from genop() 2014-03-14 03:11:11 +09:00
Yukihiro "Matz" Matsumoto 91f2d47d34 too much optimization 2014-03-13 23:44:10 +09:00
Yukihiro "Matz" Matsumoto 8cc487c465 peephole optimization for OP_JMP{IF,NOT} 2014-03-13 19:54:50 +09:00
Masaki Muranaka 40f57f7b42 Use mrb_str_new_cstr() instead of mrb_str_new() with strlen(). 2014-03-09 16:45:29 +09:00
cremno bfc522bcd5 use mrb_str_cat_lit for literals 2014-03-08 18:38:31 +01:00
Masaki Muranaka 270d25bf2d Make type casts safer. 2014-03-08 15:53:59 +09:00
cubicdaiya 016d3b9394 fix off-by-one error in attrsym
The allocation size for null-terminated character is lacking.
In actual, it is no problem in most case
because codegen_palloc allocates more a memory size than required size.
2014-03-05 11:20:39 +09:00
Yukihiro "Matz" Matsumoto 9a92b40aaf rescue clause should understand splats; close #1786 2014-03-03 13:25:13 +09:00
take_cheeze 78915f9601 support c++ exception 2014-03-01 20:05:29 +09:00
cubicdaiya 67de10bfcb use C style comments instead of C++ style comments
According to CONTRIBUTING.md,

Don't use C++ style comments

 /* This is the prefered comment style */

Use C++ style comments only for temporary comment e.g. commenting out some code lines.
2014-03-01 03:31:45 +09:00
Yukihiro "Matz" Matsumoto 19a08b8455 Merge pull request #1674 from cremno/mrb_bool-FALSE-TRUE
use mrb_bool, FALSE and TRUE more
2014-02-09 18:35:20 +09:00