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

27717 Коммитов

Автор SHA1 Сообщение Дата
ktsj 811d072dcb * vm_trace.c (rb_threadptr_exec_event_hooks, rb_suppress_tracing):
constified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-21 10:14:29 +00:00
ktsj f21d7d9831 * vm_core.h (rb_vm_t::trace_running): add a new field
`trace_running' to store vm global tracing status.

* vm_trace.c: fix SEGV bug. event_hook was free'd
  even when the hook is still used in another thread.
  [ruby-dev:46141] [Bug #7032]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-21 10:14:26 +00:00
ktsj 93184600c8 * vm_core.h (rb_vm_t::trace_flag): remove `trace_flag'
which is no longer used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-21 10:14:24 +00:00
svn 9e3633dfad * 2012-10-21
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-21 09:41:31 +00:00
tadf 2cbb4481bd * ext/date/date_parse.c (date__parse): uses more tight parser if
defined TIGHT_PARSER.  now inactivated; because it introduces
	  incompatibilities and it is a bit slow.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-21 09:41:25 +00:00
eregon 0ef8222e63 * gc.c: fix typos in documentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-20 11:36:46 +00:00
nari c3a46d6aca * include/ruby/ruby.h: add C APIs.
VALUE rb_newobj_of(VALUE klass, VALUE flags)
  #define NEWOBJ_OF(obj,type,klass,flags)
  These allow to change a allocation strategy depending on klass
  or flags.

* gc.c: ditto

