Commit Graph

64 Commits

Author SHA1 Message Date
Masaki Muranaka b231bcb812 load_exec(): Fix message lenghtes in mrb_exc_new().
mrb_run(): Fix not to use a magic number but sizeof.
2012-08-04 19:54:21 +09:00
Yukihiro Matsumoto 472d214a71 super look-up scheme fixed; close #415 2012-08-04 06:44:53 +09:00
Yukihiro Matsumoto 6fb88f7e1d update regs after cfunc call [2] 2012-08-03 01:02:43 +09:00
Yukihiro Matsumoto 5aff0d3f25 update regs after cfunc call 2012-08-03 00:40:36 +09:00
Yukihiro Matsumoto 91318da3bc wrong return value from empty block/lambda 2012-08-02 12:57:57 +09:00
Yukihiro Matsumoto 90323f545f keep minimal stack space (recv and blk) 2012-08-02 07:56:23 +09:00
Yukihiro Matsumoto 29d4eb6e20 stack pos should be adjusted for CFUNC OP_EXEC 2012-08-02 04:00:42 +09:00
Yukihiro Matsumoto 9ccf9767e1 protect return value from mrb_funcall 2012-08-02 01:13:45 +09:00
Yukihiro Matsumoto 47ff5a0643 move OP_LOADNIL just before OP_SEND to improve performance on some platforms 2012-08-02 00:43:38 +09:00
Yukihiro Matsumoto d271bf0aa6 make mrb_funcall_argv and mrb_funcall_with_block to take mrb_sym as a method name 2012-08-01 13:15:02 +09:00
Yukihiro Matsumoto 7511508a64 restore arena index after funcall 2012-08-01 12:54:57 +09:00
Yukihiro Matsumoto 0220953efe no OP_LOADNIL for operators (OP_ADD, etc) 2012-08-01 02:33:55 +09:00
Yukihiro Matsumoto 998830e1bc reduce restoration of arena_idx in vm loop 2012-07-31 10:55:30 +09:00
Max Anselm 5a4beeed2d Make all(?) void casts explicit for C++ 2012-07-29 19:48:48 -04:00
Masamitsu MURASE a985cf7945 Modify ci->nregs. 2012-07-28 19:16:54 +09:00
Yukihiro Matsumoto 638a66fd78 adjust ci->nregs for C implemented methods 2012-07-27 10:05:47 +09:00
Yukihiro Matsumoto 88b638cf82 instance_eval should set target_class in the block 2012-07-24 23:16:41 +09:00
Masaki Muranaka cd50242146 Reduce strlen(). refs #301 2012-07-16 17:58:20 +09:00
Yukihiro Matsumoto 737eaea038 allow DISABLE/ENABLE_SATDIO 2012-07-13 15:00:45 +09:00
Masaki Muranaka 611cf71a10 Use mrb_calloc if you want zero cleard buffers. 2012-07-08 11:33:49 +09:00
Yukihiro Matsumoto ca930538ea prepare for OP_TAILCALL 2012-07-05 01:40:23 +09:00
Masaki Muranaka d534f26f16 Use sizeof to get char array sizes. 2012-06-27 10:36:39 +09:00
Yukihiro Matsumoto c99b806f8b ci->acc should not be left uninitialized; close #303 2012-06-25 19:24:57 +09:00
Yukihiro Matsumoto c261e4f360 resolve crash issue on LLVM; longjmp cleared some local variable 2012-06-24 00:15:22 +09:00
Yukihiro Matsumoto f045e64675 reduce calling mrb_str_new_cstr() to avoid strlen(); #301 2012-06-23 13:51:50 +09:00
Yukihiro Matsumoto 2d781f5c1d remove assertion for false assumption; mrb_str_new(0, len) where len > 0 can be used to allocate an unintialized string 2012-06-23 09:49:14 +09:00
Yukihiro Matsumoto ef50e63a63 remove RuntimeError from mrb_state 2012-06-20 20:43:27 +09:00
Yukihiro Matsumoto 88db589e7f protect crash from empty irep 2012-06-20 15:12:35 +09:00
Yukihiro Matsumoto 5353b8555c exception jump should not cross mrb_funcall border; close #276 2012-06-15 22:57:11 +09:00
Yukihiro Matsumoto 4913311155 should not swallow exceptions from ensure clause 2012-06-15 16:20:25 +09:00
Yukihiro Matsumoto 2eeaab4e81 do not offset jump from OP_ENTER if no optional argument given 2012-06-14 04:44:02 +09:00
Yukihiro Matsumoto 36a1c80d3c uvenv(): proc->env may be NULL be before uplevel 2012-06-14 03:44:45 +09:00
Yukihiro Matsumoto 6adaf3b80f should invoke ensure clauses just before terminating mrb_sun; close #270 2012-06-14 01:47:31 +09:00
Yukihiro Matsumoto 6a5019d37f optimized OP_{ADD,SUB,MUL,DIV} to use numeric function for fixnums to handle overflow 2012-06-13 15:38:18 +09:00
Yukihiro Matsumoto 6247eafc71 should raise error on top-level super/yield 2012-06-12 01:24:11 +09:00
Yukihiro Matsumoto 13a542d48d zsuper should respect block given; close #185 2012-06-11 15:55:04 +09:00
Yukihiro Matsumoto 85901e0546 fixed typo DISPACTH to DISPATCH 2012-06-10 21:44:57 +09:00
Yukihiro Matsumoto 4c01f002fd mruby/array.h: rename buf to ptr 2012-06-05 23:20:36 +09:00
Yukihiro Matsumoto e88e30524e should have adjusted stack address kept in closures; close #222 2012-06-03 14:44:46 +09:00
Yukihiro Matsumoto 27c2416d20 stack_extend boundary condition was wrong 2012-06-03 14:13:25 +09:00
Yukihiro Matsumoto ea9bb1e38f adjust stack position before exiting mrb_run(); close #193 2012-05-25 13:48:54 +09:00
Yukihiro Matsumoto ad9e841c53 made mrb_get_args() better (optinal args, type checks); close #173 #176 2012-05-24 01:09:36 +09:00
Yukihiro Matsumoto 4523bee953 cast style consistency 2012-05-23 03:31:55 +09:00
Yukihiro Matsumoto 84a2fb102c wrong stack position in rescue clause 2012-05-21 10:25:26 +09:00
Mitchell Blank Jr 9e336b00e5 More C++ compilability work: mrb_obj_alloc void* conversions
One of the biggest set of changes needed to make C++ compile, is that you
can't autoconvert "void*" to a different pointer type without a cast (you
can of course, convert pointers *to* "void*"!)

