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

ruby-changes:29630

From: nagachika <ko1@a...>
Date: Fri, 28 Jun 2013 02:32:49 +0900 (JST)
Subject: [ruby-changes:29630] nagachika:r41682 (ruby_2_0_0): merge revision(s) 40336: [Backport #8142]

nagachika	2013-06-28 02:32:35 +0900 (Fri, 28 Jun 2013)

  New Revision: 41682

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

  Log:
    merge revision(s) 40336: [Backport #8142]
    
    * compile.c (iseq_add_mark_object): Use new rb_iseq_add_mark_object().
    
    * insns.def (setinlinecache): Ditto.
    
    * iseq.c (rb_iseq_add_mark_object): New function to allocate
      iseq->mark_ary on demand. [Bug #8142]
    
    * iseq.h (rb_iseq_add_mark_object): Ditto.
    
    * iseq.c (prepare_iseq_build): Avoid allocating mark_ary until needed.
    
    * iseq.c (rb_iseq_build_for_ruby2cext): Ditto.

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/compile.c
    branches/ruby_2_0_0/insns.def
    branches/ruby_2_0_0/iseq.c
    branches/ruby_2_0_0/iseq.h
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 41681)
+++ ruby_2_0_0/ChangeLog	(revision 41682)
@@ -1,3 +1,18 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Fri Jun 28 02:20:13 2013  Aman Gupta  <ruby@t...>
+
+	* compile.c (iseq_add_mark_object): Use new rb_iseq_add_mark_object().
+
+	* insns.def (setinlinecache): Ditto.
+
+	* iseq.c (rb_iseq_add_mark_object): New function to allocate
+	  iseq->mark_ary on demand. [Bug #8142]
+
+	* iseq.h (rb_iseq_add_mark_object): Ditto.
+
+	* iseq.c (prepare_iseq_build): Avoid allocating mark_ary until needed.
+
+	* iseq.c (rb_iseq_build_for_ruby2cext): Ditto.
+
 Thu Jun 27 20:10:56 2013  CHIKANAGA Tomoyuki  <nagachika@r...>
 
 	* ext/openssl/lib/openssl/ssl.rb (verify_certificate_identity): fix
Index: ruby_2_0_0/insns.def
===================================================================
--- ruby_2_0_0/insns.def	(revision 41681)
+++ ruby_2_0_0/insns.def	(revision 41682)
@@ -1237,7 +1237,7 @@ setinlinecache https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/insns.def#L1237
 (VALUE val)
 {
     if (ic->ic_value.value == Qundef) {
-	rb_ary_push(GET_ISEQ()->mark_ary, val);
+	rb_iseq_add_mark_object(GET_ISEQ(), val);
     }
     ic->ic_value.value = val;
     ic->ic_vmstat = GET_VM_STATE_VERSION() - ruby_vm_const_missing_count;
Index: ruby_2_0_0/iseq.c
===================================================================
--- ruby_2_0_0/iseq.c	(revision 41681)
+++ ruby_2_0_0/iseq.c	(revision 41682)
@@ -237,6 +237,17 @@ set_relation(rb_iseq_t *iseq, const VALU https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/iseq.c#L237
     }
 }
 
+void
+rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj)
+{
+    if (!RTEST(iseq->mark_ary)) {
+	iseq->mark_ary = rb_ary_tmp_new(3);
+	OBJ_UNTRUST(iseq->mark_ary);
+	RBASIC(iseq->mark_ary)->klass = 0;
+    }
+    rb_ary_push(iseq->mark_ary, obj);
+}
+
 static VALUE
 prepare_iseq_build(rb_iseq_t *iseq,
 		   VALUE name, VALUE path, VALUE absolute_path, VALUE first_lineno,
@@ -259,9 +270,7 @@ prepare_iseq_build(rb_iseq_t *iseq, https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/iseq.c#L270
     }
 
     iseq->defined_method_id = 0;
-    iseq->mark_ary = rb_ary_tmp_new(3);
-    OBJ_UNTRUST(iseq->mark_ary);
-    RBASIC(iseq->mark_ary)->klass = 0;
+    iseq->mark_ary = 0;
 
 
     /*
@@ -2047,8 +2056,7 @@ rb_iseq_build_for_ruby2cext( https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/iseq.c#L2056
     iseq->location.label = rb_str_new2(name);
     iseq->location.path = rb_str_new2(path);
     iseq->location.first_lineno = first_lineno;
-    iseq->mark_ary = rb_ary_tmp_new(3);
-    OBJ_UNTRUST(iseq->mark_ary);
+    iseq->mark_ary = 0;
     iseq->self = iseqval;
 
     iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);
Index: ruby_2_0_0/iseq.h
===================================================================
--- ruby_2_0_0/iseq.h	(revision 41681)
+++ ruby_2_0_0/iseq.h	(revision 41682)
@@ -23,6 +23,7 @@ VALUE rb_iseq_build_from_ary(rb_iseq_t * https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/iseq.h#L23
 			     VALUE exception, VALUE body);
 
 /* iseq.c */
+void rb_iseq_add_mark_object(rb_iseq_t *iseq, VALUE obj);
 VALUE rb_iseq_load(VALUE data, VALUE parent, VALUE opt);
 VALUE rb_iseq_parameters(const rb_iseq_t *iseq, int is_proc);
 struct st_table *ruby_insn_make_insn_table(void);
Index: ruby_2_0_0/compile.c
===================================================================
--- ruby_2_0_0/compile.c	(revision 41681)
+++ ruby_2_0_0/compile.c	(revision 41682)
@@ -416,7 +416,7 @@ static int https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/compile.c#L416
 iseq_add_mark_object(rb_iseq_t *iseq, VALUE v)
 {
     if (!SPECIAL_CONST_P(v)) {
-	rb_ary_push(iseq->mark_ary, v);
+	rb_iseq_add_mark_object(iseq, v);
     }
     return COMPILE_OK;
 }
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 41681)
+++ ruby_2_0_0/version.h	(revision 41682)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
-#define RUBY_RELEASE_DATE "2013-06-27"
-#define RUBY_PATCHLEVEL 247
+#define RUBY_RELEASE_DATE "2013-06-28"
+#define RUBY_PATCHLEVEL 248
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 27
+#define RUBY_RELEASE_DAY 28
 
 #include "ruby/version.h"
 

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r40336


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

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