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

1130 Коммитов

Автор SHA1 Сообщение Дата
ko1 28c0aec1d8 * eval.c (eval): should be volatile value for GC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-09 12:49:03 +00:00
nobu 4155206ebd * eval.c (send_internal): use self in the previous frame to check for
protected methods.  [ruby-core:13254]

* insnhelper.ci (vm_call_method): send! method has gone.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-09 01:43:57 +00:00
nobu 4c040861c8 * eval.c (rb_invoke_method): check if invoked in function style.
[ruby-core:13245]

* insnhelper.ci (vm_call_cfunc, vm_cfunc_flags): stores and returns VM
  calling flags.

* vm.c (rb_vm_cfunc_funcall_p): returns if the current method is
  invoked in function style.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-09 01:29:24 +00:00
davidflanagan ba80fd2bbf * eval.c: fix typo in invoke_method documentation
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-06 20:21:50 +00:00
matz 6a24fdb09d * eval.c (Init_eval): move #send to Kernel module from BasicObject.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-05 03:21:54 +00:00
matz 1eee78b876 * eval.c (rb_f_send): allow send/__send__ to call methods of all
visibility again.  we no longer provide __send, __send!.

* eval.c (rb_invoke_method): new method to honor private
  visibility.  if it's invoked in a function call style, it calls
  private methods as well (previous 1.9 send behavior).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-04 20:36:20 +00:00
nobu b9b34059a6 * eval.c (ruby_options), ruby.c (proc_options, process_options): not
call exit(2) directly.  [ruby-dev:31912]

* eval.c (ruby_run_node): deal with direct exit code.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-01 01:52:32 +00:00
akr 5c0e68c39c * include/ruby/intern.h: export rb_ivar_foreach.
* include/ruby/ruby.h: modify struct RObject and RClass for optimizing
  T_OBJECT space.  [ruby-dev:31853]
  (ROBJECT_LEN, ROBJECT_PTR)
  (RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_SUPER, RCLASS_IV_INDEX_TBL)
  (RMODULE_IV_TBL, RMODULE_M_TBL, RMODULE_SUPER): abstract accessor
  defined.

* variable.c: support the modified RObject and RClass.

* object.c: ditto.

* class.c: ditto.

* gc.c: ditto.

* marshal.c: ditto.

* eval_method.ci: use the abstract accessor.

* insns.def: ditto.

* proc.c: ditto.

* struct.c: ditto.

* eval.c: ditto.

* error.c: ditto.

* vm.c: ditto.

* insnhelper.ci: ditto.

* ext/digest/digest.c: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28 06:21:46 +00:00
ko1 67aa07f44d * eval.c (eval): fix to check stack overflow.
* eval_intern.h, vm.h: move CHECK_STACK_OVERFLOW() macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-26 10:39:49 +00:00
matz 72ea36112c * eval.c (rb_longjmp): source file information may be NULL.
[ruby-dev:31849]

* eval.c (ruby_finalize_0): clear trace_func before finalization.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-25 12:40:17 +00:00
ko1 d5e687b724 * vm.h, eval_intern.h: move some macros to eval_intern.h.
* eval_jump.ci (rb_f_throw): fix to use NEW_THROW_OBJECT().
* eval.c (rb_f_loop): remove additional macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-14 07:17:17 +00:00
matz a25fbe3b3e * encoding.c: provide basic features for M17N.
* parse.y: encoding aware parsing.

* parse.y (pragma_encoding): encoding specification pragma.

* parse.y (rb_intern3): encoding specified symbols.

* string.c (rb_str_length): length based on characters.  
  for older behavior, bytesize method added.

* string.c (rb_str_index_m): index based on characters.  rindex as
  well.

* string.c (succ_char): encoding aware succeeding string.

* string.c (rb_str_reverse): reverse based on characters.

* string.c (rb_str_inspect): encoding aware string description.

* string.c (rb_str_upcase_bang): encoding aware case conversion.
  downcase, capitalize, swapcase as well.

* string.c (rb_str_tr_bang): tr based on characters.  delete,
  squeeze, tr_s, count as well.

* string.c (rb_str_split_m): split based on characters.

* string.c (rb_str_each_line): encoding aware each_line.

* string.c (rb_str_each_char): added.  iteration based on
  characters.

* string.c (rb_str_strip_bang): encoding aware whitespace
  stripping.  lstrip, rstrip as well.

* string.c (rb_str_justify): encoding aware justifying (ljust,
  rjust, center).

* string.c (str_encoding): get encoding attribute from a string. 

* re.c (rb_reg_initialize): encoding aware regular expression

* sprintf.c (rb_str_format): formatting (i.e. length count) based
  on characters.

* io.c (rb_io_getc): getc to return one-character string.
  for older behavior, getbyte method added.

* ext/stringio/stringio.c (strio_getc): ditto.

* io.c (rb_io_ungetc): allow pushing arbitrary string at the
  current reading point.

* ext/stringio/stringio.c (strio_ungetc): ditto.

* ext/strscan/strscan.c: encoding support.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25 03:29:39 +00:00
matz 901343a761 * enumerator.c (enumerator_next): stop pre-fetching.
* enumerator.c (Init_Enumerator): remove next? method.

* eval.c (rb_f_loop): now handles StopIteration exception.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-24 10:48:43 +00:00
matz 99ab1fed49 * eval.c (rb_f_send_bang): abandon the name funcall for private
aware method call.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-24 08:15:37 +00:00
ko1 42cf6ee753 * eval.c: $! should not be writable.
* eval.c (rb_rubylevel_errinfo): added.  rb_errinfo() returns
  rb_threa_t#errinfo.  rb_rubylevel_errinfo() returns $! value.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 04:26:48 +00:00