For the first part, convert the users of "mrb_obj_alloc".  Since it has
to return something, make it RBasic* (that's what mrb_obj_alloc() is
operating on anyway).  This way, even in C you'll get a warning if you
don't cast it.

For places where there are a lot of similar calls to mrb_obj_alloc(),
this can be easily hidden through a macro.  I did this in string.c:
    #define mrb_obj_alloc_string(mrb) ((struct RString *) mrb_obj_alloc((mrb), MRB_TT_STRING, (mrb)->string_class))

I also updated the mrb_object() macro to also return a RBasic* -- my
previous commit changed that from "void*" -> "RObject*", but I figure
it should be consistent with mrb_obj_alloc()
2012-05-20 09:43:14 -07:00
Masaki Muranaka 6250d06b94 Avoid "may be used uninitialized in this function" warning. 2012-05-16 16:28:07 +09:00
Yukihiro Matsumoto 1c6621d5f0 OP_STOP to return exception object on error 2012-05-14 23:22:08 +09:00
Yukihiro "Matz" Matsumoto 96819cf881 Merge pull request #117 from k-tsj/toplevel-return
Raise LocalJumpError when returning from top-level
2012-05-12 02:58:00 -07:00
Kazuki Tsujimoto 66df0ad0a8 Raise LocalJumpError when returning from top-level 2012-05-12 10:59:36 +09:00
Kazuki Tsujimoto 632556bc6f Move stack values to heap whenever ci is popped 2012-05-12 10:47:15 +09:00