Commit Graph

105 Commits

Author SHA1 Message Date
Yukihiro Matz Matsumoto 1bab7bc511 eliminate unused array expression more aggresively 2013-01-13 00:49:33 +09:00
Yukihiro Matz Matsumoto f134e8e1bf jump address error when value taken from if statement without else clause; close #712 2013-01-10 01:06:51 +09:00
Masamitsu MURASE d48bb813d8 unless without else should return nil if the condition is true. 2013-01-06 06:23:10 +09:00
Masamitsu MURASE 749404051c Modify NODE_IF handling.
When "unless" is used without "else", tree->cdr->car of NODE_IF is NULL.
In this case, pop() should not be called because codegen generates no code.
2013-01-06 05:08:04 +09:00
Yukihiro Matz Matsumoto c836187cf2 minor cosmetic change after #676 2012-12-28 18:10:26 +09:00
skandhas 320a931965 fix correct stack postion for headless case 2012-12-28 16:48:33 +08:00
Yukihiro Matz Matsumoto 9d56acb709 wrong stack position for headless case; close #675 2012-12-28 17:12:22 +09:00
Yukihiro Matz Matsumoto 141d0d841c should copy lineno info to child scope 2012-12-22 00:11:19 +09:00
Yukihiro Matz Matsumoto 24feb401c1 codedump should print relative offset for irep in OP_LAMBDA 2012-12-18 03:09:44 +09:00
Lian Cheng 2fa0be2a30 Call mrb_gc_arena_save/mrb_gc_arena_restore instead of manipulating arena index directly 2012-12-12 21:05:02 +08:00
Yukihiro Matz Matsumoto f1ed143624 mange arena_idx smarter for smaller ARENA_SIZE; now default to 100 from 1024 2012-12-07 16:58:50 +09:00
Yukihiro Matz Matsumoto f486774352 refactor and move irep malloc away to mrb_add_irep() 2012-12-07 15:57:40 +09:00
Yukihiro "Matz" Matsumoto 9754512716 Merge pull request #568 from mauceri/master
Potential memory management bug (issue #553)
2012-12-02 19:17:13 -08:00
skandhas 9704ceefce remove incorrect pop() in codegen 2012-11-30 22:11:41 +08:00
skandhas 7bae52fc56 remove redundant LOOP_NORMAL checkups in function:codegen. and fix #561 2012-11-23 16:10:14 +08:00
Christian Mauceri 186fd9a303 pull request issue 553 - try to fix brken link 2012-11-22 15:26:23 +01:00
Christian Mauceri 06ca237bab pull request issue 553 2012-11-22 12:55:03 +01:00
Yukihiro Matz Matsumoto 0ab7ff81d6 should initialize irep->flags 2012-11-09 05:51:18 +09:00
Takashi Sogabe c0c1c4da32 Fix stack underflow in scope_body()
Commit #18dd60c causes side effects.
This patch fixes stack underflow in scope_body().
2012-11-02 17:49:56 +09:00
Kouki Ooyatsu 35699424a9 fix: broken variable reference, use 'next' statement
Because the tree is gone pop() even if it is empty.
2012-10-31 20:20:36 +09:00
Yukihiro "Matz" Matsumoto c6c4da8c48 Merge pull request #510 from masuidrive/master
define convert method mrb_int/mrb_float with C string
2012-10-28 10:45:43 -07:00
Yuichiro MASUI 15f46a1feb define convert method mrb_int/mrb_float with C string 2012-10-27 14:26:50 +09:00
Masaki Muranaka 1933e2660c Use substitution instead of memset in structure initialization. 2012-10-25 15:47:45 +09:00
Yukihiro Matsumoto 32f9cdc97d adjust regsiter stack for NODE_OP_ASGN that use OP_SEND 2012-10-23 14:15:29 +09:00
Yukihiro Matsumoto 09376f9b2a skip useless OP_MOVE in peephole optimization 2012-10-23 14:14:26 +09:00
Yukihiro Matsumoto 413528ce80 adjust regsiter stack for NODE_OP_ASGN; close #499 2012-10-23 11:35:26 +09:00
Yukihiro Matsumoto 7fe6d00ff5 avoid duplicated OP_RETURN 2012-10-20 09:48:04 +09:00
Yukihiro Matsumoto 750b7c209c pop register stack before rescue 2012-10-20 08:44:25 +09:00
Yukihiro Matsumoto 89a18e4f22 unexpect break/next/redo/retry should raise LocalJumpError 2012-10-20 03:59:13 +09:00
Yukihiro Matsumoto da637cac4a should handle break in rescue 2012-10-20 03:30:58 +09:00
Yukihiro Matsumoto 651e8b7e9c empty NODE_BEGIN should push nil; close #496 2012-10-19 23:04:20 +09:00
Takashi Sogabe 8d6f1b04a1 Fix disappearance of a local variable when return statement is called
Commit of #18dd60c causes disappearance of a local variable
if return statement is called without arguments.

This patch fixes incorrect value of stack pointer.

test program:
def test_return_cond
  return if nil
  obj = 123
  p obj
  p obj.class
end
test_return_cond

output(commit #18dd60c):
main
Object

output(includes this patch):
123
Fixnum
2012-10-17 12:55:50 +09:00
Yukihiro Matsumoto 18dd60c162 remove wasting stack space 2012-10-16 23:47:16 +09:00
Yukihiro Matsumoto f2da76b6ef register number adjustment for case statement was wrong; close #487 2012-10-16 22:24:40 +09:00
Yukihiro Matsumoto 540066c9e2 mrb_sym can be short integer; reduced 10KB 2012-09-12 16:20:32 +09:00
Tomoyuki Sahara 20e9d53fb8 fix out-of-bound access on compiling empty blocks. 2012-09-04 15:59:39 +09:00
Yukihiro Matsumoto 4e8317f5df do no generate lineno info if no filename is specified 2012-09-03 15:33:35 +09:00
Yukihiro Matsumoto 4f7a1a167d remove memleaks using linked allocator 2012-09-03 08:34:31 +09:00
Yukihiro Matsumoto 5340126443 remove OP_LOADNIL before OP_SEND by introducing OP_SENDB (send with block) 2012-09-03 08:32:57 +09:00
Yukihiro Matsumoto 9c12b47d73 peephole optimization to generatio OP_ADDI/OP_SUBI 2012-09-03 00:05:28 +09:00
Yukihiro Matsumoto f114916610 source position added to exception representation 2012-08-31 15:58:33 +09:00
Yukihiro Matsumoto 3e924e887f save debugging lineno info in irep 2012-08-31 11:12:33 +09:00
Yukihiro Matsumoto 950204bc4d remove flags from irep 2012-08-29 11:45:36 +09:00
Yukihiro Matsumoto 376266959f close pool in toplevel scope 2012-08-28 02:05:42 +09:00
Yukihiro Matsumoto 15725eb4f6 file/line info passed to codegen; argument type of mrb_generate_code() has changed 2012-08-22 22:36:44 +09:00
Yukihiro Matsumoto 1ed39d5c05 use TRUE/FALSE instead of 1/0 2012-08-13 04:19:24 +09:00
Yukihiro Matsumoto 4debf651a3 optimize assignment just before OP_RETURN 2012-08-10 05:15:58 +09:00
Yukihiro Matsumoto 7c4bd7fffd remove OP_MOVE just before OP_RETURN 2012-08-05 17:07:43 +09:00
Yukihiro Matsumoto b8b22c1d17 use mrb_obj_equal to check pool 2012-08-02 22:15:49 +09:00
Yukihiro Matsumoto a7f0e3bc80 small return optimization: use R0 to set return value if possible 2012-08-02 13:13:41 +09:00