nobu 69dd06ae68 * eval.c (frame_func_id): return proper method ID.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-17 16:12:03 +00:00
ko1 b982cff67c * eval.c (rb_call), eval_method.ci (rb_add_method, rb_alias),
insnhelper.ci (vm_call_method): fix to save safelevel for
  method node.
* include/ruby/node.h: ditto.
* bootstraptest/test_method.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-17 12:25:47 +00:00
ko1 14c3aa52ae * proc.c (Init_Proc), eval.c (Init_eval), eval_intern.h: move
init place of exception_error.
* inits.c: ditto.
* eval.c (Init_eval): set exception_error#throwed_state as TAG_FATAL.
  [ruby-dev:31407]
* bootstraptest/test_exception.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-14 10:53:53 +00:00
nobu f5da26fc34 * eval.c (rb_clear_trace_func, rb_thread_stop_timer_thread):
declarations for forward refernces.

* eval.c (rb_longjmp, eval): use local variable.

* eval.c (rb_longjmp): string object not to be optimized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-13 08:23:12 +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 bc1e2ab306 * eval.c, insnhelper.ci, vm.c: change cref index (-1 -> 2).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-10 10:22:30 +00:00
ko1 3ead5dcfb4 * eval.c (exec_under): add proper casts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-10 09:52:21 +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 b2d827cc5b * eval.c (rb_interrupt): suppress a gcc's officious warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-06 06:21:27 +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 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 4bdb5ced9a * gc.h: add RUBY_ prefix to debug macros.
* cont.c, proc.c, yarvcore.c,
* gc.c: define ruby_gc_debug_indent variable to debug mark/free.
* vm.c, insnhelper.ci: rename some functions to vm_* or rb_vm_*.
  move some functions, definitions, declarations to suitable files.
* eval.c, yarvcore.h, eval_error.ci, insnhelper.ci: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-25 02:44:20 +00:00
ko1 f58eb1e276 * eval.c: remove ruby_current_node and change eval() prototype.
fix to use rb_sourcefile/line() instead of ruby_sourcefile/line.
* error.c, eval_error.ci, eval_load.c, eval_safe.ci, gc.c,
  include/ruby/intern.h, parse.y, process.c, ruby.c: ditto.
* vm.c: fix spaces.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24 20:33:04 +00:00
ko1 6bd0345627 * eval_*.h: rename to eval_*.ci.
* common.mk: ditto.
* eval_error.ci: remove ruby_set_current_source().
* error.c, eval.c, ruby.c: ditto.
* eval_safe.c, proc.c: remove unused macros.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-24 19:23:24 +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
nobu 31345380ac * eval.c (ruby_cleanup): return EXIT_FAILURE if any exceptions occured
in at_exit blocks.  [ruby-core:11263]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-18 04:52:59 +00:00
akr a03d4a0635 * eval.c (rb_method_missing): avoid an warning "too many arguments
for format string" on "./ruby -ve 'def m() super end; m'".


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-17 02:12:14 +00:00
ko1 70df6311af * eval.c (ruby_finalize_1): rb_thread_t#errinfo should be clear with
Qnil.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-15 03:22:51 +00:00
ko1 ed88975237 * eval_intern.h, eval.c (ruby_init): remove POP_TAG_INIT().
* cont.c (rb_fiber_start): remove zero-clearing tag.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-06 16:04:02 +00:00
ko1 bf544c05d2 * eval.c (rb_yield): fix to check Qundef.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-06 01:57:36 +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 87e215b55d * eval.c (rb_eval_cmd): just return if no exceptions.
[ruby-dev:30820]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-29 19:17:18 +00:00
ko1 57062d91b9 * cont.c: support Fiber. Check test/ruby/test_fiber.rb for detail.
Fiber is known as "Micro Thread", "Coroutine", and other terms.
  At this time, only Fiber#pass is supported to change context.
  I want to know more suitable method name/API for Fiber (... do you
  know more suitable class name instead of Fiber?) as "suspend/resume",
  "call", "yield", "start/kick/stop/restart", ....
* eval.c, eval_intern.h, thread.c, yarvcore.c, yarvcore.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-27 19:12:43 +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 e4aa7208e5 * cont.c: check across trap violation.
* eval.c, yarvcore.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-24 03:08:13 +00:00
nobu 354844be45 * eval_intern.h (PUSH_TAG): no argument now.
* eval.c, eval_error.h, eval_jump.h, eval_load.c, proc.c, thread.c:
  ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-25 01:35:13 +00:00
nobu e110a86cc5 * eval.c (ruby_cleanup): inversed the order of errinfos.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-20 06:48:23 +00:00
nobu cc1757bce8 * eval.c (ruby_cleanup): fixed access to out of bound, and inversed
the order of errinfos.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-20 03:20:44 +00:00
nobu 3fc37d71c4 * eval.c (ruby_cleanup): re-send signal. [ruby-dev:30516]
* eval_error.h (error_handle): no message when exiting by signal.

* intern.h (rb_thread_signal_raise, ruby_default_signal): prototypes.

* signal.c (esignal_init): takes a signal number and an optional
  signal name.

* signal.c (interrupt_init): pass SIGINT always.

* signal.c (ruby_default_signal): invoke system default signal
  handler.

* signal.c (rb_f_kill): use NUM2PIDT instead of NUM2INT.

