Граф коммитов

68 Коммитов

Автор SHA1 Сообщение Дата
ko1 571f22f5fe * compile.c (iseq_compile_each): fix next/redo stack consistency.
[ruby-dev:31373]
* bootstraptest/test_syntax.rb: add tests for above.
* sample/test.rb: fix to use __FILE__ instead of $0 to know basedir.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-16 13:12:24 +00:00
ko1 161b2e264f * compile.c (iseq_peephole_optimize): fix peephole optimization
bug. [ruby-dev:31360]
* bootstraptest/test_syntax.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-12 19:37:16 +00:00
nobu 644d3a650f * compile.c (iseq_set_sequence): raise SyntaxError instead of rb_bug
since this function can be called from VM::InstructionSequence.load.

* compile.c (insn_set_sc_state, iseq_set_sequence_stackcaching): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-20 07:30:33 +00:00
nobu 39c56c3349 * compile.c, compile.h (DECL_ANCHOR, INIT_ANCHOR): split not to
initialize aggregations with dynamic values.  [ruby-talk:259306]

* eval.c (rb_protect): not to initialize aggregations with dynamic
  values.  [ruby-talk:259306]

* gc.c (mark_current_machine_context): ditto.

* thread.c (thgroup_list, call_trace_func): ditto.

* vm.c (vm_init_redefined_flag): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-20 07:11:35 +00:00
ko1 6b6bf4dd48 * blockinlining.c: remove "yarv" prefix.
* array.c, numeric.c: ditto.
* insnhelper.ci, insns.def, vm_evalbody.ci: ditto.
* yarvcore.c: removed.
* yarvcore.h: renamed to core.h.
* cont.c, debug.c, error.c, process.c, signal.c : ditto.
* ext/probeprofiler/probeprofiler.c: ditto.
* id.c, id.h: added.
* inits.c: ditto.
* compile.c: rename internal functions.
* compile.h: fix debug flag.
* eval.c, object.c, vm.c: remove ruby_top_self.
  use rb_vm_top_self() instead.
* eval_intern.h, eval_load: ditto.
* gc.c: rename yarv_machine_stack_mark() to
  rb_gc_mark_machine_stack().
* insnhelper.h: remove unused macros.
* iseq.c: add iseq_compile() to create iseq object
  from source string.
* proc.c: rename a internal function.
* template/insns.inc.tmpl: remove YARV prefix.
* thread.c:
* vm.c (rb_iseq_eval): added.
* vm.c: move some functions from yarvcore.c.
* vm_dump.c: fix to remove compiler warning.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-12 04:25:46 +00:00
ko1 a6e3d19f3a * vm.c, insnhelper.ci: fix svar interface.
* compile.c (iseq_compile_each), yarvcore.h: fix to use new
  svar interface for flip flop.
* eval.c: ditto.
* insns.def: ditto.
* include/ruby/intern.h: remove "rb_svar()" declaration.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-10 08:04:52 +00:00
nobu d4662d49d9 * compile.c (rb_iseq_compile): formatted if/else to switch statement.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-10 07:52:03 +00:00
ko1 079976cac2 * compile.c: use rb_bug() instead of rb_compile_error().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-07 08:14:00 +00:00
ko1 976bfae03b * insns.def: remove unused code.
* compile.c (compile_massign): fix to invoke to_splat on
  splat rhs (example: *a = *nil). [ruby-dev:31136]
* bootstraptest/test_massign.rb: add tests for above.
* compile.c (iseq_compile_each): disable excess optimization.
  [ruby-dev:31126]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 18:16:54 +00:00
ko1 0bb4c2b3db * compile.c (iseq_compile_each): add break catch point.
* insns.def (throw): support correct "break" and "return".
  this commit achieve that "make test" passes all tests.
* vm.c: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 10:04:56 +00:00
nobu 46603a78af * include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,
eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c,
  yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline,
  ruby_nerrs): purge global variables.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 08:12:18 +00:00
