[前][次][番号順一覧][スレッド一覧]

ruby-changes:40219

From: nobu <ko1@a...>
Date: Tue, 27 Oct 2015 17:07:19 +0900 (JST)
Subject: [ruby-changes:40219] nobu:r52300 (trunk): id.def: internal IDs

nobu	2015-10-27 17:06:58 +0900 (Tue, 27 Oct 2015)

  New Revision: 52300

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52300

  Log:
    id.def: internal IDs
    
    * defs/id.def: move internal IDs for frozen-string-literal-debug.

  Modified files:
    trunk/ChangeLog
    trunk/compile.c
    trunk/defs/id.def
    trunk/error.c
Index: defs/id.def
===================================================================
--- defs/id.def	(revision 52299)
+++ defs/id.def	(revision 52300)
@@ -60,6 +60,9 @@ firstline, predefined = __LINE__+1, %[\ https://github.com/ruby/ruby/blob/trunk/defs/id.def#L60
   core#hash_merge_ary
   core#hash_merge_ptr
   core#hash_merge_kwd
+
+  debug#created_path
+  debug#created_line
 ]
 
 class KeywordError < RuntimeError
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52299)
+++ ChangeLog	(revision 52300)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Oct 27 17:06:55 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* defs/id.def: move internal IDs for frozen-string-literal-debug.
+
 Tue Oct 27 16:41:05 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* error.c (rb_error_frozen_object): use rb_attr_get instead of
Index: compile.c
===================================================================
--- compile.c	(revision 52299)
+++ compile.c	(revision 52300)
@@ -5116,8 +5116,8 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L5116
 		}
 		else {
 		    VALUE str = rb_str_dup(node->nd_lit);
-		    rb_iv_set(str, "__object_created_path__", iseq->body->location.path);
-		    rb_iv_set(str, "__object_created_line__", INT2FIX(line));
+		    rb_ivar_set(str, id_debug_created_path, iseq->body->location.path);
+		    rb_ivar_set(str, id_debug_created_line, INT2FIX(line));
 		    ADD_INSN1(ret, line, putobject, rb_obj_freeze(str));
 		}
 	    }
Index: error.c
===================================================================
--- error.c	(revision 52299)
+++ error.c	(revision 52300)
@@ -2227,10 +2227,9 @@ void https://github.com/ruby/ruby/blob/trunk/error.c#L2227
 rb_error_frozen_object(VALUE frozen_obj)
 {
     VALUE path, line;
-    ID created_path, created_line;
+    const ID created_path = id_debug_created_path;
+    const ID created_line = id_debug_created_line;
 
-    CONST_ID(created_path, "__object_created_path__");
-    CONST_ID(created_line, "__object_created_line__");
     if (!NIL_P(path = rb_attr_get(frozen_obj, created_path)) &&
 	!NIL_P(line = rb_attr_get(frozen_obj, created_line))) {
 	rb_raise(rb_eRuntimeError, "can't modify frozen %"PRIsVALUE", created at %"PRIsVALUE":%"PRIsVALUE,

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]