* signal.c (rb_signal_exec, trap): handle SIGTERM.  [ruby-dev:30505]

* thread.c (rb_thread_signal_raise): now takes signal number instead
  of signal name.

* thread.c (rb_thread_signal_exit): since rb_make_exception() calls
  #exception method, rb_class_new_instance() is not needed here.

* yarvcore.h (struct rb_vm_struct), eval_jump.h (terminate_process):
  exit_code is no longer stored in VM.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-19 17:37:03 +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 e0943c481a * eval.c (rb_rescue2): restore cfp ([ruby-dev:30582]).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-12 08:13:20 +00:00
ko1 cc3871f9dc * eval.c (rb_protect): restore cfp ([ruby-dev:30671]).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-12 07:08:28 +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
usa 315f27836f * eval.c: just minor changes (rdoc).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-20 07:35:57 +00:00
matz edec8b39f9 * eval.c (rb_f_callee_name): add __method__ and __callee__ again.
__callee__ need to rework to adopt YARV.  [ruby-core:10671]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-20 07:21:37 +00:00
ko1 8a1b1c2b41 * yarvcore.h, vm.h: rename th_invoke_yield() to th_yield().
* blockinlining.c: ditto.
* eval.c: ditto.
* vm.c, insns.def: rename th_invoke_yield_cfunc()
  to th_yield_with_cfunc().
* yarvcore.h, yarvcore.c: rename theYarvVM to ruby_current_vm and
  yarvCurrentThread to ruby_current_thread.  remove yarvVMArray.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-26 22:51:33 +00:00
ko1 9987d53e51 * yarvcore.h: add rb_thread_t#top_wrapper, top_self.
* eval_load.c (rb_load): support eval in wrapper module
  (load(file, true)).
* eval.c: ditto.
* eval_jump.h: ditto.
* iseq.c: ditto.
* vm.c: ditto.
* yarvcore.c: ditto.
* insns.def: add a empty line.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-25 16:29:26 +00:00
ko1 71986ef6bc * yarvcore.h:
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-25 01:34:33 +00:00
ko1 90a192865a * eval.c, vm.c, yarvcore.h: move definition of rb_call_super() to
vm.c from eval.c.  change th_call_super() to static function.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-20 06:16:04 +00:00
ko1 9c574383a4 * blockinlining.c, error.c, eval.c, eval_error.h, eval_intern.h,
eval_jump.h, eval_load.c, eval_safe.h, gc.c, proc.c, signal.c,
  thread.c, thread_pthread.ci, thread_win32.ci, vm.c, vm.h,
  vm_dump.c, vm_evalbody.ci, yarvcore.c, yarvcore.h:
  fix typo (rb_thead_t -> rb_thread_t).

* eval_intern.h: remove unused definitions.

* common.mk: fix around vm_opts.h path
  and remove harmful argument passed to insns2vm.rb.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-08 06:37:46 +00:00
nobu 522f948a0c * eval.c (specific_eval): suppress warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-07 14:25:47 +00:00
ko1 4042176a99 * eval.c: fixed to use ANSI function style.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-07 13:34:18 +00:00
ko1 44aef0b53f * this commit is a result of refactoring. only renaming functions,
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-07 01:25:05 +00:00
ko1 8ee7d0767f * blockinlining.c, compile.c, compile.h, error.c, eval.c,
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 19:00:03 +00:00
matz cbee6e017d * eval.c (rb_frame_callee): check if prev_cfp can be accessible.
a patch from Yoshinori Sano <yoshinori.sano at gmail.com> in
  [ruby-dev:30252].  solves [ruby-dev:30200] and [ruby-core:9856].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-04 19:12:52 +00:00
nobu 205f310c29 * call_cfunc.ci, compile.c, compile.h, debug.h, eval.c,
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 16:26:04 +00:00
matz 0cd337b1f0 * eval.c: remove duplicated global variables rb_cProc and
rb_cBinding.  [ruby-dev:30242]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-02 09:32:28 +00:00
ko1 dbee678630 * some refactoring around yarvcore and proc.
* 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-17 08:48:52 +00:00
ko1 ce55b4c0e0 * insns.def : support direct method dispatch with "send" or "funcall".
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
2007-01-06 00:24:59 +00:00
ko1 ed9d4087f6 * compile.c, compile.h : add ADD_CALL_RECEIVER() macro.
* insns.def (send) : use GET_SELF() direct if FCALL.
* eval.c (rb_f_send) : check method dispatch type to permit
  nvoking private method when dispatch type is FCALL/VCALL
* insns.def (opt_ltlt) : remove useless statement.
* vm.h : remove unused macros.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-01-05 12:00:08 +00:00
ko1 a3e1b1ce7e * Merge YARV
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-31 15:02:22 +00:00
nobu a7784d0048 * eval.c (ruby_cleanup): keep the exception till after END blocks.
[ruby-core:09675]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-09 12:40:17 +00:00
nobu f4aca06c84 * intern.h, object.c, variable.c (rb_mod_constants): added an optional
flag to search ancestors, which is defaulted to true, as well as
  const_defined? and const_get.  [ruby-dev:29989]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-12-04 15:19:33 +00:00
matz bd580c4855 * eval.c (formal_assign): need to pack rest arg information in
argc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-07 09:38:12 +00:00
matz 568602aeea * eval.c (method_missing): update old argument adjustment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-07 08:51:15 +00:00
matz f54e979d36 * eval.c (when_check): need to splat for NODE_ARGSCAT as well.
[ruby-dev:29860]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-07 07:45:57 +00:00
matz 862e723d03 * eval.c (svalue_to_avalue): need to splat but no error.
* eval.c: new macros - YIELD_CALL, YIELD_VALUES.

