summaryrefslogtreecommitdiffstats
path: root/compile.c
Commit message (Collapse)AuthorAgeFilesLines
* * compile.c (iseq_set_arguments, iseq_compile_each): internalnobu2009-06-221-2/+3
| | | | | | | | | arrays must be hidden. [ruby-dev:38613] * vm.c (Init_top_self): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c: fixed types.nobu2009-06-221-8/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c: fixed types.nobu2009-05-171-14/+15
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (rb_parse_in_eval): returns true in true eval, not innobu2009-05-171-1/+1
| | | | | | | | | main. [ruby-dev:38382] * parse.y (program): inherits dvars in eval or main. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (cdhash_type, iseq_set_sequence): should not callnobu2009-02-271-0/+33
| | | | | | | | methods of the argument of case, to keep the semantics of case/when. [ruby-dev:38079] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c: fix to add "ensure" codes across "while" clauseko12009-02-161-29/+44
| | | | | | | | | before "return" expression. [ruby-dev:37967] * bootstraptest/test_flow.rb: add a test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each): just freeze xstr.nobu2009-02-121-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_set_sequence, compile_dstr_fragments),nobu2009-02-121-2/+6
| | | | | | | (iseq_compile_each): hides other internal objects. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (hide_obj): OBJ_FREEZE() is not an expression. a patchnobu2009-02-121-2/+2
| | | | | | | | | from nagachika <nagachika00 AT gmail.com> at [ruby-dev:37977]. * compile.c (insn_set_sc_state): fixed typoe. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (compile_array_, defined_expr, iseq_compile_each): hidenobu2009-02-121-1/+4
| | | | | | | | | | | | | | and freeze internal literal objects, to prevent from modifying. [ruby-dev:37959] * iseq.c (insn_operand_intern): copy internal literal objects. * insns.def (putstring, duparray): ditto. * string.c (rb_str_replace): exported. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c: add a prefix "rb_" to exposed functionsko12009-01-191-3/+3
| | | | | | | | | | | | | | | | | vm_get_ruby_level_next_cfp(), rb_vm_make_env_object(), vm_stack_to_heap(), vm_make_proc(), vm_invoke_proc(), vm_get_sourceline(), vm_cref(), vm_localjump_error(), vm_make_jump_tag_but_local_jump(), vm_jump_tag_but_local_jump(). This changes may affect only core because most of renamed functions require a pointer of not-exposed struct such as rb_thread_t or NODE. In short, they are core functions. * cont.c, eval.c, eval_intern.h, load.c, proc.c, thread.c, vm_core.h, vm_dump.c, vm_eval.c, vm_exec.c, vm_insnhelper.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c:ko12009-01-191-7/+21
| | | | | | | | | | | | | | | | | | | | | | rename ruby_iseq_disasm_insn() -> rb_iseq_disasm_insn(). rename ruby_iseq_disasm() -> rb_iseq_disasm(). * compile.c: rename ruby_iseq_compile() -> rb_iseq_compile_node(). rename ruby_iseq_translate_threaded_code() -> rb_iseq_translate_threaded_code(). rename ruby_insns_name_array() -> rb_insns_name_array(). rename ruby_iseq_build_from_ary() -> rb_iseq_build_from_ary(). * iseq.c, compile.c: remove ruby_insn_make_insn_table() and make static function insn_make_insn_table(). * iseq.h, ruby.c, vm.c, vm_core.h, vm_eval.c, vm_dump.c, blockinlining.c: ditto. Rename strange "ruby_" prefix to "rb_" prefix. This changes may affect only core because renamed functions require a pointer of rb_iseq_t which is not exposed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.c (rb_iseq_load): renamed from ruby_iseq_load, since it isnobu2009-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for C extensions or the ruby core. [ruby-core:21407] ?\012 Index: compile.c =================================================================== --- compile.c (revision 21649) +++ compile.c (working copy) @@ -5078,5 +5078,5 @@ iseq_build_exception(rb_iseq_t *iseq, st } else { - eiseqval = ruby_iseq_load(ptr[1], iseq->self, Qnil); + eiseqval = rb_iseq_load(ptr[1], iseq->self, Qnil); } @@ -5162,5 +5162,5 @@ iseq_build_body(rb_iseq_t *iseq, LINK_AN if (op != Qnil) { if (TYPE(op) == T_ARRAY) { - argv[j] = ruby_iseq_load(op, iseq->self, Qnil); + argv[j] = rb_iseq_load(op, iseq->self, Qnil); } else if (CLASS_OF(op) == rb_cISeq) { Index: iseq.c =================================================================== --- iseq.c (revision 21649) +++ iseq.c (working copy) @@ -448,5 +448,5 @@ iseq_s_load(int argc, VALUE *argv, VALUE VALUE -ruby_iseq_load(VALUE data, VALUE parent, VALUE opt) +rb_iseq_load(VALUE data, VALUE parent, VALUE opt) { return iseq_load(rb_cISeq, data, parent, opt); Index: iseq.h =================================================================== --- iseq.h (revision 21649) +++ iseq.h (working copy) @@ -21,5 +21,5 @@ VALUE ruby_iseq_build_from_ary(rb_iseq_t /* iseq.c */ -VALUE ruby_iseq_load(VALUE data, VALUE parent, VALUE opt); +VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt); struct st_table *ruby_insn_make_insn_table(void); git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (process_options): decrement parse_in_eval to recognizeko12009-01-151-0/+6
| | | | | | | | | | | | parsing main or normal eval script. * compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script) * parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * iseq.h, iseq.c (rb_iseq_new_main): add a type ISEQ_TYPE_MAIN.ko12008-12-271-1/+22
| | | | | | | | | | | [ruby-dev:37619] * compile.c (rb_dvar_defined, ruby_iseq_compile): ditto. * iseq.c (iseq_data_to_ary, iseq_load): ditto. * compile.c (iseq_compile_each): fix to check ip->compile_data. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.ko12008-12-271-9/+13
| | | | | | | | | | | | | | | | | | * vm.c (vm_set_main_stack, rb_iseq_eval_main): added. * parse.y (rb_parser_compile_file): fix to check parse_in_eval flag. * eval.c (ruby_exec_node): use rb_iseq_eval_main() instead of rb_iseq_eval(). * iseq.c (rb_iseq_new_main), vm_core.h: added. main script (specified by -e or script name) should be run under TOPLEVEL_BINDING using Kernel#eval. Above changes simulate Kernel#eval behaviour. [ruby-dev:37240] * compile.c (make_name_for_block): skip iseq except block type. this fix is needed for [ruby-dev:37240], and also fixes [ruby-dev:35392]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_peephole_optimize): fix typo.ko12008-12-241-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each), gc.c (assign_heap_slot),nobu2008-12-091-1/+1
| | | | | | | | | | | | | (gc_mark_children), parse.y (vtable_alloc, vtable_free, vtable_add), proc.c (proc_to_s), thread.c (terminate_i, rb_thread_terminate_all), (thread_start_func_2, blocking_region_begin, blocking_region_end), (rb_thread_kill), thread_pthread.c (native_thread_create), (ubf_pthread_cond_signal), vm.c (check_env, thread_free), vm_dump.c (vm_env_dump_raw, vm_stack_dump_each, vm_thread_dump_state), (vm_call0): use void pointer for %p. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_set_sequence): uses rb_compile_warning() fornobu2008-12-051-1/+2
| | | | | | | warning at compilation time. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code),nobu2008-12-051-13/+11
| | | | | | | | | | (ruby_insns_name_array, ruby_iseq_build_from_ary): prefixed with ruby_. * iseq.c (ruby_iseq_load, ruby_insn_make_insn_table): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_set_sequence): fix memory leak.mame2008-10-161-0/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each): fixed indent.nobu2008-10-121-101/+101
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_set_sequence): check duplicated when clauses.mame2008-09-281-1/+6
| | | | | | | [ruby-dev:36616] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, node.h: move node.h from include path.ko12008-09-231-1/+0
| | | | | | | | | | | | | | This change stop to install node.h beacuase of saving ABI (node.h will be changed. Extensions should not depends on this file). * blockinlining.c, class.c, compile.c, debug.h, enum.c, gc.c, iseq.c, parse.y, ruby.c, signal.c, variable.c, vm.c, vm_core.h, vm_dump.c: ditto. * ext/ripper/depend: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/node.h, vm_core.h: move definition ofko12008-09-231-12/+279
| | | | | | | | | | | | | | | | | | | | | RUBY_VM_METHOD_NODE to node.h. * class.c, common.mk: remove useless inclusion. * compile.h, iseq.h, vm_core.h: rename compile.h to iseq.h. move some definitions from vm_core.h to iseq.h. * compile.c, iseq.c, vm.c: ditto. * eval.c, compile.c: move some functions for parser from eval.c to compile.c. * eval_intern.h, vm_core.h: move va_init_list() macro to vm_core.h. * iseq.c (rb_iseq_new_top, rb_iseq_first_lineno): added. * load.c, ruby.c: use rb_iseq_new_top() instead of rb_iseq_new() with ISEQ_TYPE_TOP constant directly. * proc.c: use rb_iseq_first_lineno() instead of accessing iseq structure. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (defined_expr): default defined? should returnmatz2008-08-251-27/+1
| | | | | | "expression" without evaluating the expression. [ruby-dev:35967] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (defined_expr): should handle NODE_{AND,OR} asmatz2008-08-251-0/+2
| | | | | | "expression". [ruby-dev:35951] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_build_body): suppress a warning.nobu2008-08-231-1/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu2008-08-161-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),nobu2008-07-221-3/+1
| | | | | | | | | | | | | | iseq.c (ruby_iseq_disasm_insn, ruby_iseq_disasm), process.c (pst_message), re.c (match_inspect): use rb_str_catf. * dir.c (dir_inspect), iseq.c (iseq_inspect, insn_operand_intern): use rb_sprintf. * error.c (rb_name_error, rb_raise, rb_loaderror, rb_fatal): use rb_vsprintf. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each): NODE_POSTEXE should set each endnobu2008-07-201-0/+9
| | | | | | | procs only once. [ruby-dev:35596] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, vm.c, insns.def: call FrozenCore.set_postexe methodko12008-07-011-3/+7
| | | | | | | | | instead to use "postexe" insn. * id.c, id.h: add a prepared id for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (enum ruby_special_consts): ISO C forbidsshyouhei2008-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | comma at end of enumerator list * include/ruby/ruby.h (enum ruby_value_type): ditto. * eval_intern.h (enum): ditto. * vm_core.h (enum rb_thread_status): ditto. * parse.y (enum lex_state_e): ditto. * parse.y (enum string_type): ditto. * process.c (enum): ditto. * ruby.c (enum dump_flag_bits): ditto. * ruby.c (enum disable_flag_bits): ditto. * compile.c (iseq_link_element): ditto * debug.c (union): ditto. * cont.c (enum context_type): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, insns.def, vm.c, vm_core.h: remove some insnsko12008-07-011-21/+32
| | | | | | | | | | | | (undef, alias, definemethod). Call RubyVM::FrozenCore's singleton method instead. Add "putiseq" and "putspecialobject" instructions. * id.c, id.h: add ids for above. * tool/parse.rb: "VM" no longer exists. Use RubyVM instead. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_build_from_ary): initialize arg_opts, a patch frommame2008-06-231-2/+3
| | | | | | | Adam Strzelecki <ono@java.pl> in [ruby-core:17220]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_build_from_ary): fix expression to obtain wanabe2008-06-231-8/+2
| | | | | | iseq->local_size and iseq->local_table_size. [ruby-dev:35205] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c : treat []&&= in virtually the same way as []||=.wanabe2008-06-091-6/+3
| | | | | | [ruby-dev:34679] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu2008-06-091-11/+11
| | | | | | | * *.c: no cache in init functions. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppress warnings with -Wwrite-string.nobu2008-05-311-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (defined_expr): fix SEGV by defined?([1]).mame2008-05-301-10/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile): set local_table formame2008-05-251-0/+1
| | | | | | | ISEQ_TYPE_DEFINED_GUARD. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_build_body): remove side effect frommame2008-05-251-0/+1
| | | | | | | VM::InstructionSequence.load. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval_method.c: renamed from vm_method.c. "vm_method.c" is includedko12008-05-241-8/+3
| | | | | | | | | | | | | | | by "vm.c". * vm_eval.c: added. Some codes are moved from "eval.c" * common.mk: fix for above changes. * compile.c: make a vm_eval(0) * eval.c, eval_error.c, eval_intern.h, eval_jump.c, proc.c, vm.c, id.c, id.h, vm_core.h, vm_dump.c, vm_evalbody.c, vm_insnhelper.c, blockinlining.c: fix for above changes. and do some refactoring. this changes improve rb_yield() performance. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_set_exception_table, NODE_WHILE, NODE_NEXT): removemame2008-05-241-7/+17
| | | | | | | | | special handling that decrements sp in CATCH_TYPE_NEXT for NODE_WHILE. * vm.c (vm_eval_body), vm_insnhelper.c (vm_throw): remove unused code. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (get_destination_insn, get_next_insn, get_prev_insn):mame2008-05-221-3/+3
| | | | | | | peephole optimization should not ignore ISEQ_ELEMENT_ADJUST. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c, insns.def, eval.c, vm_insnhelper.c: fix CREF handling.ko12008-05-191-20/+17
| | | | | | | | | | | | | | VM value stack frame of block contains cref information. (dfp[-1] points CREF) * compile.c, eval_intern.h, eval_method.c, load.c, proc.c, vm_dump.h, vm_core.h: ditto. * include/ruby/ruby.h, gc.c: remove T_VALUES because of above changes. * bootstraptest/test_eval.rb, test_knownbug.rb: move solved test. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def: add a "putcbase" instruction.ko12008-05-141-8/+8
| | | | | | | | | * compile.c, insns.def: fix to use putcbase instruction for class search. Qundef should not be used. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (is_defined): add NODE_OP_ASGN_{OR,AND}. "defined?(a||=1)"matz2008-05-121-0/+2
| | | | | | should not operate assignment. [ruby-dev:34645] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c (iseq_compile_each): should call compile_cpath() formatz2008-05-051-1/+1
| | | | | | | | modules as well. [ruby-dev:34585] * insns.def (defineclass): add undef handling. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@16299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e