Commit graph

898 commits

Author SHA1 Message Date
shyouhei
8162d69dda merge revision(s) 24958,24979:
* eval.c (rb_thread_start_timer): start to catch SIGVTALRM together
	  with timer thread.   [ruby-core:25606]
	* eval.c (rb_thread_atfork): stop timer thread.
	* eval.c (rb_thread_start_0, rb_thread_start_1): should call star
	  timer after added new thread to thread list.  [ruby-core:25613]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@25819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-17 07:32:15 +00:00
shyouhei
e2bc9db763 merge revision(s) 22679:
* class.c (rb_singleton_class_clone): Qnil must be used for a null
	  class reference when we use NIL_P() to check class reference
	  validity.  The bug was exposed by the spec test of Sequel.
	* eval.c (ruby_init): Use NEW_CREF().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-11 03:23:37 +00:00
shyouhei
e8c18c977e merge revision(s) 24413,24416,24442:
* eval.c (rb_thread_schedule): fix condition for making thread
	  runnable.  [ruby-core:23515]
	* eval.c (rb_thread_schedule): refine previous change.
	* eval.c (rb_thread_schedule): need select for WAIT_SELECT, even if
	  already timeout.  [ruby-dev:38971]
	  (WAIT_DONE): defined for mark threads which can be runnable.
	* ext/digest/sha2/sha2.h: include inttypes.h for uint32_t, etc.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-07 10:59:37 +00:00
shyouhei
ae6799529d merge revision(s) 24403:
* eval.c (rb_exc_raise, rb_exc_fatal): require exception object.
	  [ruby-core:24767]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-06 14:04:47 +00:00
shyouhei
262c620e90 merge revision(s) 23202,23268,23305:
* eval.c (safe_mutex_lock): pthread_cleanup_push() must not be
	  inside parens.
	* eval.c (rb_thread_start_timer): guard condition was inverted.
	  [ruby-dev:38319]
	* eval.c (get_ts): use readtime clock.  [ruby-dev:38354]
	* eval.c (rb_thread_stop_timer): clear thread_init while locking.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@24104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-14 11:31:37 +00:00
shyouhei
7adb8681f0 merge revision(s) 23257:
* eval.c (proc_invoke): shares dmethod scope local variables.
	  a patch from coderrr at [ruby-core:23050]
	* gc.c (obj_free): do not free cloned scope local variables.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-09 09:05:18 +00:00
shyouhei
a563f71398 merge revision(s) 23201:
* eval.c (rb_thread_remove): stops timer thread unless other
	  threads exist.  [ruby-core:18444]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-08 10:58:03 +00:00