* eval.c (rb_yield_values): specify YIELD_VALUES.

* eval.c (rb_yield_0): use new macros.

* eval.c (proc_invoke): slightly modified to separate YIELD_CALL
  and YIELD_VALUES from YIELD_ARY_ARGS.

* object.c (Init_Object): add nil.to_splat => [].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-06 10:27:59 +00:00
matz 07c4bb10e0 * eval.c (rb_call0): fixed bug of zsuper with both of opt and rest.
fixed: [ruby-list:42928]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-02 04:44:52 +00:00
matz 76f721470b * eval.c (rb_obj_define_method): add half boiled RDoc document.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-11 08:12:17 +00:00
matz bd62057a8b * eval.c (rb_obj_define_method): add new method
Kernel#define_singleton_method.  [ruby-list:42851]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-09 13:46:56 +00:00
matz b067aef7c0 * eval.c (formal_assign): packed post splat arguments may conflict
with normal arguments.  [ruby-core:09021]

* eval.c (rb_call0): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-07 14:35:19 +00:00
matz 2d09685150 * eval.c (rb_yield_0): small refactoring.
* parse.y (bparam_item): fixed bugs in handling parenthesized LHS.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-05 22:32:04 +00:00
matz feafc46363 * eval.c (rb_call): check protected visibility based on real self,
not ruby_frame->self.  [ruby-talk:217822]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-04 08:38:23 +00:00
matz 9317700a5d * eval.c (splat_value): use "to_splat" instead of "to_ary" to
prepare splat values as an array.

* array.c (Init_Array): define to_splat.

* range.c (range_to_splat): new method.

* enumerator.c (enumerator_to_splat): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-02 17:39:57 +00:00
why dcb6131f78 * eval.c (rb_thread_save_context, rb_thread_restore_context):
sandbox hook to save and restore sandbox state.

* eval.c (thread_no_ensure): added THREAD_NO_ENSURE thread flag.

* eval.c (rb_thread_kill_bang): Thread#kill! uses the above flag
  to circumvent ensure, in order to prevent endless loops.
  contributed by MenTaLguY. [ruby-core:08768]

* eval.c (rb_thread_kill): fix Thread#kill docs, which returns
  the thread object in all cases.

* node.h: expose the rb_jmpbuf_t and rb_thread_t structs, along
  with the thread flags.  used by the sandbox extension.

* ruby.h: extern rb_eThreadError, so sandbox can swap it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-23 21:29:47 +00:00
matz 749df1d0fd * dir.c (dir_s_glob): remove unused variable.
* math.c (math_log): ditto.

* re.c (rb_reg_regcomp): ditto.

* eval.c (break_jump): ditto.

* eval.c (rb_thread_yield_0): remove unused function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-18 01:59:00 +00:00
nobu 36e79167ab * eval.c (rb_require_safe): prevent extension from loading twice.
fixed: [ruby-dev:29523]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-10 00:18:39 +00:00
matz b4afac07bc * eval.c (rb_f_local_variables): list symbols.
* struct.c (rb_struct_s_members_m): ditto.

* variable.c (ivar_i): ditto.

* variable.c (gvar_i): ditto.

* variable.c (cv_i): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 05:46:47 +00:00
matz 2156870525 * ruby.h (struct RArray): embed small arrays.
(RARRAY_LEN): defined for accessing array members.
  (RARRAY_PTR): ditto.

* array.c: use RARRAY_LEN and RARRAY_PTR.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-02 14:42:08 +00:00
matz 8581164ea6 * eval.c (rb_eval): should handle when in else clause. a patch
from Eric Hodel <drbrain at segment7.net>.  [ruby-core:08662]

* parse.y (primary): wrap with NODE_CASE.  [ruby-core:08663]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-02 14:36:22 +00:00
usa 974037a542 * eval.c (search_required): use RSTRING_PTR and RSTRING_STR.
* object.c (nil_plus): ditto.

* ext/dl/cptr.c (rb_dlptr_s_to_ptr): ditto.

* ext/openssl/ossl_x509ext.c (ossl_x509extfactory_create_ext): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31 12:10:08 +00:00
matz 54af80844f * ruby.h (struct RString): embed small strings.
(RSTRING_LEN): defined for accessing string members.
  (RSTRING_PTR): ditto.

* string.c: use RSTRING_LEN and RSTRING_PTR.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31 10:47:44 +00:00
why a6487b236a * eval.c (ruby_init): rename top_cref to ruby_top_cref and export,
along with ruby_cref, for use by the sandbox. [ruby-core:08762]

* node.h: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31 04:14:53 +00:00
drbrain 657b626899 Revert.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-28 02:33:04 +00:00
drbrain 6e83a71d3b Include attribution
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-27 23:03:20 +00:00
akr 1f84a162df ansificated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-13 09:44:16 +00:00
matz 275f12623d * dln.c, eval.c, gc.c, ruby.h: shut up AIX alloca warning.
[ruby-dev:29191]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-07 03:37:47 +00:00
nobu 799a6bc67b * eval.c (rb_call0): trace call/return of method defined from block.
fixed: [ruby-core:08329]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-30 14:27:01 +00:00
nobu 782d8df4f5 * eval.c (rb_trap_eval): make the current thread runnable to deal with
exceptions which occurred within the trap.  fixed: [ruby-dev:27729]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-30 13:30:19 +00:00
matz 35526b1b00 * eval.c (rb_call): fixed typo in cache look-up. [ruby-dev:29167]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-28 05:10:03 +00:00
matz 94f9fc2b6e * eval.c (rb_call): a bug in method cache look-up.
http://www.rubyist.net/~matz/20060720.html#c04


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-28 01:43:10 +00:00
matz c0a8089044 * eval.c (Init_eval): rename #invoke_method and
#invoke_functional_method to __send and __send! respectively.

