Commit Graph

6437 Commits

Author SHA1 Message Date
furunkel ed03b17bb4 Remove benchmarks not in mruby 2015-04-24 22:10:11 +02:00
furunkel 6110b385a7 Output PNG instead of PDF 2015-04-24 21:58:27 +02:00
furunkel 105f1f38a9 Add some of MRI's benchmarks 2015-04-24 19:34:39 +02:00
furunkel 00518e0a4b Use separate build config directory for benchmark files 2015-04-24 16:24:31 +02:00
furunkel bb1951a8b6 Include name of current build config in data directory name 2015-04-24 14:54:35 +02:00
furunkel 01ee28d89d Rename 2015-04-24 14:22:43 +02:00
furunkel 8f5ec1a60f Let all benchmarks start with bm_ 2015-04-24 14:19:51 +02:00
furunkel 465d7a23c8 Add build files for benchmarkings; add mandelbrot benchmark 2015-04-24 13:40:54 +02:00
furunkel 96d66f6d24 Don't echo to stdout 2015-04-23 22:34:22 +02:00
furunkel a96b871c46 Add task for running and plotting benchmarks 2015-04-23 22:27:19 +02:00
Yukihiro "Matz" Matsumoto 6246483f12 Merge pull request #2766 from furunkel/builtin_overflow
Use builtins for overflow math if possible
2015-04-19 08:22:48 +09:00
Yukihiro "Matz" Matsumoto 0f31f16015 Merge pull request #2768 from kou/suppress-write-strings-warnings
Suppress warnings generated by -Wwrite-strings
2015-04-19 08:21:51 +09:00
Kouhei Sutou 09419874c8 Suppress warnings generated by -Wwrite-strings
Here are suppressed warnings:

    src/fmt_fp.c: In function 'fmt_fp':
    src/fmt_fp.c:124:16: warning: initialization discards 'const' qualifier from pointer target type
         char *ss = (t&32)?"inf":"INF";
                    ^
    src/fmt_fp.c:125:17: warning: assignment discards 'const' qualifier from pointer target type
         if (y!=y) ss=(t&32)?"nan":"NAN";
                     ^
    mrbgems/mruby-string-ext/src/string.c: In function 'mrb_str_succ_bang':
    mrbgems/mruby-string-ext/src/string.c:302:27: warning: assignment discards 'const' qualifier from pointer target type
           if (e == b) prepend = "1";
                               ^
    mrbgems/mruby-string-ext/src/string.c:305:27: warning: assignment discards 'const' qualifier from pointer target type
           if (e == b) prepend = "a";
                               ^
    mrbgems/mruby-string-ext/src/string.c:308:27: warning: assignment discards 'const' qualifier from pointer target type
           if (e == b) prepend = "A";
                               ^
    mrbgems/mruby-bin-mruby/tools/mruby/mruby.c: In function 'main':
    mrbgems/mruby-bin-mruby/tools/mruby/mruby.c:213:13: warning: assignment discards 'const' qualifier from pointer target type
         cmdline = args.cmdline ? args.cmdline : "-";
                 ^
    mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c: In function 'print_breakpoint':
    mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:159:3: warning: initialization discards 'const' qualifier from pointer target type
       char* enable_letter[] = {BREAK_INFO_MSG_DISABLE, BREAK_INFO_MSG_ENABLE};
       ^
    mrbgems/mruby-bin-debugger/tools/mrdb/cmdbreak.c:159:3: warning: initialization discards 'const' qualifier from pointer target type