shyouhei
4b4ac8ac64 merge revision(s) 23096:
* eval.c (rb_eval): checks for interrupt, stack and finalizers too.
	  [ruby-dev:38208], [Bug #1329]
	* eval.c (eval): replaces the message if frozen.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-06 07:25:47 +00:00
shyouhei
ca94967d3e merge revision(s) 22627:
* eval.c (rb_thread_schedule): mswin32 doesn't have F_GETFD, so check
	  with another method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-08 01:59:39 +00:00
shyouhei
7686f4cd0e merge revision(s) 22674:
* eval.c (rb_eval): needs to guard intermediate string objects.
	  based on a patch from Brent Roman <brent AT mbari.org> a
	  [ruby-core:22584].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-03 11:59:59 +00:00
shyouhei
dd459e8875 merge revision(s) 22299:
* eval.c (rb_thread_schedule): handle EBADF of select as well.
	  [ruby-core:21264]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-26 11:54:05 +00:00
shyouhei
e8122fadd4 merge revision(s) 17874,17886:
* eval.c (rb_thread_join): new API.
	* ext/thread/thread.c (wait_mutex, lock_mutex): wait until the locking
	  thread exits.  [ruby-dev:34856]
	* eval.c (rb_thread_value): missed to change at r17874.  [ruby-core:17595]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23 09:28:31 +00:00
shyouhei
ebe322b171 merge revision(s) 21354:
* eval.c (stack_extend): streamlined rb_thread_restore_context()
	  to ensure O(1) time.  based on a patch by Brent Roman <brent AT
	  mbari.org>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 13:10:04 +00:00
shyouhei
cb016e3224 merge revision(s) 21353:
* eval.c (cc_mark): frees the continuation's stack if its thread
	  is dead to avoid recursive gc that segfaults.  [ruby-core:13889]
	  a patch by Brent Roman <brent AT mbari.org>.
	* eval.c (rb_cont_check): checks for valid continuation instance.
	* eval.c (rb_callcc): assigns th->thread before scope_dup() to
	  avoid segfaults if this scope_dup() triggers a gc pass.
	  a patch by Brent Roman <brent AT mbari.org>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22 13:04:52 +00:00
shyouhei
d842d1bcc4 merge revision(s) 21165:
* eval.c (rb_thread_schedule): Don't change status of threads which
	  don't run next even if select notify readability/writability.
	  [ruby-core:20446]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-21 15:19:29 +00:00
shyouhei
fe9c4e615b merge revision(s) 20578:
* eval.c (rb_yield_0): Qundef means no argument.  [ruby-Bugs-22525]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-19 08:19:34 +00:00
shyouhei
79c3f54d78 merge revision(s) 20225:
* eval.c (load_lock): makes circular require deadlock.
	  [ruby-core:19821]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 11:01:59 +00:00
shyouhei
d896aedf3d merge revision(s) 20214:
* eval.c (rb_feature_p): returns found feature name if loading.
	  [ruby-core:19798]
	* eval.c (search_required): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@22201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-10 10:41:23 +00:00
shyouhei
8e7303ae4e merge revision(s) 19690:
* eval.c (rb_mod_modfunc): method undefined in included module
	  may not have nd_body.  [ruby-core:18738]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@21857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-28 13:54:21 +00:00
shyouhei
78c5478af8 merge revision(s) 18485:
* class.c (clone_method): should copy cbase in cref as well.
	  [ruby-dev:35116]
	* node.h (NEW_CREF): new NEW_ macro.
	* eval.c (PUSH_CREF): use NEW_CREF().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@21585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-16 02:00:48 +00:00
shyouhei
3c848f79b7 merge revision(s) 18463:
* gc.c (STACK_LEVEL_MAX, ruby_stack_length): returns size_t.
	  [ruby-core:18207]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@21524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-15 05:40:26 +00:00
shyouhei
46e4dcf09d merge revision(s) 18355:
* eval.c (timeofday): use monotonic clock.  based on a patch
	  from zimbatm <zimbatm@oree.ch> in [ruby-core:16627].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@21359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 01:12:20 +00:00
shyouhei
7e57588677 merge revision(s) 18316,18319:
* rubysig.h (CHECK_INTS): gives the chance to perform to deferred
	  finalizers before explicit GC.start or the process termination.
	  [ruby-core:18045]
	* eval.c (rb_thread_schedule): runs deferred finalizers.
	* gc.c (gc_sweep): sets rb_thread_pending to run deferred finalizers.
	* rubysig.h (CHECK_INTS): now checks rb_thread_pending even on
	  platforms where setitimer is not available.  [ruby-core:18045]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@21334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-05 02:16:18 +00:00
shyouhei
d1911459ae merge revision(s) 17833:17837:
* gc.c (Init_GC): fix syntax error.
	* error.c (rb_exc_new3): keeps the given string itself.
	* eval.c (Init_Proc), gc.c (Init_GC): freeze messages of preallocated
	  special exceptions also.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@18327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-04 03:24:26 +00:00
shyouhei
c14831d7f1 merge revision(s) 17832:
* eval.c (rb_longjmp): duplicate the thrown exception to set backtrace
	  if it was frozen.  clear all raised flags.
	* eval.c (stack_check): leave clearing flag to rb_longjmp.
	* eval.c (rb_thread_set_raised, rb_thread_reset_raised): use generic
	  flags.
	* eval.c (Init_Proc), gc.c (Init_GC): freeze preallocated special exceptions.
	* gc.c (rb_memerror): use thread raised flag instead of static flag,
	  and raise nomem_error without backtrace if failed to make backtrace.
	  [ruby-dev:34724]
	* gc.c (ruby_xmalloc): increase malloc_increase only if malloc
	  succeeds.  failed malloc size can be huge.  it may increase
	  malloc_limit too big which cause less GC and memory full.
	  (ruby_xrealloc): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-07 06:17:24 +00:00
shyouhei
313a909418 merge revision(s) 17636:
* eval.c (rb_obj_respond_to): use RTEST to test the result of
	  respond_to? method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 12:41:36 +00:00
shyouhei
716ed3d630 merge revision(s) 17581:
* eval.c (rb_call0): wrong condition to check insecure method.
	  a patch from Keita Yamaguchi <keita.yamaguchi at gmail.com>.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 09:31:47 +00:00
shyouhei
b53240a526 merge revision(s) 17547:
* eval.c (PUSH_FRAME, PUSH_CLASS): Add volatile to avoid a
	  possible optimization bug on OS X/PPC.  This at least makes
	  build with gcc -O1 and `make test' pass.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@17680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-29 09:20:47 +00:00
knu
f072d4e34a Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 11:44:49 +00:00
knu
c4f26e46db Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16636 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27 10:07:07 +00:00
knu
c46c73c7a2 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-26 03:12:58 +00:00
knu
35ec34fa2f Merge from ruby_1_8, including r16205.
Note that passing a block to a Proc is experimental and partly broken.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-26 03:08:26 +00:00
knu
fa0c521a21 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24 18:16:10 +00:00
knu
072673ee41 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-24 17:49:34 +00:00
knu
280f8df370 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 16:07:42 +00:00
knu
ab3d450a54 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-22 03:31:43 +00:00
knu
b524523217 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-21 17:27:56 +00:00
knu
8480bcc8d5 Merge -r16241:16456 from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-18 15:02:36 +00:00
knu
32378c5abe Merge r16206 and r16239 from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-18 14:48:15 +00:00
knu
74efef0be8 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-25 06:51:21 +00:00
knu
a47dfe2763 Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22 17:29:39 +00:00
knu
7f6df101ca Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21 09:43:44 +00:00
knu
09f5560c57 Merge everything from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-19 11:45:39 +00:00
kazu
3be6ebc5ce * eval.c (method_receiver, method_name, method_owner): New
methods; backported from 1.9. bug#19007


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-15 10:07:59 +00:00
knu
badb865567 * enumerator.c (rb_eStopIteration), eval.c (rb_f_loop), ruby.h:
Add a new exception class StopIteration, which breaks Kernel#loop
  iteration when raised; backported from 1.9.

* enumerator.c (enumerator_next, enumerator_rewind): Implement
  #next and #rewind using the "generator" library.

* lib/generator.rb: Implement Enumerable::Enumerator#next and
  #rewind.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-10 10:52:50 +00:00
knu
e6de1a384e * eval.c (rb_obj_method, rb_proc_call), intern.h: Export.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-09 10:47:13 +00:00
matz
7bd34cdb70 * eval.c (EXEC_TAG): remove unnecessary FLUSH_REGISTER_WINDOWS for
better performance on SPARC.  [ruby-core:16159]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-08 02:13:25 +00:00
nobu
ba570c7378 * configure.in (RUBY_SETJMP, RUBY_LONGJMP, RUBY_JMP_BUF): prefers
__builtin_setjmp, _setjmp over setjmp and sigsetjmp.
  [ruby-core:16023], [ruby-core:16086]

* configure.in (--with-setjmp-type): new option to override the
  default rule in the above.

* eval.c (ruby_setjmp, ruby_longjmp), gc.c (rb_setjmp),
  node.h (rb_jmpbuf_t): use RUBY_SETJMP, RUBY_LONGJMP and
  RUBY_JMP_BUF.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-31 17:58:14 +00:00
knu
058c981311 * eval.c (rb_eval): Call trace hook for if expression after the
condition has been evaluated, not before; submitted by Rocky
  Bernstein in #18722.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-24 11:09:51 +00:00
nobu
6017f19422 * eval.c (rb_call0): yields the last executed node line number at
return event.  [ruby-core:15855]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-12 15:37:22 +00:00