* eval.c (remove_method): prohibit removing __send and __send!.

* eval.c (rb_undef): prohibit undef'ing  __send and __send!.

* eval.c (rb_eval): prohibit redefining  __send and __send!.

* lib/delegate.rb (Delegator): preserve __send.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-26 09:40:05 +00:00
nobu c0e5d45a1e * eval.c (backtrace): porting miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-24 14:53:42 +00:00
nobu 2e7a8bf228 * eval.c (backtrace): skip frames successive on node and method name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-24 13:04:39 +00:00
matz 93d5566170 * eval.c (rb_call0): revert last change. [ruby-dev:29112]
[ruby-core:08374]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-24 07:02:20 +00:00
nobu 252d273832 * eval.c (rb_call0): include funcalled methods in caller list.
fixed: [ruby-core:08290]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-21 12:22:08 +00:00
matz 58f09b0916 * eval.c (rb_call): try local method look-up first for fcall, then
normal method look-up.  [ruby-talk:202564]

* eval.c (rb_get_method_body): save local method cache separately.

* eval.c (search_method): export info whether method is local or
  not.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-20 19:20:31 +00:00
matz cb3e51e712 * eval.c (rb_yield_0): should check args_args before lambda
argument check.  [ruby-dev:29029]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-19 13:52:03 +00:00
matz 7318a6db76 * eval.c (yield_under_i): argument should be passed in avalue
from.  [ruby-dev:29044]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-18 07:54:26 +00:00
akr b3fd4cf833 // comment removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-15 02:38:26 +00:00
matz ead9b197be * parse.y (f_args): allow post mandatory arguments after optional
arguments.  [ruby-dev:29014]

* parse.y (new_args_gen): allow post_args without rest_args.

* eval.c (formal_assign): ditto.

* parse.y (new_args_gen): check post argument duplication.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-12 11:10:22 +00:00
matz 1db0db3ba0 * bignum.c (rb_int2big): use SIGNED_VALUE. [ruby-dev:29019]
* bignum.c (rb_int2inum, rb_uint2inum): use VALUE sized integer.

* bignum.c (rb_big2long, rb_big2ulong): ditto.

* numeric.c (rb_num2long, rb_num2ulong): ditto.

* numeric.c (check_int, check_uint): ditto.

* bignum.c (rb_quad_pack): typo fixed.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-11 06:47:09 +00:00
akr 599de8d7f1 remove an unused label and variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-11 00:26:15 +00:00
matz c4ad5309f9 * eval.c (rb_call): remove erroneously restored prot_tag->blkid
initialization.  [ruby-dev:28997]  [ruby-dev:29000]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-10 05:48:10 +00:00
matz 672549bb47 * eval.c (proc_invoke): should not overwrite block information in
current frame.  [ruby-dev:28957]

* eval.c (rb_yield_0): retrieve proper block object from the frame
  record.

* eval.c (proc_alloc): return preserved block object if it's
  available.

* st.h (st_data_t): use pointer sized integer for st_data_t.
  [ruby-dev:28988]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-10 01:08:15 +00:00
nobu 4696270c72 * eval.c (rb_clear_cache_for_remove): clear entries for included
module.  fixed: [ruby-core:08180]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-10 00:29:43 +00:00
nobu b922355c0d * eval.c (next_jump): deal with destination of next.
fixed: [ruby-core:08169]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-08 15:55:37 +00:00
matz 6243e40920 * eval.c (rb_call): should not set prot_tag->blkid since it would
never catch breaks at this level.  [ruby-dev:28922]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-04 06:22:11 +00:00
matz bb0687f680 * eval.c (PUSH_FRAME): initialize frame->self. [ruby-dev:28911]
* configure.in: should test isinf for Solaris with GCC compiler.
  a patch from <ville.mattila at stonesoft.com>.  [ruby-core:07791]

* configure.in: -shared patch from Andrew Morrow
  <andrew.c.morrow at gmail.com>.  [ruby-core:08100]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-01 16:40:13 +00:00
matz 4df2cb8053 * parse.y: use ARGSPUSH instead of ARGSCAT to prevent too much
splat expansion.

* eval.c (when_check): need to handle ARGSPUSH as well.

* eval.c (block_orphan): lambda and proc from method are always
  orphan.

* gc.c (gc_mark_children): proper marking for NODE_BLOCK_PASS and
  NODE_LAMBDA.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-29 14:05:40 +00:00
akr d7ac2f0cd2 * eval.c (SETUP_ARGS0): avoid GC problem.
[ruby-dev:28902]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-29 13:49:23 +00:00
nobu ab15a714f8 * eval.c (when_check): arbitrary values are allowed after splats.
fixed: [ruby-dev:28879]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-28 04:51:27 +00:00
matz c7d9ba96cb * eval.c (rb_eval): problem to handle else part. [ruby-dev:28873]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-27 23:13:20 +00:00
matz 4a497026b6 * eval.c (rb_eval): support splat in when expression list.
[ruby-dev:28822]

