summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-20 23:49:31 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-11-20 23:49:31 +0000
commitba772af0a6b36713077799e5c5cbcb375d4ee1c8 (patch)
treefdd4d99a31b59f1bd4f08b5ec7d0b7537339a1c8 /insns.def
parent894352164853a4851f215d1f082a1627c80a43ea (diff)
* compile.c (iseq_compile_each): add debug information to NODE_STR
strings as default. [Feature #11725] * insns.def (freezestring): add new instruction to support adding debug information for dynamically constracted strings. * compile.c (iseq_compile_each): support adding debug information for NODE_DSTR with freezestring instruction. * error.c (rb_error_frozen): change the debug information ID name id_debug_created_info and this field should have a 2 element array containing path and line information. * defs/id.def: ditto. * test/ruby/test_rubyoptions.rb: catch up this fix. * test/ruby/test_iseq.rb: now frozen strings are not same. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def17
1 files changed, 17 insertions, 0 deletions
diff --git a/insns.def b/insns.def
index 33aedfc83d..36a132b585 100644
--- a/insns.def
+++ b/insns.def
@@ -391,6 +391,23 @@ tostring
/**
@c put
+ @e Freeze (dynamically) created strings.
+ @j (埋め込み)文字列を freeze する。もし、debug_info が与えられていれば、それを設定する。
+ */
+DEFINE_INSN
+freezestring
+(VALUE debug_info)
+(VALUE str)
+(VALUE str)
+{
+ if (!NIL_P(debug_info)) {
+ rb_ivar_set(str, id_debug_created_info, debug_info);
+ }
+ rb_str_freeze(str);
+}
+
+/**
+ @c put
@e to Regexp
@j 文字列 str を正規表現にコンパイルしてスタックにプッシュする。
コンパイル時,opt を正規表現のオプションとする。