aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
Commit message (Collapse)AuthorAgeFilesLines
* Warn if using return at top-level with an argumentJeremy Evans2019-07-291-0/+3
| | | | Fixes [Bug #14062]
* * expand tabs.git2019-07-171-1/+1
|
* compile.c: add NO_CHECK for the calls to COMPILE whose result is unusedYusuke Endoh2019-07-171-1/+1
| | | | to suppress many warnings of Coverity Scan
* * expand tabs.git2019-07-161-3/+3
|
* compile.c: add NO_CHECK for the calls to COMPILE whose result is unusedYusuke Endoh2019-07-161-3/+3
| | | | to suppress many warnings of Coverity Scan
* Add a /* fall through */ commentYusuke Endoh2019-07-161-0/+1
|
* * expand tabs.git2019-07-151-13/+13
|
* compile.c: ignore the result of COMPILE by marking with NO_CHECKYusuke Endoh2019-07-151-17/+18
| | | | to suppress many warnings of Coverity Scan
* Add a /* fall through */ commentYusuke Endoh2019-07-151-0/+1
|
* Add a /* fall through */ commentYusuke Endoh2019-07-151-0/+1
|
* Add a /* fall through */ commentYusuke Endoh2019-07-151-0/+1
|
* Add a /* fall through */ commentYusuke Endoh2019-07-151-0/+1
|
* Add a /* fall through */ commentYusuke Endoh2019-07-151-0/+1
|
* * expand tabs.git2019-07-141-10/+10
|
* compile.c (defined_expr): return void instead of intYusuke Endoh2019-07-141-25/+22
| | | | It always returned 1.
* Fix segfault when using method reference operator without using resultJeremy Evans2019-07-051-1/+4
| | | | Fixes [Bug #15985]
* * expand tabs.git2019-06-161-6/+6
|
* Revert "Make constant assignments more conforming to JIS X 3017:2013 11.4.2.2.3"Yusuke Endoh2019-06-161-13/+8
| | | | | | | This reverts commit 44caca11cfa6bea01a1ef738846183f1a56d5658. The change caused a build failure. http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/2102153
* * expand tabs.git2019-06-161-8/+8
|
* Make constant assignments more conforming to JIS X 3017:2013 11.4.2.2.3Yuki Yugui Sonoda2019-06-161-8/+13
| | | | | compile.c (NODE_CDECL): Evaluate the module before the value test/ruby/test_const.rb (test_evaluation_order): added a test case
* Use checktype for performanceKazuki Tsujimoto2019-06-111-4/+2
|
* compile.c: Partially revert r63870 which caused wrong optimizationYusuke Endoh2019-06-071-1/+2
| | | | [Bug #15906]
* Fix grammar of macro name: ECCESSED -> ECCESSIVEMartin Dürst2019-06-051-1/+1
| | | | | Fix the name of the macro variable introduced in 0872ea5330 from NODE_SPECIAL_EXCESSED_COMMA to NODE_SPECIAL_EXCESSIVE_COMMA.
* * expand tabs.git2019-06-041-3/+3
|
* compile.c: Remove the magical `(const NODE*) -1`Yusuke Endoh2019-06-041-2/+2
| | | | | It is used to represent "no default expression" for keyword argument: `def foo(key:)`. This change uses NODE_SPECIAL_REQUIRED_KEYWORD.
* node.h: Avoid a magic number to represent excessed commaYusuke Endoh2019-06-041-1/+1
| | | | | | `(ID)1` was assigned to NODE_ARGS#rest_arg for `{|x,| }`. This change removes the magic number by introducing an explicit macro variable for it: NODE_SPECIAL_EXCESSED_COMMA.
* Use UNALIGNED_MEMBER_PTRNobuyoshi Nakada2019-05-311-2/+3
| | | | | | | | | | | * internal.h (UNALIGNED_MEMBER_ACCESS, UNALIGNED_MEMBER_PTR): moved from eval_intern.h. * compile.c iseq.c, vm.c: use UNALIGNED_MEMBER_PTR for `entries` in `struct iseq_catch_table`. * vm_eval.c, vm_insnhelper.c: use UNALIGNED_MEMBER_PTR for `body` in `rb_method_definition_t`.
* * expand tabs.git2019-05-051-3/+3
|
* parse.y: duplicated when clause warningNobuyoshi Nakada2019-05-051-12/+5
| | | | | * parse.y (case_args): moved "duplicated when clause" warning from compile phase, so that `ruby -wc` shows them.
* Lazy allocate the compile data catch table arrayLourens Naudé2019-04-251-1/+6
| | | | Closes: https://github.com/ruby/ruby/pull/2119
* Remove unnecessary conditionktsj2019-04-211-7/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Avoid usage of the dummy empty BEGIN nodektsj2019-04-201-13/+13
| | | | | | Use NODE_SPECIAL_NO_NAME_REST instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce pattern matching [EXPERIMENTAL]ktsj2019-04-171-0/+590
| | | | | | [ruby-core:87945] [Feature #14912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Get rid of a magic numbernobu2019-04-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Share the exception local ID tablenobu2019-04-111-7/+3
| | | | | | | | [Fix GH-2115] From: Lourens Naudé <lourens@bearmetal.eu> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: name a hidden local variable as a predefined IDnobu2019-04-101-3/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Reverting all commits from r67479 to r67496 because of CI failureskazu2019-04-101-3/+3
| | | | | | | | Because hard to specify commits related to r67479 only. So please commit again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: name a hidden local variable as a predefined IDnobu2019-04-101-3/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: cast iseqs to suppress warningsnobu2019-04-101-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Set a write barrier between iseq and mark objectstenderlove2019-04-091-0/+2
| | | | | | | | | ISeq pins references in the mark array during compile, so it manually marks references in the mark_ary. This was causing write barrier misses, so we need to add a write barrier when pushing on the mark array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2019-04-051-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add definemethod/definesmethod insn.ko12019-04-051-31/+25
| | | | | | | | | | | | | | | | | | | | | * insns.def: add definemethod and definesmethod (singleton method) instructions. Old YARV contains these instructions, but it is moved to methods of FrozenCore class because remove number of instructions can improve performance for some techniques (static stack caching and so on). However, we don't employ these technique and it is hard to optimize/analysis definition sequence. So I decide to introduce them (and remove definition methods). `putiseq` insn is also removed. * vm_method.c (rb_scope_visibility_get): renamed to `vm_scope_visibility_get()` and make it accept `ec`. Same for `vm_scope_module_func_check()`. These fixes are result of refactoring `vm_define_method`. * vm_insnhelper.c (rb_vm_get_cref): renamed to `vm_get_cref` because of consistency with other functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2019-03-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* node.h: introduce nd_brace to determine if a hash literal is a keywordmame2019-03-151-2/+2
| | | | | | | | | NODE_HASH#nd_brace is a flag that is 1 for `foo({ k: 1 })` and 0 for `foo(k: 1)`. nd_alen had been abused for the flag (and the implementation is completely the same), but an explicit name is better to read. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: fix the corner case of rest and keyword argumentsmame2019-03-141-2/+19
| | | | | | See https://bugs.ruby-lang.org/issues/10856#note-20 . [Bug #10856] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c (setup_args): process arguments forwardmame2019-03-141-117/+73
| | | | | | | | | | | | | | For unknown reason, setup_args processed the arguments from the last to the first. This is not only difficult to read, but also inefficient in some cases. For example, the arguments of `foo(*a1, *a2, *a3)` was compiled like `a1.dup << (a2.dup << a3)`. The second dup (`a2.dup`) is not needed. This change refactors the function so that it processes the arguments forward: `foo(*a1, *a2, *a3)` is compiled as `a1.dup << a2 << a3`, and in my opinion, the source code is now much more readable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2019-03-141-8/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: factor out "compile_args" from "compile_array"mame2019-03-141-23/+34
| | | | | | | | | | | | | compile_array function had three usages: array literal, hash literal, and method arguments. I think the third is completely different than the first and second. For example, method arguments and popped are meaningless; keywords_ptr and flag parameter for array/hash literal is also unused. This change refactors them: a function "compile_args" is created for the third, and removes no longer used parameters of "compile_array". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2019-02-211-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refactoring compile.c.ko12019-02-211-210/+228
| | | | | | | | | | * compile.c: refacetoring: * initialize `branches` with Qfalse intead of 0. * make compile_call* functions from `iseq_compile_each0()` to make modifying them easy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e