* eval.c (when_check): a new auxiliary function for case match.

* eval.c (when_cond): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-27 16:51:08 +00:00
matz 471e41ec70 * string.c: RDoc update for =~ method. a patch from Alex Young
<alex at blackkettle.org>.  [ruby-core:08068]

* io.c (pipe_open): backout unnecessary fix on 2006-06-26.
  [ruby-dev:28865]

* eval.c (rb_yield_0): exact argument number check now done only
  for lambda Proc.

* eval.c (rb_yield_0): add check for number of arguments, if
  there's one lambda block parameter.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-27 14:14:25 +00:00
akr 8ae45d642f * eval.c (rb_yield_0): avoid core dump. [ruby-dev:28840]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-27 01:48:29 +00:00
nobu 61f3ff8d78 * eval.c (call_trace_func): no check for argument number of the
callback.  fixed: [ruby-dev:28812]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-26 14:43:06 +00:00
akr bb87f28346 * eval.c (rb_eval): use rb_ary_new2 instead of rb_ary_new4 to avoid
GC problem.
  (rb_yield_values): use rb_ary_new2 instead of rb_ary_new4.

* array.c (rb_ary_new4): don't set len as n.  make it safe with GC.

  [ruby-dev:28826]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-24 14:52:59 +00:00
nobu ac9910e727 * eval.c (rb_block_pass): removed.
* eval.c (rb_thread_start_1): use rb_proc_yield() instead of
  rb_block_pass().  fixed: [ruby-dev:28794]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-23 08:28:04 +00:00
matz 2ca2a4a43b * parse.y (block_param): do not use multiple assignment for a sole
block parameter.  [ruby-dev:28710]

* eval.c (rb_yield_0): pass a raw yielded value to a sole block
  parameter if a value is passed by yield.

* eval.c (proc_invoke): args may not be an array.

* eval.c (rb_proc_yield): pass original value without wrapping
  it in an array.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-21 08:08:36 +00:00
matz 1b7465e893 * eval.c, file.c, etc.: code-cleanup patch from Stefan Huehner
<stefan at huehner.org>.  [ruby-core:08029]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-20 18:02:17 +00:00
matz 3be20019c1 * eval.c (proc_invoke): intercept break and return from lambda
Proc objects.  [ruby-dev:28742]

* eval.c (proc_invoke): remove unnecessary YIELD_PROC_CALL flag.

* eval.c (YIELD_EXACT_ARGS): renamed from YIELD_LAMBDA_CALL, which
  is no longer related to the behavior turned on by this flag.

* eval.c (return_jump): no need to care about PROT_YIELD.

* eval.c (break_jump): no jump to toplevel PROT_TREAD tag.

* eval.c (rb_yield_0): fix confusion between lambda (which is a
  property of a proc) and pcall (which depends on whether it's
  called via yield or call).

* eval.c (rb_thread_yield): no need to specify YIELD_LAMBDA_CALL.

* eval.c (rb_block_pass): update blkid in prot_tag.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-20 06:09:04 +00:00
matz 7b48490222 * eval.c (Init_eval): add aliases invoke_method and
invoke_functional_method corresponding send and funcall
  respectively.  [ruby-talk:197512]

* parse.y (parser_yylex): returns the most typical keyword token
  on EXPR_FNAME.  [ruby-core:7995]

* ext/socket/socket.c: protoize.

* parse.y (then): remove ':' from 'then' and 'do' rules.

* hash.c (env_aset): raise TypeError on nil with more descriptive
  message.  [ruby-core:07990]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-17 14:50:04 +00:00
nobu e0648d6cf5 * eval.c (rb_proc_arity): get rid of segfault for mere splat.
* gc.c (gc_mark_children): NODE_BLOCK_PASS needs u3 to be marked.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-15 16:41:28 +00:00
usa 96c4899738 * eval.c (rb_f_method_name, rb_f_callee_name): document typo.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-14 07:13:27 +00:00
matz 5a712cfb8c * ext/socket/socket.c (Init_socket): remove obsolete constants:
IPsocket, TCPsocket, SOCKSsocket, TCPserver, UDPsocket,
  UNIXsocket, UNIXserver.

* eval.c (formal_assign): post splat arguments should have had
  higher priority than optional arguments, since they are
  mandatory.  [ruby-dev:28715]

* eval.c (VIS_MASK): broken. should be 15.  [ruby-dev:28715]

* io.c (argf_getc): should return one-character string.
  [ruby-dev:28715]

* io.c (rb_io_readchar): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-13 11:31:27 +00:00
usa c053ad38cf * commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 06:17:11 +00:00
usa d1a664a464 * eval.c (rb_f_method_name, rb_f_callee_name): new functions.
new global method `__method__' and `__callee__'.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-10 06:15:02 +00:00
usa 4b731d3bc9 * eval.c (CALLARGS): remove last semicolon. C90 compiler doesn't
allow any lines (even if they're empty) within variable
  declaretions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 21:56:59 +00:00
matz 9b383bd6cf * sprintf.c (rb_str_format): allow %c to print one character
string (e.g. ?x).

* lib/tempfile.rb (Tempfile::make_tmpname): put dot between
  basename and pid.  [ruby-talk:196272]
* parse.y (do_block): remove -> style block.

* parse.y (parser_yylex): remove tLAMBDA_ARG.

* eval.c (rb_call0): binding for the return event hook should have
  consistent scope.  [ruby-core:07928]

* eval.c (proc_invoke): return behavior should depend whether it
  is surrounded by a lambda or a mere block.

* eval.c (formal_assign): handles post splat arguments.

* eval.c (rb_call0): ditto.

* st.c (strhash): use FNV-1a hash.

* parse.y (parser_yylex): removed experimental ';;' terminator.

* eval.c (rb_node_arity): should be aware of post splat arguments.

* eval.c (rb_proc_arity): ditto.

* parse.y (f_args): syntax rule enhanced to support arguments
  after the splat.

* parse.y (block_param): ditto for block parameters.

* parse.y (f_post_arg): mandatory formal arguments after the splat
  argument.

* parse.y (new_args_gen): generate nodes for mandatory formal
  arguments after the splat argument.

* eval.c (rb_eval): dispatch mandatory formal arguments after the
  splat argument.

* parse.y (args): allow more than one splat in the argument list.

* parse.y (method_call): allow aref [] to accept all kind of
  method argument, including assocs, splat, and block argument.

* eval.c (SETUP_ARGS0): prepare block argument as well.

* lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931]

