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

9675 Коммитов

Автор SHA1 Сообщение Дата
nobu 271aaf297e * hash.c (rb_hash_clear): use st_clear() unless iterating.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-21 04:47:01 +00:00
nobu be4fc7941b * st.c (struct st_table_entry): add new members, fore and back, to
iterate in inserted order.

* include/ruby/st.h (struct st_table): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-21 04:43:51 +00:00
ko1 c629aecbc8 * benchmark/bm_vm2_case.rb: add a new benchmark.
YARV optimize case/when syntax.  If every conditions
  are literal (such as Symbol, Fixnum, String), dispatch
  calc order will be O(1).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 19:11:20 +00:00
ko1 3fffbe1e82 * test/ruby/test_enumerator.rb: fix last commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 19:09:03 +00:00
ko1 2d3724e058 * test_enumerator.rb (enum_test): fix to return sorted
array (for Hash test).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 19:00:27 +00:00
ko1 ad56f8c611 * enumerator.c (next_i): fix to return with Fiber#yield at
the end of each block.  [ruby-dev:31470]
* enumerator.c (enumerator_next_p): call init_next if not
  initialized.  [ruby-dev:31514]
* test/ruby/test_enumerator.rb: add tests for Enumerator.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 18:58:32 +00:00
matz 009debfd02 * io.c (rb_io_s_foreach): argument count check before making
Enumerator.  [ruby-dev:31525]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 14:46:03 +00:00
matz 5d51ae926b * dir.c (dir_foreach): return Enumerator if no block given.
[ruby-dev:31525]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 14:35:53 +00:00
matz b6449f6080 * string.c (Init_String): remove Symbol.intern and Symbol#dump.
[ruby-dev:31525]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 14:30:12 +00:00
nobu f2f08335df * vm_core.h (struct rb_thread_struct): removed first_func_arg and
reuse first_args instead.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20 14:17:16 +00:00
akr cf82149d21 Sentence.expand_syntax refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-19 15:43:04 +00:00
akr 1d23c250f0 * gc.c: use VALGRIND_MAKE_MEM_UNDEFINED to detect use of collected
objects if valgrind is available.  It cannot detect first 2 words 
  because they are used as the free list.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-19 04:34:44 +00:00
ko1 0a02ad5e2e * compile.c (iseq_compile_each/NODE_RESBODY): fix to add
additional nop to prevent tailcall optimization.
* vm_opts.h: clean up comments.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-19 04:16:13 +00:00
ko1 cd30220aff * insnhelper.ci (vm_call_bmethod): fix to propagate information
that this proc is "from Method".  [ruby-dev:31490]
* proc.c (method_proc, rb_mod_define_method): ditto.
* vm.c (vm_invoke_proc_core): removed.
* vm_core.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-19 04:02:21 +00:00
akr a854a4358f * test/ruby/sentence.rb: new method Sentence().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-19 03:37:14 +00:00
ko1 98e7aa679a * insnhelper.ci (vm_callee_setup_arg): fix to mark enough VM stack.
[ruby-dev:31492]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-19 03:35:39 +00:00
akr 9e5d0d861f sentence.rb documented.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 17:04:06 +00:00
akr 7017b63b81 * test/ruby/test_yield.rb (TestYieldGen): relax array size check
in nested parameters.
  [ruby-dev:31485]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 10:04:24 +00:00
nobu 0dec7d5788 * ext/tk/tcltklib.c (Init_tcltklib): use rb_set_end_proc().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 08:44:44 +00:00
nobu 6fc746d7e3 * thread.c (is_ruby_native_thread): check properly. [ruby-dev:31166]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 08:40:13 +00:00
ko1 2c5ae0eeba * insnhelper.ci (vm_call_bmethod),
vm.c (vm_invoke_proc_core): fix to do not restore
  $SAFE when proc invoked by bmethod.
