Commit Graph

8447 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 8a5d783f2e Call initialize only when it's not empty. 2017-09-04 06:49:05 +09:00
Yukihiro "Matz" Matsumoto 5d7e4957e0 Merge pull request #3806 from flaviommedeiros/master
Trying to make the code more readable
2017-09-03 07:51:12 +09:00
Yukihiro "Matz" Matsumoto da97715e11 Merge pull request #3805 from fl0l0u/patch-1
Update print.c
2017-09-03 07:48:33 +09:00
fl0l0u e03042ec19 Update print.c
Strings not containing a newline are not printed synchronously
ex. bin/mruby -e '["a", "b", "c", "\n", "d", "e", "f", "\n"].each {|e| print e ; usleep 200000}'
2017-09-02 18:26:50 +02:00
Flavio Medeiros 9f677b72db Trying to make the source code more understandable by removing mixing of ternary if statements with attributions. 2017-09-02 13:25:09 -03:00
Yukihiro "Matz" Matsumoto 476af3c647 Merge pull request #3802 from christopheraue/proc_break_tests
Tested local jump errors caused by break in a proc
2017-09-02 22:19:15 +09:00
Yukihiro "Matz" Matsumoto ab99e2c293 Avoid copying over initialized procs using initialize_copy; fix #3803
It may be better to raise exceptions, but CRuby doesn't.
2017-09-01 06:51:59 +09:00
Yukihiro "Matz" Matsumoto 57610091ce Update method cache clearing. 2017-09-01 06:51:59 +09:00
Yukihiro "Matz" Matsumoto f0f4a1088a Make the default integer size to be MRB_INT64 on 64bit systems; close #3800
Unless `MRB_NAN_BOXING` is specified.
2017-09-01 06:51:59 +09:00
Christopher Aue 35deaae776 Tested LocalJumpErrors caused by break in a proc 2017-08-30 12:25:55 +02:00
Yukihiro "Matz" Matsumoto 71357ff1d8 Merge pull request #3801 from christopheraue/assert_raise_refactoring
Allowed to pass multiple exceptions to assert_raise
2017-08-30 18:56:59 +09:00
Christopher Aue bf32265743 Allowed to pass multiple exceptions to assert_raise 2017-08-30 11:03:51 +02:00
Yukihiro "Matz" Matsumoto fe3227cd5c Set the ORPHAN flag in Proc.new; fix #3798 2017-08-30 16:51:40 +09:00
Yukihiro "Matz" Matsumoto 483a038d39 Fixed a critical typo; ref #3798 2017-08-30 16:51:17 +09:00
Yukihiro "Matz" Matsumoto 2c85213298 Need to mark mrb->range_class; fix #3797 2017-08-30 16:12:12 +09:00
Yukihiro "Matz" Matsumoto 79b4f61b02 Merge pull request #3799 from christopheraue/assert_raise_refactoring
Refactored #assert_raise and #assert_nothing_raised
2017-08-30 14:47:12 +09:00
Christopher Aue 4b0b8f7e1a Refactored #assert_raise and #assert_nothing_raised 2017-08-29 23:25:53 +02:00
Yukihiro "Matz" Matsumoto 8976f47e0a Need to update ci after callinfo stack reallocation; fix #3796 2017-08-29 11:06:34 +09:00
Yukihiro "Matz" Matsumoto c082249838 Exclude the top-level closure from each_object; fix #3793 2017-08-29 09:29:14 +09:00
Yukihiro "Matz" Matsumoto 786cbf06c3 Revert "Clear irep->outer when no Proc reference the irep; fix #3793"
This reverts commit 15d48efa4b.
2017-08-29 09:27:45 +09:00
Yukihiro "Matz" Matsumoto 1260d3b68a Add `__ENCODING__' support.
`__ENCODING__' returns the current encoding name (string), unlike
CRuby that returns the encoding object.
2017-08-28 22:42:06 +09:00
Yukihiro "Matz" Matsumoto f1fa5bf1c6 Remove integer type mismatch warnings from parse.y. 2017-08-28 22:31:02 +09:00
Yukihiro "Matz" Matsumoto 15d48efa4b Clear irep->outer when no Proc reference the irep; fix #3793 2017-08-28 10:06:04 +09:00
Yukihiro "Matz" Matsumoto fd927d786e Merge pull request #3795 from christopheraue/array_refactoring
Array refactorings and speed improvements
2017-08-27 08:56:41 +09:00
Christopher Aue c956e17c02 Replaced Array#each with while loop for performance reasons
Example benchmark:
$ time build/bench/bin/mruby -e "Array.new(2_000_000){ |i| i }.index{ |i| i == 1_999_999 }"

Before:
real    0m0.934s
user    0m0.922s
sys     0m0.003s

After:
real    0m0.590s
user    0m0.583s
sys     0m0.007s
2017-08-26 15:57:25 +02:00
Christopher Aue 6c9013e22b Removed unneeded block check in Array#uniq 2017-08-26 15:57:25 +02:00
Christopher Aue f3fb43c729 Reimplemented Array#flatten with #flatten! 2017-08-26 15:57:25 +02:00
Yukihiro "Matz" Matsumoto ccd555421a Merge pull request #3794 from dabroz/fix-flt-epsilon
Fix building with MRB_USE_FLOAT=1
2017-08-26 22:29:00 +09:00
Tomasz Dąbrowski 01b9b71902 fix mrbgems/mruby-range-ext/src/range.c:142:71: error: use of undeclared identifier 'FLT_EPSILON' 2017-08-26 12:11:57 +02:00
Yukihiro "Matz" Matsumoto 85a400e43d Reimplement Array#shift to be faster. 2017-08-26 02:03:21 +09:00
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