Yukihiro "Matz" Matsumoto
cec53ff77e
Array#first to treat 1 argument case specially to improve performance.
2017-08-26 02:03:21 +09:00
Yukihiro "Matz" Matsumoto
1b545a6b63
Check for ability to skip optional argument parsing.
2017-08-26 02:03:21 +09:00
Yukihiro "Matz" Matsumoto
60104ce41d
Silence compiler warning regarding float condition; fix #3790
2017-08-26 02:02:45 +09:00
Yukihiro "Matz" Matsumoto
43ec918be1
Remove unused mrb_obj_iv_ifnone() from API.
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
0e10a23d7a
Add checks if iv_tbl is NULL.
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
0c52112dd4
Keep Range class in mrb_state structure for performance.
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
04dbbff3c1
Use khash for instance variables tables instead of segment list.
...
For performance reason. Segmented list consumes slightly less memory
but takes a lot of time especially when there are many slots in the
segment lists (e.g. class constants).
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
f2cc1239a5
Turn on method cache for Travis CI.
2017-08-26 02:01:50 +09:00
Yukihiro "Matz" Matsumoto
f7f1aca8b5
Merge pull request #3792 from dabroz/fix-test-int16
...
Fix string test with 16-bit integers
2017-08-26 02:00:30 +09:00
Yukihiro "Matz" Matsumoto
5f2c7e47bb
Merge pull request #3791 from dabroz/fix-msvc-warning
...
Fix MSVC warnings in fmt_fp.c
2017-08-26 01:54:59 +09:00
Tomasz Dąbrowski
17c249780f
fix String#% %d test with MRB_INT16 set
2017-08-25 14:36:05 +02:00
Tomasz Dąbrowski
5d9b84ef40
fix fmt_fp.c(329) : warning C4244: 'return' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:18:31 +02:00
Tomasz Dąbrowski
78b13b3955
fix fmt_fp.c(251) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data
2017-08-25 14:18:05 +02:00
Tomasz Dąbrowski
ef6a762d41
fix fmt_fp.c(224) : warning C4244: '=' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:14:17 +02:00
Tomasz Dąbrowski
bac37a9f1a
fix fmt_fp.c(220) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data
2017-08-25 14:13:06 +02:00
Tomasz Dąbrowski
b2a16d6bf7
fix fmt_fp.c(206) : warning C4244: 'initializing' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:12:08 +02:00
Tomasz Dąbrowski
c8341dbf7c
fix fmt_fp.c(178) : warning C4244: 'return' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:10:43 +02:00
Tomasz Dąbrowski
5d099e40e6
fix fmt_fp.c(123) : warning C4244: 'return' : conversion from 'ptrdiff_t' to 'int', possible loss of data
2017-08-25 14:10:24 +02:00
Yukihiro "Matz" Matsumoto
63f10a1ee5
Merge pull request #3788 from christopheraue/fix_codegen_op_send_nregs
...
Fixed register windows of OP_SENDs generated during codegen
2017-08-24 14:38:03 +09:00
Christopher Aue
3366894a40
Fixed register windows of OP_SENDs generated by NODE_{DREGX,REGX}; ref #3783
2017-08-23 18:16:05 +02:00
Christopher Aue
499498a6a7
Tested register windows of OP_SENDs generated by NODE_{DXSTR,XSTR}; ref #3783
2017-08-23 18:15:54 +02:00
Christopher Aue
84d8ecc1d7
Fixed register windows of OP_SENDs generated by NODE_OP_ASGN; ref #3783
2017-08-23 18:15:44 +02:00
Christopher Aue
4aca9ef98e
Refactored code around generation of OP_SEND in NODE_OP_ASGN
2017-08-23 18:15:38 +02:00
Christopher Aue
1221f7676e
Fixed register windows of OP_SENDs generated by NODE_{FOR,SYMBOLS}; ref #3783
2017-08-23 18:15:27 +02:00
Christopher Aue
c040c8d92b
Tested register windows of OP_SENDs generated by NODE_{RESCUE,HASH,ALIAS}; ref #3783
2017-08-23 18:15:08 +02:00
Christopher Aue
c6596cf26a
Fixed register windows of OP_SENDs generated by NODE_{SCALL,CASE,YIELD,UNDEF}; ref #3783
2017-08-23 18:12:35 +02:00
Christopher Aue
64e5208404
Asserted bidx < ci->nregs for OP_SEND and OP_SUPER
2017-08-23 15:18:06 +02:00
Yukihiro "Matz" Matsumoto
4c9a604877
Added method cache.
...
To enable method cache, define `MRB_METHOD_CACHE` or
`MRB_METHOD_CACHE_SIZE`. The cache size must be power of 2.
The default cache size is 128.
The measurement:
I measured simple benchmarks found in benchmark/ directory. With
method cache enabled, we gained 6-8% performance improvement, with
97-99% cache hit rate.
2017-08-22 22:17:01 +09:00
Yukihiro "Matz" Matsumoto
a65f4dbb32
Remove possible path that leaves a local variable uninitialized.
2017-08-22 15:50:08 +09:00
Yukihiro "Matz" Matsumoto
db437b04a4
mrb_obj_respond_to to use mrb_method_search_vm.
2017-08-22 14:23:46 +09:00
Yukihiro "Matz" Matsumoto
0d865a77d5
c (mrbc_context) may be NULL; fix #3787
2017-08-22 09:47:10 +09:00
Yukihiro "Matz" Matsumoto
ab3b6dbd2a
strlen returns size_t; need to cast before assigning to int.
2017-08-22 08:14:09 +09:00
Yukihiro "Matz" Matsumoto
3f90af6b42
(Try to) fix mixture of int and size_t in UTF-8 conversion.
...
This only effects VC.
2017-08-22 07:35:51 +09:00
Yukihiro "Matz" Matsumoto
a7d611fb23
Reduce signed/unsigned warnings in dump.c
2017-08-19 21:50:36 +09:00
Yukihiro "Matz" Matsumoto
5d0fc7e57a
Reduce signed/unsigned warnings in fmt_fp.c
2017-08-19 17:09:30 +09:00
Yukihiro "Matz" Matsumoto
8cea1f8907
Use ptrdiff_t instead of int.
2017-08-19 15:51:08 +09:00
Yukihiro "Matz" Matsumoto
a117ec771b
Remove mixed signed/unsigned comparison in debug.c.
2017-08-19 14:42:30 +09:00
Yukihiro "Matz" Matsumoto
834523945e
Replace stack pop() by push_n(2); pop_n(3); fix #3783
...
To calculate correct register windows size. The fix was suggested
by Christopher Aue.
2017-08-19 11:56:04 +09:00
Yukihiro "Matz" Matsumoto
db098d3e0e
Type check before traversing irep->outer; fix #3782
2017-08-19 11:39:42 +09:00
Yukihiro "Matz" Matsumoto
2294ebdd44
Call mrb_full_gc before gc_each_objects; ref #3782
...
Otherwise dead object may be seen from `#each_object`.
2017-08-19 11:38:11 +09:00
Yukihiro "Matz" Matsumoto
9146d5c34f
Zero width unshift should not touch memory; ref #3780
2017-08-19 11:11:26 +09:00
Yukihiro "Matz" Matsumoto
8b3298b2d6
Unshift pointer move size was wrong (not len but alen); fix #3780
2017-08-19 11:08:46 +09:00
Yukihiro "Matz" Matsumoto
29ad0a7964
capacify' for mrb_str_new_capa should not be 0`.
2017-08-18 23:42:34 +09:00
Yukihiro "Matz" Matsumoto
a8bd06904d
mrb_str_cat: capa should not be zero to avoid infinite loops.
2017-08-18 23:42:34 +09:00
Yukihiro "Matz" Matsumoto
a06adb176f
mrb_str_cat: capa should be bigger than total.
2017-08-18 23:42:33 +09:00
Yukihiro "Matz" Matsumoto
8b5be554c7
ARY_CAPA handles capacity for embedded arrays by itself.
2017-08-18 23:42:33 +09:00
Yukihiro "Matz" Matsumoto
8fbc4bef55
Reduce signed/unsigned comparison warnings; ref #3785
2017-08-18 22:54:59 +09:00
Yukihiro "Matz" Matsumoto
f1767fd079
Separate mrb_str_buf_new and mrb_str_new_capa.
...
`mrb_str_buf_new` is an old function that ensures capacity size of
`MRB_STR_BUF_MIN_SIZE` minimum. Usually one need to use
`mrb_str_new_capa` instead.
2017-08-18 22:17:48 +09:00
Yukihiro "Matz" Matsumoto
722d123b87
Remove code duplication in mrb_str_concat.
2017-08-18 22:17:48 +09:00
Yukihiro "Matz" Matsumoto
198c898817
Rename mrb_str_concat2 to mrb_str_concat_m.
...
According to the naming convention a function that implements
a method should be suffixed by `_m`.
2017-08-18 22:17:47 +09:00