* eval.c (error_line): print receivers true/false/nil specially.

* eval.c (rb_proc_yield): handles parameters in yield semantics.

* eval.c (nil_yield): gives LocalJumpError to denote no block
  error.

* io.c (rb_io_getc): now takes one-character string.

* string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo
  hashing algorithm.

* string.c (rb_str_aref): str[0] now returns 1 character string,
  instead of a fixnum.	[Ruby2]

* parse.y (parser_yylex): ?c now returns 1 character string,
  instead of a fixnum.	[Ruby2]

* string.c (rb_str_aset): no longer support fixnum insertion.

* eval.c (umethod_bind): should not update original class.
  [ruby-dev:28636]

* eval.c (ev_const_get): should support constant access from
  within instance_eval().  [ruby-dev:28327]

* time.c (time_timeval): should round for usec floating
  number.  [ruby-core:07896]

* time.c (time_add): ditto.

* dir.c (sys_warning): should not call a vararg function
  rb_sys_warning() indirectly.	[ruby-core:07886]

* numeric.c (flo_divmod): the first element of Float#divmod should
  be an integer. [ruby-dev:28589]

* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.

* re.c (rb_reg_initialize): should not allow modifying literal
  regexps.  frozen check moved from rb_reg_initialize_m as well.

* re.c (rb_reg_initialize): should not modify untainted objects in
  safe levels higher than 3.

* re.c (rb_memcmp): type change from char* to const void*.

* dir.c (dir_close): should not close untainted dir stream.

* dir.c (GetDIR): add tainted/frozen check for each dir operation.

* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg):
  typo fixed.  a patch from Florian Gross <florg at florg.net>.

* eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from
  event_hooks.	no guarantee for arbitrary hook deletion.
  [ruby-dev:28632]

* util.c (ruby_strtod): differ addition to minimize error.
  [ruby-dev:28619]

* util.c (ruby_strtod): should not raise ERANGE when the input
  string does not have any digits.  [ruby-dev:28629]

* eval.c (proc_invoke): should restore old ruby_frame->block.
  thanks to ts <decoux at moulon.inra.fr>.  [ruby-core:07833]
  also fix [ruby-dev:28614] as well.

* signal.c (trap): sig should be less then NSIG.  Coverity found
  this bug.  a patch from Kevin Tew <tewk at tewk.com>.
  [ruby-core:07823]

* math.c (math_log2): add new method inspired by
  [ruby-talk:191237].

* math.c (math_log): add optional base argument to Math::log().
  [ruby-talk:191308]

* ext/syck/emitter.c (syck_scan_scalar): avoid accessing
  uninitialized array element.	a patch from Pat Eyler
  <rubypate at gmail.com>.  [ruby-core:07809]

* array.c (rb_ary_fill): initialize local variables first.  a
  patch from Pat Eyler <rubypate at gmail.com>.	 [ruby-core:07810]

* ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free
  type_tag.  a patch from Pat Eyler <rubypate at gmail.com>.
  [ruby-core:07808]

* ext/socket/socket.c (make_hostent_internal): accept ai_family
  check from Sam Roberts <sroberts at uniserve.com>.
  [ruby-core:07691]

* util.c (ruby_strtod): should not cut off 18 digits for no
  reason.  [ruby-core:07796]

* array.c (rb_ary_fill): internalize local variable "beg" to
  pacify Coverity.  [ruby-core:07770]

* pack.c (pack_unpack): now supports CRLF newlines.  a patch from
  <tommy at tmtm.org>.	[ruby-dev:28601]

* applied code clean-up patch from Stefan Huehner
  <stefan at huehner.org>.  [ruby-core:07764]

* lib/jcode.rb (String::tr_s): should have translated non
  squeezing character sequence (i.e. a character) as well.  thanks
  to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090]

* ext/socket/socket.c: document update patch from Sam Roberts
  <sroberts at uniserve.com>.  [ruby-core:07701]

* lib/mathn.rb (Integer): need not to remove gcd2.  a patch from
  NARUSE, Yui <naruse at airemix.com>.	[ruby-dev:28570]

* parse.y (arg): too much NEW_LIST()

* eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen.

* eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1.
  [ruby-dev:28585]

* parse.y (arg): use NODE_ARGSCAT for placeholder.

* lib/getoptlong.rb (GetoptLong::get): RDoc update patch from
  mathew <meta at pobox.com>.  [ruby-core:07738]

* variable.c (rb_const_set): raise error when no target klass is
  supplied.  [ruby-dev:28582]

