* eval.c (rb_eval): copy on write for argument local variable

assignment.

* eval.c (assign): ditto.

* eval.c (rb_call0): update ruby_frame->argv with the default
  value used for the optional arguments.

* object.c (Init_Object): "===" calls rb_obj_equal() directly.
  [ruby-list:39937]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2004-07-27 08:11:36 +00:00
Родитель ae7d870923
Коммит bc667633d0
4 изменённых файлов: 33 добавлений и 7 удалений

Просмотреть файл

@ -1,3 +1,16 @@
Tue Jul 27 07:05:04 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_eval): copy on write for argument local variable
assignment.
* eval.c (assign): ditto.
* eval.c (rb_call0): update ruby_frame->argv with the default
value used for the optional arguments.
* object.c (Init_Object): "===" calls rb_obj_equal() directly.
[ruby-list:39937]
Mon Jul 26 11:22:55 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* lib/webrick/httputils.rb (WEBrick::HTTPUtils.escape): should

6
eval.c
Просмотреть файл

@ -1246,8 +1246,6 @@ ruby_init()
Init_stack((void*)&state);
Init_heap();
PUSH_SCOPE();
ruby_scope->local_vars = 0;
ruby_scope->local_tbl = 0;
top_scope = ruby_scope;
/* default visibility is private at toplevel */
SCOPE_SET(SCOPE_PRIVATE);
@ -3392,6 +3390,7 @@ rb_eval(self, n)
if (ruby_scope->local_vars == 0)
rb_bug("unexpected local variable assignment");
result = rb_eval(self, node->nd_value);
if (node->nd_cnt < ruby_frame->argc + 2) scope_dup(ruby_scope);
ruby_scope->local_vars[node->nd_cnt] = result;
break;
@ -4954,6 +4953,7 @@ assign(self, lhs, val, pcall)
case NODE_LASGN:
if (ruby_scope->local_vars == 0)
rb_bug("unexpected local variable assignment");
if (lhs->nd_cnt < ruby_frame->argc + 2) scope_dup(ruby_scope);
ruby_scope->local_vars[lhs->nd_cnt] = val;
break;
@ -5617,7 +5617,7 @@ rb_call0(klass, recv, id, oid, argc, argv, body, nosuper)
if (local_vars) {
if (i > 0) {
/* +2 for $_ and $~ */
MEMCPY(local_vars+2, argv, VALUE, i);
MEMCPY(local_vars+2, argv, VALUE, ruby_frame->argc);
}
argv += i; argc -= i;
if (node->nd_opt) {

Просмотреть файл

@ -21,7 +21,7 @@
;;; (setq interpreter-mode-alist (append '(("ruby" . ruby-mode))
;;; interpreter-mode-alist))
;;;
;;; (2) set to road inf-ruby and set inf-ruby key definition in ruby-mode.
;;; (2) set to load inf-ruby and set inf-ruby key definition in ruby-mode.
;;;
;;; (autoload 'run-ruby "inf-ruby"
;;; "Run an inferior Ruby process")
@ -35,16 +35,28 @@
;;; HISTORY
;;; senda - 8 Apr 1998: Created.
;;; $Log$
;;; Revision 1.7 2004/07/27 08:11:36 matz
;;; * eval.c (rb_eval): copy on write for argument local variable
;;; assignment.
;;;
;;; * eval.c (assign): ditto.
;;;
;;; * eval.c (rb_call0): update ruby_frame->argv with the default
;;; value used for the optional arguments.
;;;
;;; * object.c (Init_Object): "===" calls rb_obj_equal() directly.
;;; [ruby-list:39937]
;;;
;;; Revision 1.6 2002/09/07 14:35:46 nobu
;;; * misc/inf-ruby.el (inferior-ruby-error-regexp-alist): regexp
;;; alist for error message from ruby.
;;;
;;;
;;; * misc/inf-ruby.el (inferior-ruby-mode): fixed for Emacs.
;;;
;;;
;;; * misc/inf-ruby.el (ruby-send-region): compilation-parse-errors
;;; doesn't parse first line, so insert separators before each
;;; evaluations.
;;;
;;;
;;; Revision 1.5 2002/08/19 10:05:47 nobu
;;; * misc/inf-ruby.el (inf-ruby-keys): ruby-send-definition
;;; conflicted with ruby-insert-end.

Просмотреть файл

@ -2611,6 +2611,7 @@ Init_Object()
rb_define_method(rb_cSymbol, "to_s", sym_to_s, 0);
rb_define_method(rb_cSymbol, "id2name", sym_to_s, 0);
rb_define_method(rb_cSymbol, "to_sym", sym_to_sym, 0);
rb_define_method(rb_cSymbol, "===", rb_obj_equal, 1);
rb_define_method(rb_cModule, "freeze", rb_mod_freeze, 0);
rb_define_method(rb_cModule, "===", rb_mod_eqq, 1);