summaryrefslogtreecommitdiff
path: root/compile.c
AgeCommit message (Collapse)Author
2009-09-21* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,nobu
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c, vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl, tool/instruction.rb: fixed types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-18* compile.c (iseq_compile_each), parse.y (stmt, arg): arg_concat()nobu
on op_asgn was inversed. [ruby-core:25629] [Bug #2050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08* include/ruby/st.h (st_hash_func): use st_index_t.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-06* compile.c (iseq_specialized_instruction), insns.def (opt_size):ko1
optimize #size methods (by specialized instruction). * id.c, id.h, vm.c, vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-05* compile.c (iseq_compile_each): op_asgn to aref should return rhs.nobu
[ruby-core:25387] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-05* compile.c (FIXNUM_OR): typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-05* compile.c (FIXNUM_INC, FIXNUM_OR): trivial optimizations.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-05* compile.c (iseq_compile_each): &&= and ||= should return rhs.nobu
[ruby-dev:39163] (#1996), [ruby-core:25143] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-18* compile.c (NODE_RETURN): fire return event at explicit return.mame
[ruby-dev:38701] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-31* compile.c (iseq_compile_each): used more appropriate construct.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30* compile.c (iseq_compile_each): fix stack consistency error.mame
[ruby-core:24611] * bootstraptest/test_method.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-22* vm_core.h (struct rb_iseq_t): add a new field line_no. This fieldmame
represents line number from which the original code of the iseq starts. [ruby-dev:38698] * iseq.c, compile.c: ditto. * parse.y: line number hack (for Proc#source_location) is no longer needed. * test/ruby/test_settracefunc.rb: line number of set_trace_func is now compatible with 1.8's. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-20* compile.c (compile_dstr_fragments): reduced needless literal.nobu
* parse.y (xstring, regexp, dsym, literal_concat, evstr2dstr): literal at the top of dstr is no longer needed if it is empty, since concatstrings and toregexp always create new strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16* node.h, vm_core.h, variable.c: rename global_entry to rb_global_entry.ko1
* compile.c, insns.def, iseq.c, vm_insnhelper.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-15* method.h, vm_core.h: add rb_method_entry_t. Remove nodes aroundko1
method management. This change affect some VM control stack structure. * vm.c, vm_insnhelper.c, vm_method.c, vm_eval.c: ditto. and make some refactoring. * insns.def, class.c, eval.c, proc.c, vm_dump.c : ditto. * vm_core.h, compile.c (iseq_specialized_instruction): remove VM_CALL_SEND_BIT. use another optimization tech for Kernel#send. * node.h: remove unused node types. * ext/objspace/objspace.c (count_nodes): ditto. * gc.c: add mark/free functions for method entry. * include/ruby/intern.h: remove decl of rb_define_notimplement_method_id(). nobody can use it because noex is not opend. * iseq.c (iseq_mark): fix to check ic_method is available. * iseq.c (rb_iseq_disasm): fix to use rb_method_get_iseq(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-13* vm_core.h, compile.c: declare struct iseq_inline_cache_entry.ko1
Inline cache (IC) entries are no longer GC managed object. IC entries are freed when ISeq is freed. * iseq.c: fix mark, free, memsize functions for above change. * insns.def: remove rb_gc_write_barrier(). * vm_insnhelper.c (vm_method_search): ditto. * tool/instruction.rb, template/insns_info.inc.tmpl (insn_iclen): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-13* insns.def, vm_insnhelper.c (getinstancevariable):ko1
fix to use inline cache. * compile.c: fix to skip inline cache entry (IC). IC is added automatically by compiler. * insns.def, vm_insnhelper.h: fix IC positions. * iseq.c: increment minor_version of ISeq because of above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22* compile.c (iseq_set_arguments, iseq_compile_each): internalnobu
arrays must be hidden. [ruby-dev:38613] * vm.c (Init_top_self): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-22* compile.c: fixed types.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17* compile.c: fixed types.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-17* compile.c (rb_parse_in_eval): returns true in true eval, not innobu
main. [ruby-dev:38382] * parse.y (program): inherits dvars in eval or main. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-27* compile.c (cdhash_type, iseq_set_sequence): should not callnobu
methods of the argument of case, to keep the semantics of case/when. [ruby-dev:38079] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-16* compile.c: fix to add "ensure" codes across "while" clauseko1
before "return" expression. [ruby-dev:37967] * bootstraptest/test_flow.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12* compile.c (iseq_compile_each): just freeze xstr.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12* compile.c (iseq_set_sequence, compile_dstr_fragments),nobu
(iseq_compile_each): hides other internal objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12* compile.c (hide_obj): OBJ_FREEZE() is not an expression. a patchnobu
from nagachika <nagachika00 AT gmail.com> at [ruby-dev:37977]. * compile.c (insn_set_sc_state): fixed typoe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-12* compile.c (compile_array_, defined_expr, iseq_compile_each): hidenobu
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@22255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19* vm.c: add a prefix "rb_" to exposed functionsko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-19* iseq.c:ko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-18* iseq.c (rb_iseq_load): renamed from ruby_iseq_load, since it isnobu
for C extensions or the ruby core. [ruby-core:21407] 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15* ruby.c (process_options): decrement parse_in_eval to recognizeko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27* iseq.h, iseq.c (rb_iseq_new_main): add a type ISEQ_TYPE_MAIN.ko1
[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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-27* vm.c (Init_VM): create and define TOPLEVEL_BINDING at first.ko1
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@21079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-24* compile.c (iseq_peephole_optimize): fix typo.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-09* compile.c (iseq_compile_each), gc.c (assign_heap_slot),nobu
(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: svn+ssh://ci.ruby-lang.org/ruby/trunk@20593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05* compile.c (iseq_set_sequence): uses rb_compile_warning() fornobu
warning at compilation time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05* compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code),nobu
(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: svn+ssh://ci.ruby-lang.org/ruby/trunk@20535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-16* compile.c (iseq_set_sequence): fix memory leak.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-12* compile.c (iseq_compile_each): fixed indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-28* compile.c (iseq_set_sequence): check duplicated when clauses.mame
[ruby-dev:36616] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* include/ruby/node.h, node.h: move node.h from include path.ko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* include/ruby/node.h, vm_core.h: move definition ofko1
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* compile.c (defined_expr): default defined? should returnmatz
"expression" without evaluating the expression. [ruby-dev:35967] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* compile.c (defined_expr): should handle NODE_{AND,OR} asmatz
"expression". [ruby-dev:35951] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23* compile.c (iseq_build_body): suppress a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16* include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-22* compile.c (insn_data_to_s_detail), file.c (rb_stat_inspect),nobu
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-20* compile.c (iseq_compile_each): NODE_POSTEXE should set each endnobu
procs only once. [ruby-dev:35596] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01* compile.c, vm.c, insns.def: call FrozenCore.set_postexe methodko1
instead to use "postexe" insn. * id.c, id.h: add a prepared id for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e