* prec.c (prec_prec_f): documentation patch from
  <gerardo.santana at gmail.com>.  [ruby-core:07689]

* bignum.c (rb_big_pow): second operand may be too big even if
  it's a Fixnum.  [ruby-talk:187984]

* README.EXT: update symbol description.  [ruby-talk:188104]

* COPYING: explicitly note GPLv2.  [ruby-talk:187922]

* parse.y: remove some obsolete syntax rules (unparenthesized
  method calls in argument list).

* eval.c (rb_call0): insecure calling should be checked for non
  NODE_SCOPE method invocations too.

* eval.c (rb_alias): should preserve the current safe level as
  well as method definition.

* process.c (rb_f_sleep): remove RDoc description about SIGALRM
  which is not valid on the current implementation. [ruby-dev:28464]

 Thu Mar 23 21:40:47 2006  K.Kosako  <sndgk393 AT ybb.ne.jp>

* eval.c (method_missing): should support argument splat in
  super.  a bug in combination of super, splat and
  method_missing.  [ruby-talk:185438]

* configure.in: Solaris SunPro compiler -rapth patch from
  <kuwa at labs.fujitsu.com>.  [ruby-dev:28443]

* configure.in: remove enable_rpath=no for Solaris.
  [ruby-dev:28440]

* ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior
  of converting  OLE Variant object with VT_ARRAY|VT_UI1 and Ruby
  String object.

* ruby.1: a clarification patch from David Lutterkort
  <dlutter at redhat.com>.  [ruby-core:7508]

* lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems
  directories.	a patch from Eric Hodel <drbrain at segment7.net>.
  [ruby-core:07423]

* eval.c (rb_clear_cache_by_class): clearing wrong cache.

* ext/extmk.rb: use :remove_destination to install extension libraries
  to avoid SEGV.  [ruby-dev:28417]

* eval.c (rb_thread_fd_writable): should not re-schedule output
  from KILLED thread (must be error printing).

* array.c (rb_ary_flatten_bang): allow specifying recursion
  level.  [ruby-talk:182170]

* array.c (rb_ary_flatten): ditto.

* gc.c (add_heap): a heap_slots may overflow.  a patch from Stefan
  Weil <weil at mail.berlios.de>.

* eval.c (rb_call): use separate cache for fcall/vcall
  invocation.

* eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local
  functions.

* eval.c (rb_mod_local): a new method to specify newly added
  visibility "local".

* eval.c (search_method): search for local methods which are
  visible only from the current class.

* class.c (rb_class_local_methods): a method to list local methods.

* object.c (Init_Object): add BasicObject class as a top level
  BlankSlate class.

* ruby.h (SYM2ID): should not cast to signed long.
  [ruby-core:07414]

* class.c (rb_include_module): allow module duplication.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-09 21:20:17 +00:00
nobu e0337774ed * eval.c (proc_invoke): save and restore block in the current frame.
fixed: [ruby-core:07833], [ruby-talk:191639]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-27 13:45:47 +00:00
ocean c8e364cc28 * eval.c (SETUP_ARGS0): fixed memory corruption. [ruby-dev:28360]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-23 04:24:39 +00:00
matz e94633b9b2 * eval.c (proc_alloc): add proper check for creation of a lambda
without a block.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-22 00:27:27 +00:00
matz a25ab42137 * eval.c: initial value for block_unique must be 1.
[ruby-talk:180420]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-20 00:53:57 +00:00
matz b070abfc20 * eval.c (rb_obj_instance_eval): RDoc description updated. a
patch from Ozgur Murat Homurlu <ozgurmurath at gmail.com>.
  [ruby-core:07381]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-18 12:18:27 +00:00
matz d16c035975 * variable.c (rb_const_get_0): skip ruby_wrapper in const search
to give it lower priority (just above Object).  need not to
  change rb_const_defined_0() since it's only a precedence matter;
  they are defined anyway.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-17 16:08:08 +00:00
matz ccf99b9ce6 * eval.c (ev_const_get): simplified using rb_const_get_fallback().
* eval.c (ev_const_defined): adopt to ev_const_get() using
  rb_const_defined_fallback().

* variable.c (rb_const_get_fallback): new function to implement
  constant search.

* variable.c (rb_const_defined_fallback): new function to
  implement constant definition check.

* variable.c (rb_const_get_0): adopt to new behavior.  constants
  are looked up in the order of: current class, super classes (but
  Object), lexically external classes/modules, and Object.

* variable.c (rb_const_defined_0): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-17 08:40:52 +00:00
matz 4839151263 * eval.c (rb_thread_wait_for): sleep should always sleep for
specified amount of time.  [ruby-talk:180067]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-17 01:06:48 +00:00
matz 8f5278b525 * eval.c (rb_eval): NODE_OP_ASGN1 should allow splat in its
argument list.  [ruby-core:07366]

* parse.y (arg): avoid unnecessary extra argument.
  [ruby-core:07366]

* eval.c (rb_eval): honor visibility on OP_ASGN1 and
  OP_ASGN2. [ruby-core:07366]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-15 08:46:55 +00:00
matz a95a1eff20 * eval.c (error_line): remove void control path. [ruby-dev:28335]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-15 06:22:13 +00:00
matz 7d863d5c97 * eval.c (yield_under_i): should not pass self as an argument to
the block for instance_eval.  [ruby-core:07364]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-15 01:24:20 +00:00
matz c3f5a736a8 * eval.c (rb_obj_instance_eval): should no singleton classes for
true, false, and nil.  [ruby-dev:28186]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-15 00:26:14 +00:00