2015-04-18 21:43:58 +09:00
Kouhei Sutou 058dc7bd41 Enable -Wwrite-strings by default for GCC 2015-04-18 21:43:40 +09:00
furunkel 08c877699a Use builtins for overflow math if possible 2015-04-17 17:37:09 +02:00
Yukihiro "Matz" Matsumoto e79afd4c74 Merge pull request #2765 from miura1729/original2
Fix to avoid warning
2015-04-17 23:49:31 +09:00
Miura Hideki eb3af3752f Fix to avoid warning 2015-04-17 20:04:07 +09:00
Yukihiro "Matz" Matsumoto ee59f8b8b2 Merge pull request #2762 from miura1729/original
Add test of negative arguments for Integer#%
2015-04-17 17:49:29 +09:00
Miura Hideki a21d3f627e Add test of negative arguments for Integer#% 2015-04-17 17:26:12 +09:00
Yukihiro "Matz" Matsumoto fa824e324b Merge pull request #2755 from Yuuhei-Okazaki/fix_maxbreakpoint_reference
fix maximum value of the index when access breakpoints.
2015-04-03 08:31:37 +09:00
Yukihiro "Matz" Matsumoto d77249f006 Merge pull request #2754 from cremno/remove-unnecessary-inttypes.h-inclusion
remove unnecessary <inttypes.h> inclusion
2015-04-03 08:30:44 +09:00
Yukihiro "Matz" Matsumoto cb3e1433a4 Merge pull request #2753 from cremno/vs2015-has-inline-kw
MSVC 2015 implements inline keyword
2015-04-02 23:07:31 +09:00
Yuhei Okazaki 06435f5bc7 fix maximum value of the index when access breakpoints. 2015-03-31 10:52:10 +09:00
cremno 18fdf7e03f remove unnecessary <inttypes.h> inclusion
The format specifier macros were needed to portably print a mrb_int,
because mrb_raisef() originally called vsnprintf(). It doesn't anymore
since 18b2683b97 and the mrb_int format
specifier macros are already gone.
2015-03-30 21:01:16 +02:00
cremno 6424569a63 MSVC 2015 implements inline keyword
Apparently the C compiler of Visual Studio 2015 CTP6 finally implements
inline as inline and not only as _inline and __inline.
2015-03-30 20:13:23 +02:00
Yukihiro "Matz" Matsumoto 0573306f51 Merge pull request #2750 from cremno/call-c11-timespec_get
mruby-time: call ISO C11's timespec_get() if available
2015-03-23 14:11:19 +09:00
Yukihiro "Matz" Matsumoto 2249afce25 Merge pull request #2751 from cremno/refactor-write_pool_block
refactor write_pool_block()
2015-03-23 14:10:11 +09:00
cremno 7985f75dfa refactor write_pool_block()
No need to write the same assertion in each case (except the default
one). Instead we can assert after the switch statement.
2015-03-22 23:10:38 +01:00
cremno c47cc0c3bb call C11's timespec_get()
gettimeofday() is an obsolescent POSIX function which may be removed in
a future version. POSIX recommends using clock_gettime() (also POSIX)
instead, but it isn't available on OS X or Windows (at least with MSVC
and older MinGW versions).

Whereas timespec_get() is part of ISO C11 and mruby uses some small
other C11 features too. It isn't universally available yet either, but
it might be in the future. And Visual C++ 2015 implements it! Since
mruby strives for ISO C and not POSIX compatibility, I think it's a
reasonable choice.

TIME_UTC is used instead of __STDC_VERSION__, because if TIME_UTC is
defined, then most likely timespec_get() is too. This isn't true in case
of  __STDC_VERSION__ (see MSVC).
2015-03-22 22:52:12 +01:00
Yukihiro "Matz" Matsumoto 17b7745593 Merge branch 'master' of github.com:mruby/mruby 2015-03-21 11:20:52 +09:00
Yukihiro "Matz" Matsumoto 4cf9b2fd1c execute ensure clause only when skipping call frame; fix #2726 2015-03-21 11:20:44 +09:00
Yukihiro "Matz" Matsumoto dc757f70fd Merge pull request #2747 from jbreeden/vcpp_exceptions
Fix exceptions for visualcpp
2015-03-20 00:28:46 +09:00
Jared Breeden f6f70c86db Fix exceptions for visualcpp 2015-03-18 20:14:54 -04:00
Yukihiro "Matz" Matsumoto 0e218f5356 Merge pull request #2746 from tarosay/tarosa
I modified the undefined frexpl in cygwin of make
2015-03-16 19:34:29 +09:00
Tarosa 52f35b83e2 I have added the #ifdef __CYGWIN32__ to modify the fmt_fp.c 2015-03-16 19:22:47 +09:00
Tarosa f6dc516319 I modified the undefined frexpl in cygwin of make 2015-03-16 18:34:08 +09:00
Yukihiro "Matz" Matsumoto f32393a820 Merge pull request #2740 from govm/stack_extend-in-mrb_f_send
Fix #2739 stack_extend in mrb_f_send
2015-03-06 00:22:58 +09:00
Go Saito 16b5986d14 stack_extend in mrb_f_send
mrb_f_send needs stack_extend like OP_SEND