ko1 04e9a81b8e * compile.c (compile_array, iseq_compile_each): fix about array
generation in void context. [ruby-dev:31102]
* bootstraptest/test_literal.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-03 19:35:09 +00:00
ko1 43bbe2841d * compile.c (compile_array): ignore NODE_ZARRAY.
[ruby-dev:31110]
* bootstraptest/test_method.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-03 19:11:49 +00:00
ko1 1d8ce92a37 * compile.c (iseq_compile_each): support v[&b]= type method call.
[ruby-dev:31094]
* bootstraptest/test_method.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-03 18:58:42 +00:00
ko1 d82f3e7d5c * compile.c (compile_massign): fix massign compilation
(example: a, *v, (*x) = ...).  [ruby-dev:31107]
* bootstraptest/test_massign.rb: add tests for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-03 18:50:28 +00:00
ko1 ee457d92c2 * compile.c: rename iseq_translate_direct_threaded_code()
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-02 12:49:35 +00:00
ko1 1ccf555a70 * compile.c, iseq.c: fix iseq some of load/store process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-01 21:43:30 +00:00
ko1 27013e71e4 * yarvcore.h, compile.c, insnhelper.ci, iseq.c, vm.c:
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-07-01 18:16:02 +00:00
ko1 6a69ad4df1 * yarvcore.h: some refactoring on rb_iseq_t.
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-30 18:04:35 +00:00
ko1 b73d7a44aa * compile.c: fix to remove -Wall warnings on gcc.
* 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-28 10:41:39 +00:00
ko1 c1ac175af5 * compile.c (setup_args): change parameter type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-27 17:13:13 +00:00
ko1 4a7d47e41a * compile.c (iseq_compile_each): fix popped backref and others.
([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 16:21:57 +00:00
ko1 41e9245e85 * compile.c (iseq_translate_direct_threaded_code): fix prototype
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-27 11:33:01 +00:00
ko1 35ecb83d41 * compile.c (iseq_compile_each): fix type error.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-26 19:24:40 +00:00
ko1 30ab3f75f9 * compile.c (compile_massign), insns.def (expandarray): support
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 18:56:15 +00:00
ko1 9315740101 * cont.c (rb_fiber_s_new): revert initializing VM stack.
* 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-26 06:14:44 +00:00
ko1 0043929b5f * compile.c: rename setup_arg() to setup_args().
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 18:23:35 +00:00
ko1 762a7ec12e * compile.c (setup_arg): support kind of "m(*ary, x)" method call.
([ruby-dev:31048]).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-25 17:52:33 +00:00
ko1 ed4e57690c * insnhelper.ci, vm.c: complete block parameter support.
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-25 16:05:17 +00:00
ko1 7980e653e5 * call_cfunc.ci: removed.
* 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 17:19:22 +00:00
ko1 97ba019c94 * vm.c: some refactoring.
* 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 15:42:41 +00:00
ko1 68e02f2c2c * vm.c (callee_setup_arg): added. support correct post arg.
* 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-24 07:29:21 +00:00
ko1 7567fbf080 * vm.c (th_yield_setup_args): |v| should work as |v,|.
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-15 03:27:33 +00:00
nobu 2b592580bf * include/ruby: moved public headers.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-10 03:06:15 +00:00
ko1 9a524fad38 * compile.c (iseq_compile_each): fix around yield arguments
(with NODE_ARGSCAT).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-06 01:51:45 +00:00
ko1 78029f00d5 * parse.y (new_yield), compile.c (iseq_compile_each): fix
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 17:26:00 +00:00
nobu 194a01a484 * compile.c: fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 04:49:54 +00:00
nobu 99d65b14b4 * compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,
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-06-05 04:25:10 +00:00
nobu b904e87f08 * eval.c (ruby_exec_internal): do nothing if no code.
* 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-25 15:37:05 +00:00
ko1 affa7430b7 * compile.c, vm_macro.def: support tail call optimization
(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-21 04:46:51 +00:00
ko1 ebaec402a7 * parse.y, compile.c (set_arguments): fix to support in-paren
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-17 04:25:18 +00:00
ko1 f53a94c831 * compile.c: use Qtrue instead of 2.
* 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-02 02:26:03 +00:00
ko1 75d28f8870 * yarvcore.h, compile.c (set_arguments): support post arguments.
* 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-05-01 04:35:58 +00:00
ko1 9d89855052 * compile.c: support multiple splat (e.g, [a, *b, *c, e, *f]).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-26 16:54:58 +00:00
ko1 a73894337a * eval.c, node.h, thread.c, yarvcore.[ch], eval_intern.h:
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-19 10:37:08 +00:00
ko1 baeb828c03 * compile.c (iseq_compile_each): check node->nd_state == 1, not !0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-12 07:06:17 +00:00
nobu e12090b9b2 * compile.c (defined_expr): test arguments of NODE_CALL and so
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-08 04:27:41 +00:00
nobu 22e4a7703f * compile.c (defined_expr): support for assignment.
[ruby-core:10867]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-05 08:58:46 +00:00
ko1 bb7a2d40ff * compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
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-21 11:15:15 +00:00
aamine c49418522d * compile.c: iseq_compile -> rb_iseq_compile.
* 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-03-08 00:23:14 +00:00