[#13842] Better introspection for Frames, Thread, and enhancing binding. — "Rocky Bernstein" <rocky.bernstein@...>

The below is a little long. So here's a summary.

11 messages 2007/12/01

[#13851] Array#flatten works quadratic time on length of resulting array. It could be linear — "Voroztsov Artem" <artem.voroztsov@...>

I encountered problem with Array#flatten slowness (it can be much

19 messages 2007/12/03
[#13863] Re: Array#flatten works quadratic time on length of resulting array. It could be linear — Charles Oliver Nutter <charles.nutter@...> 2007/12/03

Voroztsov Artem wrote:

[#13867] Re: Array#flatten works quadratic time on length of resulting array. It could be linear — "Voroztsov Artem" <artem.voroztsov@...> 2007/12/03

2007/12/3, Charles Oliver Nutter <charles.nutter@sun.com>:

[#13868] Re: Array#flatten works quadratic time on length of resulting array. It could be linear — "Voroztsov Artem" <artem.voroztsov@...> 2007/12/03

2007/12/3, Voroztsov Artem <artem.voroztsov@gmail.com>:

[#13870] Re: Array#flatten works quadratic time on length of resulting array. It could be linear — "Yusuke ENDOH" <mame@...> 2007/12/03

Hi,

[#13903] Clarification of retry change — Charles Oliver Nutter <charles.nutter@...>

Matz confirmed that retry-outside-rescue will no longer work, but I

14 messages 2007/12/07
[#13905] Re: Clarification of retry change — SASADA Koichi <ko1@...> 2007/12/07

Hi,

[#13908] What's the status of compiler/compiling on windows? — Gonzalo Garramu <ggarra@...>

20 messages 2007/12/07
[#13913] Re: What's the status of compiler/compiling on windows? — Nobuyoshi Nakada <nobu@...> 2007/12/07

Hi,

[#13914] Re: [Spam] Re: What's the status of compiler/compiling on windows? — Gonzalo Garramu <ggarra@...> 2007/12/07

Nobuyoshi Nakada wrote:

[#13926] Re: [Spam] Re: What's the status of compiler/compiling on windows? — "Luis Lavena" <luislavena@...> 2007/12/07

T24gRGVjIDcsIDIwMDcgODoyMSBBTSwgR29uemFsbyBHYXJyYW11w7FvIDxnZ2FycmFAYWR2YW5j

[#14038] Re: [Spam] Re: What's the status of compiler/compiling on windows? — "Joe Swatosh" <joe.swatosh@...> 2007/12/12

Hi Luis

[#14039] Re: [Spam] Re: What's the status of compiler/compiling on windows? — "Luis Lavena" <luislavena@...> 2007/12/12

On Dec 12, 2007 4:05 PM, Joe Swatosh <joe.swatosh@gmail.com> wrote:

[#14040] Re: [Spam] Re: What's the status of compiler/compiling on windows? — "Austin Ziegler" <halostatue@...> 2007/12/12

> This was discussed in other thread in ruby-talk, but just to summarize:

[#13969] redefineable not operator — David Flanagan <david@...>

Matz,

37 messages 2007/12/10
[#13971] Re: redefineable not operator — murphy <murphy@...> 2007/12/10

David Flanagan wrote:

[#13972] Re: redefineable not operator — Yukihiro Matsumoto <matz@...> 2007/12/10

Hi,

[#14007] Re: redefineable not operator — murphy <murphy@...> 2007/12/11

Yukihiro Matsumoto wrote:

[#14011] Re: redefineable not operator — Yukihiro Matsumoto <matz@...> 2007/12/11

Hi,

[#14013] Re: redefineable not operator — murphy <murphy@...> 2007/12/12

Yukihiro Matsumoto wrote:

[#14016] Re: redefineable not operator — David Flanagan <david@...> 2007/12/12

murphy wrote:

[#14019] Re: redefineable not operator — Yukihiro Matsumoto <matz@...> 2007/12/12

Hi,

[#14024] Re: redefineable not operator — Gary Wright <gwtmp01@...> 2007/12/12

[#14029] Re: redefineable not operator — Dave Thomas <dave@...> 2007/12/12

[#14042] Fix e2mmap.rb for 1.9 — Eric Hodel <drbrain@...7.net>

E2MM.Raise complains about $! being read-only now, and E2MM is used by

22 messages 2007/12/13
[#14043] Re: Fix e2mmap.rb for 1.9 — Dave Thomas <dave@...> 2007/12/13

[#14049] RDoc + irb (Was: Fix e2mmap.rb for 1.9) — Eric Hodel <drbrain@...7.net> 2007/12/13

On Dec 12, 2007, at 16:19 PM, Dave Thomas wrote:

[#14052] Re: RDoc + irb (Was: Fix e2mmap.rb for 1.9) — Dave Thomas <dave@...> 2007/12/13

[#14056] Re: RDoc + irb (Was: Fix e2mmap.rb for 1.9) — Charles Oliver Nutter <charles.nutter@...> 2007/12/13

Dave Thomas wrote:

[#14123] Some Ruby 1.9 loose ends to tie up — David Flanagan <david@...>

Matz,

20 messages 2007/12/17
[#14220] Re: Some Ruby 1.9 loose ends to tie up — Yukihiro Matsumoto <matz@...> 2007/12/21

Hi,

[#14238] Re: Some Ruby 1.9 loose ends to tie up — Charles Oliver Nutter <charles.nutter@...> 2007/12/22

Yukihiro Matsumoto wrote:

[#14147] named captures assigning to local variables — David Flanagan <david@...>

I've just been browsing ruby-dev. For an english speaker, it is kind of

26 messages 2007/12/19
[#14150] Re: named captures assigning to local variables — Tanaka Akira <akr@...> 2007/12/19

In article <47686B87.7050609@davidflanagan.com>,

[#14158] Re: named captures assigning to local variables — david@... 2007/12/19

Thank you for the clarification, akr. I'm embarassed to say that it didn't

[#14161] Re: named captures assigning to local variables — David Flanagan <david@...> 2007/12/20

If I may, have a proposal. My apologies if this has already been

[#14170] Re: named captures assigning to local variables — Tanaka Akira <akr@...> 2007/12/20

In article <476A087E.3070000@davidflanagan.com>,

[#14172] Re: named captures assigning to local variables — David Flanagan <david@...> 2007/12/20

How about making the return value an array of the captured strings, or nil

[#14149] Experimental PATCH to improve thread performance — Brent Roman <brent@...>

The attached patch against Ruby 1.8.6-p110 improves the performance of

38 messages 2007/12/19
[#14202] Re: Experimental PATCH to improve thread performance — Charles Oliver Nutter <charles.nutter@...> 2007/12/21

Brent Roman wrote:

[#14257] Re: Experimental PATCH to improve thread performance — Brent Roman <brent@...> 2007/12/22

[#14266] Re: Experimental PATCH to improve thread performance — Charles Oliver Nutter <charles.nutter@...> 2007/12/22

Brent Roman wrote:

[#14274] Re: Experimental PATCH to improve thread performance — Sylvain Joyeux <sylvain.joyeux@...4x.org> 2007/12/22

On Sat, Dec 22, 2007 at 11:07:25PM +0900, Charles Oliver Nutter wrote:

[#14186] Rake 0.8.0 added to Ruby — Jim Weirich <jim.weirich@...>

Just a heads up here. I've added Rake (version 0.8.0 ... the latest)

34 messages 2007/12/21
[#14210] Re: [Spam] Rake 0.8.0 added to Ruby — Gonzalo Garramu <ggarra@...> 2007/12/21

Jim Weirich wrote:

[#14213] Re: [Spam] Rake 0.8.0 added to Ruby — "Rick DeNatale" <rick.denatale@...> 2007/12/21

On Dec 21, 2007 10:24 AM, Gonzalo Garramu=F1o <ggarra@advancedsl.com.ar> wr=

[#14215] Re: [Spam] Rake 0.8.0 added to Ruby — Jim Weirich <jim.weirich@...> 2007/12/21

[#14303] IRHG - GC Memory Fragmentation? — Charles Thornton <ceo@...>

While working on Chapter 05 and referencing various works

23 messages 2007/12/23
[#14308] Re: IRHG - GC Memory Fragmentation? — Ryan Davis <ryand-ruby@...> 2007/12/23

[#14335] Many external symbols _without_ prefix in libruby object file — Tadashi Saito <shiba@...2.accsnet.ne.jp>

Hi all,

12 messages 2007/12/23

[#14364] RDoc: [FATAL] failed to allocate memory — Martin Duerst <duerst@...>

With revision 14590, I suddenly get an error when I do "make install"

13 messages 2007/12/24

[#14367] replace csv.rb with fastercsv.rb — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

15 messages 2007/12/24
[#14390] Re: replace csv.rb with fastercsv.rb — James Gray <james@...> 2007/12/24

On Dec 24, 2007, at 3:34 AM, NAKAMURA, Hiroshi wrote:

[#14418] Base64 not there makes Rails 2.0.2 fail to load in 1.9.0 — Richard Kilmer <rich@...>

Just re-built latest svn of 1.9.0 and base64.rb is removed. Its

51 messages 2007/12/25
[#14420] Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — Eric Hodel <drbrain@...7.net> 2007/12/25

On Dec 25, 2007, at 07:03 AM, Richard Kilmer wrote:

[#14427] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — "M. Edward (Ed) Borasky" <znmeb@...> 2007/12/25

Eric Hodel wrote:

[#14431] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — Dave Thomas <dave@...> 2007/12/25

[#14446] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — Eric Hodel <drbrain@...7.net> 2007/12/26

On Dec 25, 2007, at 13:35 PM, Dave Thomas wrote:

[#14452] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — Dave Thomas <dave@...> 2007/12/26

[#14492] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — Eric Hodel <drbrain@...7.net> 2007/12/27

On Dec 26, 2007, at 06:16 AM, Dave Thomas wrote:

[#14494] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — Dave Thomas <dave@...> 2007/12/27

[#14503] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — Richard Kilmer <rich@...> 2007/12/27

[#14505] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — Charles Oliver Nutter <charles.nutter@...> 2007/12/27

Richard Kilmer wrote:

[#14429] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — hemant <gethemant@...> 2007/12/25

On Dec 26, 2007 1:01 AM, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

[#14430] Re: Legacy support (Was: Base64 not there makes Rails 2.0.2 fail to load in 1.9.0) — "M. Edward (Ed) Borasky" <znmeb@...> 2007/12/25

hemant wrote:

[#14517] Invalid use of mktime() in Ruby 1.8/1.9 results in incorrect Time objects — Dirkjan Bussink <d.bussink@...>

Hello,

12 messages 2007/12/27

[#14549] multibyte strings & bucket-of-bytes efficiency under 1.9.0 — khaines@...

Like everyone else, I've been testing my stuff under 1.9.0. In general,

38 messages 2007/12/28
[#14560] Re: multibyte strings & bucket-of-bytes efficiency under 1.9.0 — Brent Roman <brent@...> 2007/12/28

[#14573] Re: multibyte strings & bucket-of-bytes efficiency under 1.9.0 — murphy <murphy@...> 2007/12/29

Brent Roman wrote:

[#14603] Re: multibyte strings & bucket-of-bytes efficiency under 1.9.0 — Brent Roman <brent@...> 2007/12/30

[#14617] Re: multibyte strings & bucket-of-bytes efficiency under 1.9.0 — Tanaka Akira <akr@...> 2007/12/31

In article <14544702.post@talk.nabble.com>,

[#14568] Layout of includes in ruby 1.9 — Gonzalo Garramu <ggarra@...>

19 messages 2007/12/29
[#14576] Re: Layout of includes in ruby 1.9 — "Rick DeNatale" <rick.denatale@...> 2007/12/29

On Dec 29, 2007 2:39 AM, Gonzalo Garramu=F1o <ggarra@advancedsl.com.ar> wro=

[#14569] Wide strings to ruby strings — Gonzalo Garramu <ggarra@...>

11 messages 2007/12/29

[#14602] RCR allow indexing last n items — "Michal Suchanek" <hramrach@...>

Hello

15 messages 2007/12/30
[#14609] Re: RCR allow indexing last n items — "David A. Black" <dblack@...> 2007/12/30

Hi --

[#14610] Re: RCR allow indexing last n items — "Michal Suchanek" <hramrach@...> 2007/12/30

On 30/12/2007, David A. Black <dblack@rubypal.com> wrote:

[#14616] Re: RCR allow indexing last n items — "David A. Black" <dblack@...> 2007/12/30

Hi --

[#14621] Module.new(&block) in Ruby 1.9 — murphy <murphy@...>

Hello!

21 messages 2007/12/31
[#14622] Re: Module.new(&block) in Ruby 1.9 — "Cheah Chu Yeow" <chuyeow@...> 2007/12/31

This looks like a related bug with passing block arguments to

[#14633] Re: Module.new(&block) in Ruby 1.9 — murphy <murphy@...> 2007/12/31

Cheah Chu Yeow wrote:

[#14716] Re: Module.new(&block) in Ruby 1.9 — SASADA Koichi <ko1@...> 2008/01/03

Hi,

[#14726] Re: Module.new(&block) in Ruby 1.9 — ts <decoux@...> 2008/01/03

>>>>> "S" == SASADA Koichi <ko1@atdot.net> writes:

[#14728] Re: Module.new(&block) in Ruby 1.9 — SASADA Koichi <ko1@...> 2008/01/03

Hi,

[#16093] Re: Module.new(&block) in Ruby 1.9 — "Jeremy Kemper" <jeremy@...> 2008/04/01

Hi,

Many external symbols _without_ prefix in libruby object file

From: Tadashi Saito <shiba@...2.accsnet.ne.jp>
Date: 2007-12-23 22:46:14 UTC
List: ruby-core #14335
Hi all,

Unfortunately, I found many new external symbols without prefix in
libruby.so. The "prefix" I meant is from:

 - Ruby: rb_, ruby_, Init_, st_, dln_
 - Oniguruma: onig_, Onig

I confirmed them by the (semi) one-liner:

$ nm -g /usr/local/lib/libruby-trunk.so.1.9 | 
  ruby-trunk -ane 'print if $_ !~ /^ \s/ &&
  $F[2] !~ /^(rb_|ruby_|Init_|st_|onig|_|dln_|eaccess|strl)/i' |
  wc -l # eaccess and strl* was defined because I didn't have them

139

# Note that this script prints *3* if the target file of nm(1)
# is "libruby.so.1.8."

I guess "keep namespace clean" matters like this may near-critical thing
for the developers who touch extention libraries or embeded interpreters.

# For example, if I made extention library that have variable named 
# "idEq," compilation would be failed easily.

Here is the complete list generated by the above script on my box.


T bm_mark
T debug_print_post
T debug_print_pre
T debug_print_register
T dtoa
T env_dump_raw
T freedtoa
D from_EUC_JP
D from_ISO_8859_1
D from_ISO_8859_10
D from_ISO_8859_11
D from_ISO_8859_13
D from_ISO_8859_14
D from_ISO_8859_15
D from_ISO_8859_2
D from_ISO_8859_3
D from_ISO_8859_4
D from_ISO_8859_5
D from_ISO_8859_6
D from_ISO_8859_7
D from_ISO_8859_8
D from_ISO_8859_9
D from_SHIFT_JIS
B function_call_may_return_twice_false
B function_call_may_return_twice_jmp_buf
T genrand_int32
T genrand_real
B idAREF
B idASET
B idAnswer
B idArrayEach
B idBackquote
B idBitblt
B idDIV
B idEach
B idEnd
B idEq
B idEqTilde
B idEqq
B idGE
B idGT
B idGets
B idIntern
B idLE
B idLT
B idLTLT
B idLambda
B idLength
B idMINUS
B idMOD
B idMULT
B idMethodMissing
B idNeq
B idNot
B idPLUS
B idRangeEachLE
B idRangeEachLT
B idSend
B idSendBang
B idSucc
B idThrowState
B idTimes
B id__send
B id__send__
B id__send_bang
T insn_make_insn_table
T insns_name_array
T invoke_Array_each_special_block
T invoke_Integer_times_special_block
T invoke_Range_each_special_block
T is_ruby_native_thread
T iseq_build_from_ary
T iseq_compile
T iseq_data_to_ary
T iseq_load
T iseq_translate_threaded_code
T native_cond_broadcast
T native_cond_destroy
T native_cond_initialize
T native_cond_signal
T native_cond_wait
T native_mutex_destroy
T native_mutex_initialize
T native_mutex_lock
T native_mutex_trylock
T native_mutex_unlock
T nodeline
T nodetype
T proc_dump_raw
T ss_apply_all_case_fold
T stack_dump_each
T stack_dump_th
B symCFUNC
B symIFUNC
B sysstack_error
T thgroup_enclose
T thread_dump_regs
T thread_dump_state
B thread_recycle_stack_count
B thread_recycle_stack_slot
T thread_reset_raised
T thread_set_raised
D to_EUC_JP
D to_ISO_8859_1
D to_ISO_8859_10
D to_ISO_8859_11
D to_ISO_8859_13
D to_ISO_8859_14
D to_ISO_8859_15
D to_ISO_8859_2
D to_ISO_8859_3
D to_ISO_8859_4
D to_ISO_8859_5
D to_ISO_8859_6
D to_ISO_8859_7
D to_ISO_8859_8
D to_ISO_8859_9
D to_SHIFT_JIS
T vm_backtrace
T vm_call0
T vm_cfp_svar_get
T vm_cfp_svar_set
T vm_collect_local_variables_in_heap
T vm_cref_push
T vm_eval
T vm_eval_body
T vm_get_cbase
T vm_get_cref
T vm_get_sourceline
T vm_invoke_proc
T vm_jump_tag_but_local_jump
T vm_localjump_error
T vm_make_env_object
T vm_make_jump_tag_but_local_jump
T vm_make_proc
T vm_set_special_cref
T vm_stack_dump_raw
T vm_stack_to_heap
T vm_yield


I know it's very very tiresome job, but I hope the list is shortened
till the release if possible.

# We know that it's easy to add new symbols, but to reduce is too hard


Then, here is my quick patch that

 - substitutes idPLUS with '+' etc.
 - removes unused id* and sym*

and deletes 13 useless external symbols.

I hope this report will help.

Index: blockinlining.c
===================================================================
--- blockinlining.c	(revision 14559)
+++ blockinlining.c	(working copy)
@@ -139,7 +139,7 @@
 
 	node =
 	    NEW_WHILE(NEW_CALL
-		      (NEW_DVAR(e), idLT, new_ary(NEW_DVAR(_self), 0)),
+		      (NEW_DVAR(e), '<', new_ary(NEW_DVAR(_self), 0)),
 		      new_block(NEW_OPTBLOCK(node),
 				NEW_DASGN(e,
 					  NEW_CALL(NEW_DVAR(e), idSucc,
0))), @@ -164,7 +164,7 @@
 	node =
 	    new_block(NEW_DASGN(_e, NEW_DVAR(e)),
 		      NEW_WHILE(NEW_CALL
-				(NEW_DVAR(_e), idLT,
+				(NEW_DVAR(_e), '<',
 				 new_ary(NEW_DVAR(_self), 0)),
 				new_block(assign,
 					  new_block(NEW_OPTBLOCK(node),
@@ -290,7 +290,7 @@
 			 VALUE param_vars, VALUE local_vars)
 {
     return build_Range_each_node(iseq, node, lnode,
-				 param_vars, local_vars, idLT);
+				 param_vars, local_vars, '<');
 }
 
 VALUE
@@ -375,7 +375,7 @@
 
 	node =
 	    new_block(NEW_DASGN(_i, NEW_LIT(INT2FIX(0))),
-		      NEW_WHILE(NEW_CALL(NEW_DVAR(_i), idLT,
+		      NEW_WHILE(NEW_CALL(NEW_DVAR(_i), '<',
 					 new_ary(NEW_CALL
 						 (NEW_DVAR(_self),
idLength, 0), 0)),
@@ -406,7 +406,7 @@
 
 	node =
 	    new_block(NEW_DASGN(_i, NEW_LIT(INT2FIX(0))),
-		      NEW_WHILE(NEW_CALL(NEW_DVAR(_i), idLT,
+		      NEW_WHILE(NEW_CALL(NEW_DVAR(_i), '<',
 					 new_ary(NEW_CALL
 						 (NEW_DVAR(_self),
idLength, 0), 0)), new_block(assign,
Index: compile.c
===================================================================
--- compile.c	(revision 14559)
+++ compile.c	(working copy)
@@ -1451,26 +1451,26 @@
 		else if (mid == idSucc) {
 		    insn_set_specialized_instruction(iobj, BIN(opt_succ));
 		}
-		else if (mid == idNot) {
+		else if (mid == '!') {
 		    insn_set_specialized_instruction_with_ic(iobj, BIN
(opt_not), 1); }
 	    }
 	    else if (argc == 1) {
 		if (0) {
 		}
-		else if (mid == idPLUS) {
+		else if (mid == '+') {
 		    insn_set_specialized_instruction(iobj, BIN(opt_plus));
 		}
-		else if (mid == idMINUS) {
+		else if (mid == '-') {
 		    insn_set_specialized_instruction(iobj, BIN(opt_minus));
 		}
-		else if (mid == idMULT) {
+		else if (mid == '*') {
 		    insn_set_specialized_instruction(iobj, BIN(opt_mult));
 		}
-		else if (mid == idDIV) {
+		else if (mid == '/') {
 		    insn_set_specialized_instruction(iobj, BIN(opt_div));
 		}
-		else if (mid == idMOD) {
+		else if (mid == '%') {
 		    insn_set_specialized_instruction(iobj, BIN(opt_mod));
 		}
 		else if (mid == idEq) {
@@ -1479,13 +1479,13 @@
 		else if (mid == idNeq) {
 		    insn_set_specialized_instruction_with_ic(iobj, BIN
(opt_neq), 2); }
-		else if (mid == idLT) {
+		else if (mid == '<') {
 		    insn_set_specialized_instruction(iobj, BIN(opt_lt));
 		}
 		else if (mid == idLE) {
 		    insn_set_specialized_instruction(iobj, BIN(opt_le));
 		}
-		else if (mid == idGT) {
+		else if (mid == '>') {
 		    insn_set_specialized_instruction(iobj, BIN(opt_gt));
 		}
 		else if (mid == idGE) {
@@ -3996,7 +3996,7 @@
       case NODE_XSTR:{
 	ADD_CALL_RECEIVER(ret, nd_line(node));
 	ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
-	ADD_CALL(ret, nd_line(node), ID2SYM(idBackquote), INT2FIX(1));
+	ADD_CALL(ret, nd_line(node), ID2SYM('`'), INT2FIX(1));
 
 	if (poped) {
 	    ADD_INSN(ret, nd_line(node), pop);
@@ -4006,7 +4006,7 @@
       case NODE_DXSTR:{
 	ADD_CALL_RECEIVER(ret, nd_line(node));
 	compile_dstr(iseq, ret, node);
-	ADD_CALL(ret, nd_line(node), ID2SYM(idBackquote), INT2FIX(1));
+	ADD_CALL(ret, nd_line(node), ID2SYM('`'), INT2FIX(1));
 
 	if (poped) {
 	    ADD_INSN(ret, nd_line(node), pop);
Index: id.c
===================================================================
--- id.c	(revision 14559)
+++ id.c	(working copy)
@@ -19,33 +19,19 @@
 void
 Init_id(void)
 {
-    /* Symbols */
-    symIFUNC = ID2SYM(rb_intern("<IFUNC>"));
-    symCFUNC = ID2SYM(rb_intern("<CFUNC>"));
-
     /* IDs */
-    idPLUS = rb_intern("+");
-    idMINUS = rb_intern("-");
-    idMULT = rb_intern("*");
-    idDIV = rb_intern("/");
-    idMOD = rb_intern("%");
-    idLT = rb_intern("<");
     idLTLT = rb_intern("<<");
     idLE = rb_intern("<=");
-    idGT = rb_intern(">");
     idGE = rb_intern(">=");
     idEq = rb_intern("==");
     idEqq = rb_intern("===");
-    idBackquote = rb_intern("`");
     idEqTilde = rb_intern("=~");
-    idNot = rb_intern("!");
     idNeq = rb_intern("!=");
 
     idAREF = rb_intern("[]");
     idASET = rb_intern("[]=");
 
     idEach = rb_intern("each");
-    idTimes = rb_intern("times");
     idLength = rb_intern("length");
     idLambda = rb_intern("lambda");
     idIntern = rb_intern("intern");
Index: id.h
===================================================================
--- id.h	(revision 14559)
+++ id.h	(working copy)
@@ -10,24 +10,12 @@
 
 **********************************************************************/
 
-extern VALUE symIFUNC;
-extern VALUE symCFUNC;
-
-extern ID idPLUS;
-extern ID idMINUS;
-extern ID idMULT;
-extern ID idDIV;
-extern ID idMOD;
-extern ID idLT;
 extern ID idLTLT;
 extern ID idLE;
-extern ID idGT;
 extern ID idGE;
 extern ID idEq;
 extern ID idEqq;
 extern ID idNeq;
-extern ID idNot;
-extern ID idBackquote;
 extern ID idEqTilde;
 extern ID idThrowState;
 extern ID idAREF;
@@ -42,14 +30,12 @@
 extern ID idRangeEachLT;
 extern ID idRangeEachLE;
 extern ID idArrayEach;
-extern ID idTimes;
 extern ID idEnd;
 extern ID idBitblt;
 extern ID idAnswer;
 extern ID idSend;
 extern ID idSendBang;
 extern ID id__send;
-extern ID id__send_bang;
 extern ID id__send__;
 
 
Index: vm.c
===================================================================
--- vm.c	(revision 14559)
+++ vm.c	(working copy)
@@ -1004,21 +1004,22 @@
     vm_opt_method_table = st_init_numtable();
 
 #define OP(mid_, bop_) (mid = id##mid_, bop = BOP_##bop_)
+#define OP2(mid_, bop_) (mid = mid_, bop = BOP_##bop_)    
 #define C(k) add_opt_method(rb_c##k, mid, bop)
-    OP(PLUS, PLUS), (C(Fixnum), C(Float), C(String), C(Array));
-    OP(MINUS, MINUS), (C(Fixnum));
-    OP(MULT, MULT), (C(Fixnum), C(Float));
-    OP(DIV, DIV), (C(Fixnum), C(Float));
-    OP(MOD, MOD), (C(Fixnum), C(Float));
+    OP2('+', PLUS), (C(Fixnum), C(Float), C(String), C(Array));
+    OP2('-', MINUS), (C(Fixnum));
+    OP2('*', MULT), (C(Fixnum), C(Float));
+    OP2('/', DIV), (C(Fixnum), C(Float));
+    OP2('%', MOD), (C(Fixnum), C(Float));
     OP(Eq, EQ), (C(Fixnum), C(Float), C(String));
-    OP(LT, LT), (C(Fixnum));
+    OP2('<', LT), (C(Fixnum));
     OP(LE, LE), (C(Fixnum));
     OP(LTLT, LTLT), (C(String), C(Array));
     OP(AREF, AREF), (C(Array), C(Hash));
     OP(ASET, ASET), (C(Array), C(Hash));
     OP(Length, LENGTH), (C(Array), C(String), C(Hash));
     OP(Succ, SUCC), (C(Fixnum), C(String), C(Time));
-    OP(GT, GT), (C(Fixnum));
+    OP2('>', GT), (C(Fixnum));
     OP(GE, GE), (C(Fixnum));
 #undef C
 #undef OP
Index: insns.def
===================================================================
--- insns.def	(revision 14559)
+++ insns.def	(working copy)
@@ -1395,7 +1395,7 @@
       INSN_LABEL(normal_dispatch):
 	PUSH(recv);
 	PUSH(obj);
-	CALL_SIMPLE_METHOD(1, idPLUS, recv);
+	CALL_SIMPLE_METHOD(1, '+', recv);
     }
 }
 
@@ -1429,7 +1429,7 @@
 	/* other */
 	PUSH(recv);
 	PUSH(obj);
-	CALL_SIMPLE_METHOD(1, idMINUS, recv);
+	CALL_SIMPLE_METHOD(1, '-', recv);
     }
 }
 
@@ -1482,7 +1482,7 @@
       INSN_LABEL(normal_dispatch):
 	PUSH(recv);
 	PUSH(obj);
-	CALL_SIMPLE_METHOD(1, idMULT, recv);
+	CALL_SIMPLE_METHOD(1, '*', recv);
     }
 }
 
@@ -1546,7 +1546,7 @@
       INSN_LABEL(normal_dispatch):
 	PUSH(recv);
 	PUSH(obj);
-	CALL_SIMPLE_METHOD(1, idDIV, recv);
+	CALL_SIMPLE_METHOD(1, '/', recv);
     }
 }
 
@@ -1625,7 +1625,7 @@
       INSN_LABEL(normal_dispatch):
 	PUSH(recv);
 	PUSH(obj);
-	CALL_SIMPLE_METHOD(1, idMOD, recv);
+	CALL_SIMPLE_METHOD(1, '%', recv);
     }
 }
 
@@ -1706,7 +1706,7 @@
     else {
 	PUSH(recv);
 	PUSH(obj);
-	CALL_SIMPLE_METHOD(1, idLT, recv);
+	CALL_SIMPLE_METHOD(1, '<', recv);
     }
 }
 
@@ -1765,7 +1765,7 @@
     else {
 	PUSH(recv);
 	PUSH(obj);
-	CALL_SIMPLE_METHOD(1, idGT, recv);
+	CALL_SIMPLE_METHOD(1, '>', recv);
     }
 }
 
@@ -1988,14 +1988,14 @@
 (VALUE val)
 {
     extern VALUE rb_obj_not(VALUE obj);
-    NODE *mn = vm_method_search(idNot, CLASS_OF(recv), ic);
+    NODE *mn = vm_method_search('!', CLASS_OF(recv), ic);
 
     if (check_cfunc(mn, rb_obj_not)) {
 	val = RTEST(recv) ? Qfalse : Qtrue;
     }
     else {
 	PUSH(recv);
-	CALL_SIMPLE_METHOD(0, idNot, recv);
+	CALL_SIMPLE_METHOD(0, '!', recv);
     }
 }
 

-- 
Tadashi Saito

In This Thread

Prev Next