Signed-off-by: Go Saito <gos@iij.ad.jp>
2015-03-05 17:41:34 +09:00
Yukihiro "Matz" Matsumoto 7d67c573d7 Merge pull request #2738 from kou/use-ptrdiff-t
Use ptrdiff_t to suppress signedness warning
2015-02-28 20:43:18 +09:00
Kouhei Sutou 42359d6241 Use ptrdiff_t to suppress signedness warning
3df3216179 says so but there is no warning
with GCC 4.9 on my Debian GNU/Linux environment.
2015-02-28 15:30:18 +09:00
Yukihiro "Matz" Matsumoto 414678d61a Merge pull request #2736 from cremno/delete-prototypes-of-undefined-functions
delete prototypes of undefined functions
2015-02-27 17:15:59 +09:00
Yukihiro "Matz" Matsumoto 3cba701672 fix MSVC initialization issue by a patch from @dyama; close #2734 2015-02-27 17:14:32 +09:00
Yukihiro "Matz" Matsumoto 3df3216179 change size_t to ptrdiff_t to silence signedness warnings; #2732 2015-02-27 17:14:03 +09:00
cremno 893f937922 delete prototypes of undefined functions 2015-02-26 09:56:03 +01:00
Yukihiro "Matz" Matsumoto a1d4992187 Merge pull request #2732 from kou/fix-a-crash-bug-on-raise-after-realloc
Fix a crash bug on raising after realloc
2015-02-26 14:40:02 +09:00
Kouhei Sutou 3fefe52ffb Fix a crash bug on raising after realloc
The following program reproduces this problem:

    #include <mruby.h>

    static mrb_value
    recursive(mrb_state *mrb, mrb_value self)
    {
      mrb_int n;

      mrb_get_args(mrb, "i", &n);

      if (n == 0) {
        mrb_raise(mrb, E_RUNTIME_ERROR, "XXX");
      } else {
        mrb_funcall(mrb, self, "recursive", 1, mrb_fixnum_value(n - 1));
      }

      return self;
    }

    int
    main(void)
    {
      mrb_state *mrb;

      mrb = mrb_open();

      mrb_define_method(mrb, mrb->kernel_module, "recursive", recursive,
                        MRB_ARGS_REQ(1));
      mrb_funcall(mrb, mrb_top_self(mrb), "recursive", 1, mrb_fixnum_value(30));

      mrb_close(mrb);
    }

Recursive method call isn't required. It's just for expanding call info
stack.

If mrb_realloc() is called in cipush(), cibase address is changed. So,
we shouldn't compare ci before mrb_realloc() and cibase after
mrb_realloc(). It accesses unknown address and causes crash.
2015-02-25 00:13:40 +09:00
Yukihiro "Matz" Matsumoto a2a272ca8e Merge pull request #2730 from kou/fix-no-expression-case
Fix a bug that no expression case doesn't return valid value
2015-02-24 22:07:36 +09:00
Kouhei Sutou 4b4ddd5a28 Fix a bug that no expression case doesn't return valid value
Here is a script that reproduces this problem:

     x = case
         when true; 1
         end
     p x # => main # 1 is expected
2015-02-24 20:53:12 +09:00
Yukihiro "Matz" Matsumoto 68f60714dc Merge pull request #2729 from kou/fix-if-and-no-value-returned-case
Fix a bug that if and no return value case can't return true clause value
2015-02-24 14:29:47 +09:00
Yukihiro "Matz" Matsumoto d0bc006a73 Merge pull request #2728 from govm/fix-dereference-invalid-argv
fix pointer dereference after realloc
2015-02-24 14:28:14 +09:00