summaryrefslogtreecommitdiff
path: root/compile.c
AgeCommit message (Collapse)Author
2007-07-02* compile.c: rename iseq_translate_direct_threaded_code()ko1
to iseq_translate_threaded_code(). * eval_intern.h, yarvcore.h: mv EXEC_EVENT_HOOK() and exec_event_hooks() to yarvcore.h. * insnhelper.ci, vm.c: mv yarv_finish_insn_seq to vm.c. * insns.def (opt_call_c_function): fix to use RESTORE_REGS(). * iseq.c (rb_iseq_build_for_ruby2cext): fix to allocate iseq. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-01* compile.c, iseq.c: fix iseq some of load/store process.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-01* yarvcore.h, compile.c, insnhelper.ci, iseq.c, vm.c:ko1
rename structure names and field names. * insnhelper.h, insns.def: add GET_CONST_INLINE_CACHE(). * iseq.c: add rb_iseq_build_for_ruby2cext(). * yarvcore.h, vm.h: move declaration of rb_insn_func_t to yarvcore.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-30* yarvcore.h: some refactoring on rb_iseq_t.ko1
rename some variable names, add comments, etc. * compile.c, iseq.c, proc.c, vm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-28* compile.c: fix to remove -Wall warnings on gcc.ko1
* compile.c (make_name_with_str): removed. use rb_sprintf() instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-27* compile.c (setup_args): change parameter type.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-27* compile.c (iseq_compile_each): fix popped backref and others.ko1
([ruby-dev:31068]). * compile.c (iseq_compile_each): remove needless statements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-27* compile.c (iseq_translate_direct_threaded_code): fix prototypeko1
function name. * vm.h: add correct cast. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-26* compile.c (iseq_compile_each): fix type error.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-26* compile.c (compile_massign), insns.def (expandarray): supportko1
postarg with massign (a, *b, c = ...). * bootstraptest/test_massign.rb: add tests for above. * compile.h: fix debug macro names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-26* cont.c (rb_fiber_s_new): revert initializing VM stack.ko1
* yarvcore.c (th_init2): ditto. * vm.c, vm.h: fix to stop using Qundef on VM stack. According to this change, VM stack should not include Qundef value. * insns.def (putundef): removed. * compile.c (iseq_compile_each): ditto. * eval.c (eval): fix spacing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-25* compile.c: rename setup_arg() to setup_args().ko1
fix to use setup_args() at processing NODE_YIELD. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-25* compile.c (setup_arg): support kind of "m(*ary, x)" method call.ko1
([ruby-dev:31048]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-25* insnhelper.ci, vm.c: complete block parameter support.ko1
post arguments, optional arguments, block argument. * compile.c, parse.y: fix {|a|} parameter. * insnshelper.ci, insns.def: revert caller_setup_args() option (need_block_check) parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24* call_cfunc.ci: removed.ko1
* insnhelper.ci: added. this function includes all functions that vm insns need. * common.mk: ditto. * insnhelper.h, vm.h, vm.c: move some declaration. * gc.h: remove GC_CHECK() macro because GC.stress is more useful. * compile.c, iseq.c, vm_dump: ditto. * gc.h, thread.c: move a prototype decalaration. * debug.c, debug.h: rename some functions. * compile.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24* vm.c: some refactoring.ko1
* rename th_* to vm_*. * remove unused variables functions. * add prototypes. * blockinlining.c, compile.c, cont.c, eval.c, eval_intern.h, eval_jump.h, eval_load.c, inits.c, insns.def, iseq.c, parse.y, proc.c, process.c, signal.c, thread.c, vm.c, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24* vm.c (callee_setup_arg): added. support correct post arg.ko1
* vm_macro.def (macro_eval_invoke_func): fix to use callee_setup_arg. * compile.c (set_arguments): adjust for above changes. * compile.c (iseq_compile_each): ditto. * iseq.c (ruby_iseq_disasm): ditto. * yarvcore.h: add rb_iseq_t#post_arg_start and arg_size. * bootstraptest/test_method.rb: add post arg tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-15* vm.c (th_yield_setup_args): |v| should work as |v,|.ko1
ex) def m;yield 1, 2; end; m{|v| p v} #=> 1 * parse.y: apply above change for "for" statement. * test/ruby/test_assignment.rb: ditto * test/ruby/test_basicinstructions.rb: ditto. * test/ruby/test_iterator.rb: ditto. * test/ruby/test_yield.rb: ditto. * compile.c (iseq_compile_each): fix debug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-10* include/ruby: moved public headers.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-06* compile.c (iseq_compile_each): fix around yield argumentsko1
(with NODE_ARGSCAT). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05* parse.y (new_yield), compile.c (iseq_compile_each): fixko1
passing parameter. * eval.c, eval_jump.h: simplify rb_yield*. * proc.c (proc_mark): fix to mark proc->block.proc. * proc.c (Init_Proc): add Proc#lambda? * test/ruby/test_lambda.rb: add some tests. * vm.c (invoke_block): fix to check lambda block or not. * vm.c (th_yield_setup_args): fix to check arguments size when lambda block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05* compile.c: fixed indentation.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05* compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,nobu
pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci, thread_pthread.ci, thread_win32.ci: fixed indentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-25* eval.c (ruby_exec_internal): do nothing if no code.nobu
* compile.c (rb_iseq_compile): check node if NULL before check nd_type. [ruby-talk:252956] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-21* compile.c, vm_macro.def: support tail call optimizationko1
(on default, this feature is not enabled). * iseq.c, compile.c, vm_opts.h: add "tailcall_optimization" option. * sample/test.rb (test_ok): fix to adjust tailcall stack layout. * insns.def, vm.c, compile.c, yarvcore.c, yarvcore.h: add opt_gt, opt_le instructions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-17* parse.y, compile.c (set_arguments): fix to support in-parenko1
parameter (ex: def foo((a, b))). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-02* compile.c: use Qtrue instead of 2.ko1
* vm.c, insns.def: support "lambda" calling convention. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-01* yarvcore.h, compile.c (set_arguments): support post arguments.ko1
* test/ruby/test_method.rb: add tests for above. * test/ruby/test_proc.rb: ditto. * proc.c: fix an arity bug ([ruby-core:11029]). * vm.c, vm.h, insns.def, vm_dump.h: fix bmethod process. * vm.c: support block argument on block parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-26* compile.c: support multiple splat (e.g, [a, *b, *c, e, *f]).ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-19* eval.c, node.h, thread.c, yarvcore.[ch], eval_intern.h:ko1
support set_trace_func (incomplete. id and klass don't be passed). And support Thread#set_trace_func which hook only specified thread and Thread#add_trace_func which add new trace func instead of replace old one. C level API was modified. See thread.c (logic) and yarvcore.h (data structures). * vm.c, vm_macro.def: add hook points. * compile.c, insns.def: fix "trace" instruction. * iseq.c, vm_macro.h: add compile option "trace_instruction". * test/ruby/test_settracefunc.rb: hook "c-return" of set_trace_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-12* compile.c (iseq_compile_each): check node->nd_state == 1, not !0.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-08* compile.c (defined_expr): test arguments of NODE_CALL and sonobu
on as well as NODE_ATTRASGN. [ruby-core:10886] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-05* compile.c (defined_expr): support for assignment.nobu
[ruby-core:10867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,ko1
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h, debug.c, debug.h: merge half-baked-1.9 changes. The biggest change is to change node structure around NODE_SCOPE, NODE_ARGS. Every scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS represents more details of arguments information. I'll write a document about detail of node structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-08* compile.c: iseq_compile -> rb_iseq_compile.aamine
* iseq.c: ditto. * intern.h: provide function prototype of Init_jump. * eval_jump.h (Init_jump): declare function type. * thread.c: platform-dependent functions should be surrounded by #ifdef. * iseq.c (iseq_data_to_ary): remove unused variable. * compile.c (set_arguments): ditto. * thread.c (set_unblock_function): ditto. * thread_pthread.ci: reduce printf warning. * vm_dump.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-25* yarvcore.h:ko1
rename: rb_iseq_t#file_name -> filename rb_iseq_t#local_tbl -> local_table add: rb_iseq_t#local_table_size * compile.c: separate local_table_size and local_size (local variable size) * blockinlining.c: apply above rename. * compile.h: ditto. * eval.c: ditto. * iseq.c: ditto. * proc.c: ditto. * vm.c: ditto. * vm_dump.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-24* parse.y, node.h, compile.c: change node tree structure. a purposeko1
of this change is to unify argument structure of method and block. this change prohibits duplicate block parameter name. new argument infromation: NODE_ARGS [m: int, o: NODE_OPT_ARG, ->] NODE_ARGS_AUX [r: ID, b: ID, ->] NODE_ARGS_AUX [Pst: id, Plen: int, init: NODE*] optarg information: NODE_OPT_ARGS [idx, expr, ->] * vm_macro.def: ditto. * gc.c: ditto. * iseq.c: ditto. * compile.h: fix debug function name. * test/ripper/test_scanner_events.rb: |_,_,foo| -> |_1,_2,foo| * test/ruby/test_lambda.rb: disalbe test temporarily. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23* parse.y, compile.c, gc.c, insns.def, intern.h, iseq.c, node.h,matz
object.c, string.c, variable.c, vm_macro.def: revert private instance variable feature, which is postponed until next major release. * marshal.c: TYPE_SYMBOL2 removed; MARSHAL_MINOR reverted back to 8th version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-14* compile.c (defined_expr): no longer distinguish ordinary localmatz
variables and in-block local variables in defined? value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-07* this commit is a result of refactoring. only renaming functions,ko1
moving definitions place, add/remove prototypes, deleting unused variables and removing yarv.h. This commit doesn't change any behavior of ruby/vm. * yarv.h, common.mk: remove yarv.h (contents are moved to yarvcore.h). * error.c, eval_intern.h: include yarvcore.h instead yarv.h * rename some functions: * debug.[ch]: debug_*() -> ruby_debug_*() * iseq.c: iseq_*() -> rb_iseq_*(), ruby_iseq_disasm() * iseq.c: node_name() -> ruby_node_name() * vm.c: yarv_check_redefinition_opt_method() -> rb_vm_check_redefinition_opt_method() * some refactoring with checking -Wall. * array.c: remove rb_ary_ptr() (unused) and remove unused local variables. * object.c: add a prototype of rb_mod_module_exec(). * eval_intern.h (ruby_cref): set it inline. * eval_load.c (rb_load), yarvcore.c: yarv_load() -> rb_load_internal(). * parse.y: add a prototype of rb_parse_in_eval() (in eval.c). * process.c: add a prototype of rb_thread_stop_timer_thread() (in thread.c). * thread.c: remove raw_gets() function (unused) and fix some format mismatch (format mismatchs have remained yet. this is todo). * thread.c (rb_thread_wait_fd_rw): fix typo on label name. * thread_pthread.ci: comment out codes with USE_THREAD_CACHE. * vm.c (rb_svar, rb_backref_get, rb_backref_get, rb_lastline_get, rb_lastline_set) : moved from yarvcore.c. * vm.c (yarv_init_redefined_flag): add a prototype and rename yarv_opt_method_table to vm_opt_method_table. * vm.c (rb_thread_eval): moved from yarvcore.c. * yarvcore.c: remove unused global variables and fix to use nsdr(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-06* blockinlining.c, compile.c, compile.h, error.c, eval.c,ko1
eval_intern.h, eval_jump.h, eval_load.c, eval_method.h, eval_safe.h, gc.c, insnhelper.h, insns.def, iseq.c, proc.c, process.c, signal.c, thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h, vm_dump.c, vm_evalbody.ci, vm_macro.def, yarv.h, yarvcore.h, yarvcore.c: change type and macro names: * yarv_*_t -> rb_*_t * yarv_*_struct -> rb_*_struct * yarv_tag -> rb_vm_tag * YARV_* -> RUBY_VM_* * proc.c, vm.c: move functions about env object creation from proc.c to vm.c. * proc.c, yarvcore.c: fix rb_cVM initialization place. * inits.c: change Init_ISeq() order (after Init_VM). * ruby.h, proc.c: change declaration place of rb_cEnv from proc.c to ruby.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-06* compile.c (iseq_compile_each): fix setting is_local flag.ko1
* yarvtest/test_class.rb: add a test for class local isntance variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-06* compile.c, insns.def: remove (get|set)instancevariable2 and add ako1
operand is_local to (get|set)instancevariable. * yarvtest/test_class.rb: add a test for class local instance variable. * parse.y (rb_decompose_ivar2): remove unused variable oid. * tool/insns2vm.rb: remove needless require. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-04* parse.y (rb_compose_ivar2): function to create a new ivar2matz
symbol from a symbol and a class. back-ported from matzruby. * parse.y (rb_decompose_ivar2): reverse function of rb_compose_ivar2(). * marshal.c (w_symbol): support class local instance variables. * marshal.c (r_object0): ditto. * compile.c (defined_expr): ditto. * compile.c (iseq_compile_each): ditto. * insns.def: add two new instructions: getinstancevariable2 and setinstancevariable2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-04* insns.def (setclassvariable): remove unnecessary operand.matz
* compile.c (iseq_compile_each): ditto. * common.mk (insns_info.inc): add dependency for insns_info.inc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02* call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,nobu
eval_error.h, eval_jump.h, eval_load.c, eval_thread.c, gc.c, insnhelper.h, insns.def, iseq.c, main.c, numeric.c, parse.y, range.c, regenc.h, ruby.h, signal.c, thread.c, thread_win32.ci, vm.c, vm.h, vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h: fixed indents and non-C90 comments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02* ruby.h (SYMBOL_P): make Symbol immediate again for performance. matz
* string.c: redesign symbol methods. * parse.y (rb_id2str): store Strings for operator symbols. [ruby-dev:30235] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02* parse.y (assignable_gen): no need to generate NODE_CVDECL.matz
* compile.c (iseq_compile_each): no NODE_CVDECL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-17* some refactoring around yarvcore and proc.ko1
* eval_proc.c: renamed to proc.c. * common.mk: ditto. * yarvcore.h, yarvcore.c: rename or remove some global variables removed: mYarvCore, mYarvInsns renamed: cYarvISeq -> rb_cISeq, cYarvProc -> rb_cProc, cYarvBinding -> rb_cBinding ::YarvCore module is removed and ::YarvCore::VM class becomes ::VM. And change/remove some functions which added with YARV. * compile.c: ditto. * eval.c: ditto. * iseq.c: ditto. * vm.c: ditto. * inits.c: rename Init_yarvcore to Init_vm. * yarvcore.c, proc.c: move some functions and initialization from yarvcore.c to proc.c. * intern.h, proc.c: add global function rb_binding_new(void). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-06* insns.def : support direct method dispatch with "send" or "funcall".ko1
This means that "obj.send :m" skips "BasicObject#send" invocation (method frame creation, etc) and "obj.m" invokes directly. If you make backtrace, there are no enties of "send" method. * compile.c (iseq_specialized_instruction) : fix to support above * eval.c : ditto (remove "static" from rb_f_send and rb_f_funcall * yarvcore.c : ditto (add a external IDs for compiler) * yarvcore.h : ditto (add a VM_CALL_SEND_BIT macro) * yarvtest/test_method.rb : add tests for above changes * eval.c : remove unused "Kernel#send" declaration git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e