* array.c: use new C API.
* bignum.c: ditto
* class.c: ditto
* complex.c: ditto
* ext/socket/ancdata.c: ditto
* ext/socket/option.c: ditto
* hash.c: ditto
* io.c: ditto
* marshal.c: ditto
* numeric.c: ditto
* object.c: ditto
* random.c: ditto
* range.c: ditto
* rational.c: ditto
* re.c: ditto
* string.c: ditto
* struct.c: ditto
  [Feature #7177][Feature #7047]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-20 06:57:51 +00:00
zzak f1e488e524 * ext/socket/socket.c: Documentation for Socket
Based on a patch by David Albert
  [Bug #7105] [ruby-core:47828]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-20 03:51:33 +00:00
zzak dd05478f24 * lib/open-uri.rb: Documentation for OpenURI
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-20 02:01:23 +00:00
svn 167c4781a0 * 2012-10-20
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 21:20:37 +00:00
tenderlove fb03eb91fe * hash.c (initialize_copy): unset the default proc if there isn't one
for the target hash, call to_hash, check frozen status.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 21:20:33 +00:00
nobu 2fe13f62ef vm.c: pass through thrown objects
* vm.c (rb_vm_jump_tag_but_local_jump): pass through thrown objects.
  [ruby-dev:46234] [Bug #7185]
* vm_eval.c (rb_eval_cmd): if state is non-zero, val should be nil and
  rb_vm_jump_tag_but_local_jump() just jump tag.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 13:22:03 +00:00
eregon b0e40509c3 set encoding to ASCII for appropriate String#unpack modifiers
* pack.c (pack_unpack): set encoding of the
  'H','h','B' and 'B' modifiers to US-ASCII.
* test/ruby/test_pack.rb: tests for the above.
  [ruby-core:47653][Bug #7050]
* test/test_securerandom.rb: tests for SecureRandom.hex
  from tenderlove. [ruby-core:46792][Bug #6799]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 13:13:32 +00:00
ko1 f4dbc7a384 * method.h (rb_method_cfunc_t::invoker): add new field (func ptr)
`invoker'. `invoker' function invoke cfunc body
  (rb_method_cfunc_t::func).
  `invoker' is set at method definition timing.
  With this change, the big `switch' (branch) in `call_cfunc()'
  is no longer needed.
  However, the performance benefit is only a bit.
* vm_core.h (rb_call_info_t::aux::func): add a new field to store
  cfunc body function pointer.
* vm_method.c (call_cfunc_invoker_func): add a new function which
  returns a suitable invoke function.
* vm_method.c (setup_method_cfunc_struct): added.
* vm_method.c (rb_add_method): fix to set `invoker'.
* vm_eval.c (vm_call0_body): catch up above changes.
* vm_insnhelper.c (call_cfunc): removed.
* vm_insnhelper.c (vm_call_cfunc): fix to call cfunc body
  with `invoker' function.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 10:38:30 +00:00
ko1 0fc7f4bb30 * eval.c, vm_eval.c: use TH_PUSH_TAG() instead of PUSH_TAG().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 07:57:56 +00:00
ko1 e99989bf4f * benchmark/driver.rb: remove unexpected `output'.
(commit miss)



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 02:15:00 +00:00
ko1 3daa9b9f5a * vm_insnhelper.c (vm_search_method): remove needless local variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 01:24:50 +00:00
ko1 f2a9c42c7a * benchmark/bmx_temp.rb: removed.
This file should not be in repository.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 01:23:50 +00:00
svn 0801dba3f6 * 2012-10-19
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 01:22:12 +00:00
ko1 a31d53ecf5 * benchmark/driver.rb: add new option `--ruby-arg [ARG]'
which is passed as a launch parameter for each ruby's execution.
  ($ ruby [ARG] [File])



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19 01:22:08 +00:00
ko1 7e8f558aea * insns.def (opt_send_simple): move the location of
`opt_send_simple' to the place near `send' definition.
  (to take care about icache locality).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 09:44:19 +00:00
ko1 d0ead20888 * insns.def (send): remove unused condition.
This condition will be true after r37258.
* vm_insnhelper.c (vm_caller_setup_args): remove `UNLIKELY' on
  checking blockiseq (it seems `LIKELY').



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 09:41:55 +00:00
ko1 1486b9cf0a * insns.def (opt_send_simple): introduce new instruction used
when no need to care about block and splat.
* compile.c: use the `opt_send_simple' instruction.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 08:35:19 +00:00
nobu 6be52625b2 vm_method.c: check arity earlier
* vm_method.c (rb_add_method_cfunc, rb_add_method_cfunc_frameless):
  check arity earlier at definition time.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 07:44:09 +00:00
nobu 60f949e101 ChangeLog: adjust spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 06:57:58 +00:00
ko1 fea629da83 * vm_insnhelper.c: add `inline' keyword to several functions.
Compilers (gcc) are conservative than I expected.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 06:14:39 +00:00
ko1 cc012cfb19 * include/ruby/ruby.h: add a decl. of
`rb_define_frameless_method()'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 06:04:02 +00:00
ko1 c992cec4a0 * compile.c (new_callinfo): set a temporary index of callinfo
(used in `iseq_set_sequence()') to rb_call_info_t::aux::index.
  rb_call_info_t::argc is initialiesed by same value of
  rb_call_info_t::orig_argc.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 05:33:31 +00:00
ko1 588b73bca2 * class.c (rb_define_frameless_method): rename from
rb_define_method_fast(). Defined method with this C API
  does not make a method frame. It is bit lightweight than
  ordinal C functions. Now only 0 or 1 argc are permitted.
* method.h (VM_METHOD_TYPE_CFUNC_FRAMELESS): rename macro name
  from VM_METHOD_TYPE_CFUNC_FAST.
* vm_insnhelper.c, vm_method.c: rename related functions.
* proc.c (rb_method_entry_arity): catch up above changes.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 05:22:13 +00:00
nobu 676c01bb36 parse.y: fail if yyerror
* parse.y (assignable_gen): fail if yyerror occurred.  fix a bug in
  r36973.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 01:30:37 +00:00
nobu 849c4eaaf3 test_syntax.rb: test_unassignable
* test/ruby/test_syntax.rb (TestSyntax#test_unassignable): assert
  keywords are unassignable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 01:29:54 +00:00
svn 46a45ca613 * 2012-10-18
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 00:24:05 +00:00
tenderlove a34a3c2caa * hash.c (initialize_copy): duping should rehash the hash.
* test/ruby/test_hash.rb: added a test to ensure rehash.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-18 00:24:00 +00:00
nagachika bff930ccf4 * ChangeLog: fix a typo of r37243.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 13:36:45 +00:00
shirosaki 14d59c122f extmk.rb: fix mingw make failure with make -jN
* common.mk (WPROGRAM): need same dependencies as PROGRAM.

* cygwin/GNUmakefile.in (uncommon.mk): move include position
  below WPROGRAM definition to be defined in uncommon.mk.

* ext/extmk.rb (all, static): fix make rubyw.exe failure with make -jN.
  If make of ruby.exe and rubyw.exe run in parallel, link dll and link
  exe run in parallel, which causes link failure on mingw. To fix this,
  we make ruby.exe and rubyw.exe in one make process.
  [ruby-core:48007] [Bug #7165]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 12:20:57 +00:00
ko1 aef5f90281 * benchmark/bm_vm2_method_missing.rb: add a benchmark to measure
performance of invoking `method_missing'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 07:26:58 +00:00
ko1 000ff5b3ce * vm_insnhelper.c (vm_getivar): fix to use `aux.index' instead of
`aux.opt_pc'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 07:24:52 +00:00
ko1 9a82db49eb * vm_insnhelper.c (vm_call_method_missing): make a refactoring
about method_missing process. Use `vm_call_method()' to invoke
  `method_missing' method instead of `rb_funcall2()'.
  In `vm_call_method()', set fastpath to `vm_call_method_missing()'
  if it can be cached.
* vm_core.h (rb_call_info_t): add new field
  `rb_call_info_t::aux::missing_reasion' to pass the reason to
  `vm_call_method_missing()'.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 07:12:40 +00:00
nobu 7254573c55 configure.in: multiple opt-dir
* configure.in (opt-dir): allow multiple directories separated by
  $PATH_SEPARATOR as well as dir_config in mkmf.rb. [ruby-core:47868]
  [Bug #7120]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 06:33:14 +00:00
shugo 0f1e7bcec0 * ChangeLog: add credit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 06:30:29 +00:00
shugo bd6bb6c0b2 * lib/net/imap.rb: fix Net::IMAP::ResponseParser to accept
message/delivery-status ([ruby-core:47920] [Bug #7146]),
  message/rfc822 attachments ([ruby-core:47921] [Bug #7147]), and
  (BODY ("MIXED")) ([ruby-core:47951] [Bug #7153]).

* test/net/imap/test_imap_response_parser.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 06:18:14 +00:00
shugo c4e63346d2 * ChangeLog: use tab for indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 03:55:35 +00:00
usa 38c0b5f0e3 * test/ruby/test_hash.rb (TestHash#test_dup_equality): added a new test
to show the problem of r37232.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 02:06:34 +00:00
shugo 8f58f60643 * vm_insnhelper.c (vm_search_method): fix a build error that occurs
when OPT_INLINE_METHOD_CACHE is 0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-17 01:50:53 +00:00
ko1 5e2625eebd * benchmark/bm_vm2_dstr.rb: add a benchmark to measure
performance of dynamic generated string ("foo#{bar}baz").



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 23:47:51 +00:00
ko1 49371b5420 * compile.c (compile_dstr_fragments): use `putobject' instead of
`putstring' for all of strings used by NODE_DSTR because
  ruby users can not grab this string.
  For example, the string object of "baz" in "foo#{bar}baz"
  is located by `putobject' (users can not touch "baz" object
  directly). This change reduces GC pressure.
  This improvement is suggested by Aaron Patterson.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 23:38:58 +00:00
ko1 8addee9649 * thread.c (rb_threadptr_interrupt_mask): fix to check interrupt
after interrupt_mask changed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 23:03:54 +00:00
ko1 199fc6a54f * vm_insnhelper.c (vm_call_method): fix to return value immediately.
Remove CHECK_INTS() after that method dispatch.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 21:49:18 +00:00
tenderlove b3803cc49a * hash.c (initialize_copy): copy the underlying st_table on dup,
rather than copying the hash key by key. [ruby-core:48009]

* test/ruby/test_hash.rb: relevant tests for initialize_copy

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 21:33:59 +00:00
ko1 ddb6408f6e * vm_insnhelper.c (vm_call_iseq_setup_2): separate tailcall and normal
method frame setup functions.
  Add checking interrupts at the tailcall setup function.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-16 21:20:11 +00:00