* vm_core.h: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 07:48:28 +00:00
nobu 115a3d21e4 * eval_error.ci (ruby_error_print): call error_print.
* eval_jump.ci, process.c (rb_exit, rb_f_exit, rb_f_abort): moved.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 07:44:51 +00:00
nobu 6e0c6ac3be * process.c (detach_process_watcher): should not pass the pointer
to an auto variable to the thread to be created.  pointed and
  fix by KUBO Takehiro <kubo at jiubao.org>  [ruby-dev:30618]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 06:59:54 +00:00
nobu bade43f9d1 * insnhelper.ci (vm_send_optimize): use MEMMOVE to shift values inside
an array.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 06:52:51 +00:00
nobu d23abfc546 * insnhelper.ci (vm_yield_setup_args): rsize and psize should not be
negative.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 06:45:37 +00:00
akr 88e1fec393 lambda yield emulator refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 06:31:04 +00:00
nobu 65b0b08529 * lib/rexml/rexml.rb: added encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 06:12:48 +00:00
nobu e765f48428 * lib/rexml/rexml.rb: removed doubled constant.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 06:03:45 +00:00
nobu 2d9512edd9 * insnhelper.ci (vm_callee_setup_arg, vm_send_optimize,
vm_yield_setup_args): bulk copy for arguments.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 05:35:03 +00:00
nobu c2a41b3a71 * insnhelper.ci, string.c: fixed indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 05:11:49 +00:00
ko1 0c031468fe * compile.c (iseq_compile_each): fix to allow self.x=
if x= is private.
* bootstraptest/test_method.rb: add a test for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 05:07:07 +00:00
nobu 3f025d2078 * parse.y (reg_compile_gen): obtain error info from errinfo.
* re.c (rb_reg_error_desc): make RegexpError for initialization error.

* re.c (rb_reg_compile): return nil and set errinfo if error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 05:05:36 +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
ko1 2e83c555d8 * insnhelper.ci (vm_callee_setup_arg): fix to check arguments
correctly. [ruby-dev:31472]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 04:17:39 +00:00
ko1 f72409043c * bootstraptest/test_exception.rb: add escape character ("\") for
editors.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 04:14:31 +00:00
akr 4a6335717f add test for [ruby-dev:31472].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 03:47:03 +00:00
akr f62fff5f41 * test/ruby/test_yield.rb (TestYieldGen): add test for yielding to
lambda using lambda parameter passing emulator.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 03:44:28 +00:00
akr 6355e16257 fix Dir.mktmpdir doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 03:24:41 +00:00
nobu 54a3576eaa * sample/test.rb, test/ruby/test_system.rb(valid_syntax?): keep
comment lines first.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 03:24:32 +00:00
ko1 77cc5f2031 add ChangeLog entry.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 02:50:37 +00:00
ko1 4d3a58bc69 * compile.c (iseq_set_arguments), insnhelper.ci
(vm_callee_setup_arg, vm_yield_setup_args):
* bootstraptest/test_block.rb: add tests for above.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-18 02:48:13 +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 2c5463fe99 * compile.c (iseq_compile_each): massign should return rvalue(s).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-17 13:48:39 +00:00
ko1 ad272173cd * test/ruby/test_basicinstructions.rb: fix old tests.
class variables should be inherited.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-17 13:11:39 +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 e5d5f5a61a * thread.c (rb_thread_terminate_all): fix to ignore
exceptions.
* thread.c (thread_start_func_2): fix
  abort_on_exception process.  [ruby-dev:31394]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-17 07:24:03 +00:00
akr 82a9ca296b * bootstraptest/runner.rb (in_temporary_working_directory): use
Dir.mktmpdir to create and remove temporary directory.
  (Dir.mktmpdir): define if not available.
  [ruby-dev:31431]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-17 05:41:10 +00:00
matz 4675be9a65 ChangeLog: typo fixed. [ruby-dev:31439]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-16 22:24:45 +00:00
matz bef0b1fa36 * bignum.c (bigtrunc): RBIGNUM(x)->len may be zero. out of bound
access.  [ruby-dev:31404]

* sprintf.c (rb_str_format): small float should not call
  rb_dbl2big().

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-16 22:22:24 +00:00
ko1 04176dc21f * compile.c (iseq_compile_each): fix thorw insn option of next.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-16 18:12:02 +00:00