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

ruby-changes:60464

From: Nobuyoshi <ko1@a...>
Date: Sat, 21 Mar 2020 17:08:23 +0900 (JST)
Subject: [ruby-changes:60464] 5b287481be (master): Removed non-RUBY_INTEGER_UNIFICATION code

https://git.ruby-lang.org/ruby.git/commit/?id=5b287481be

From 5b287481befe03cc3e3dbc4b5571e21dbc523bae Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 21 Mar 2020 16:59:55 +0900
Subject: Removed non-RUBY_INTEGER_UNIFICATION code


diff --git a/array.c b/array.c
index 0686eec..69f3f57 100644
--- a/array.c
+++ b/array.c
@@ -2760,7 +2760,7 @@ sort_2(const void *ap, const void *bp, void *dummy) https://github.com/ruby/ruby/blob/trunk/array.c#L2760
     VALUE a = *(const VALUE *)ap, b = *(const VALUE *)bp;
     int n;
 
-    if (FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data->cmp_opt, Fixnum)) {
+    if (FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data->cmp_opt, Integer)) {
 	if ((long)a > (long)b) return 1;
 	if ((long)a < (long)b) return -1;
 	return 0;
diff --git a/bignum.c b/bignum.c
index 8eea0a1..8b6a1e9 100644
--- a/bignum.c
+++ b/bignum.c
@@ -45,9 +45,6 @@ https://github.com/ruby/ruby/blob/trunk/bignum.c#L45
 
 #define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
 
-#ifndef RUBY_INTEGER_UNIFICATION
-VALUE rb_cBignum;
-#endif
 const char ruby_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz";
 
 #ifndef SIZEOF_BDIGIT_DBL
@@ -7190,9 +7187,6 @@ rb_int_powm(int const argc, VALUE * const argv, VALUE const num) https://github.com/ruby/ruby/blob/trunk/bignum.c#L7187
 void
 Init_Bignum(void)
 {
-#ifndef RUBY_INTEGER_UNIFICATION
-    rb_cBignum = rb_cInteger;
-#endif
     /* An obsolete class, use Integer */
     rb_define_const(rb_cObject, "Bignum", rb_cInteger);
     rb_deprecate_constant(rb_cObject, "Bignum");
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index b835bd6..395bdb9 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1956,9 +1956,6 @@ RUBY_EXTERN VALUE rb_mWaitWritable; https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1956
 RUBY_EXTERN VALUE rb_cBasicObject;
 RUBY_EXTERN VALUE rb_cObject;
 RUBY_EXTERN VALUE rb_cArray;
-#ifndef RUBY_INTEGER_UNIFICATION
-RUBY_EXTERN VALUE rb_cBignum;
-#endif
 RUBY_EXTERN VALUE rb_cBinding;
 RUBY_EXTERN VALUE rb_cClass;
 RUBY_EXTERN VALUE rb_cCont;
@@ -1968,9 +1965,6 @@ RUBY_EXTERN VALUE rb_cEncoding; https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1965
 RUBY_EXTERN VALUE rb_cEnumerator;
 RUBY_EXTERN VALUE rb_cFalseClass;
 RUBY_EXTERN VALUE rb_cFile;
-#ifndef RUBY_INTEGER_UNIFICATION
-RUBY_EXTERN VALUE rb_cFixnum;
-#endif
 RUBY_EXTERN VALUE rb_cComplex;
 RUBY_EXTERN VALUE rb_cFloat;
 RUBY_EXTERN VALUE rb_cHash;
diff --git a/internal/compar.h b/internal/compar.h
index 6a689ed..a2808d6 100644
--- a/internal/compar.h
+++ b/internal/compar.h
@@ -9,18 +9,12 @@ https://github.com/ruby/ruby/blob/trunk/internal/compar.h#L9
  *             modify this file, provided that  the conditions mentioned in the
  *             file COPYING are met.  Consult the file for details.
  */
-#include "ruby/ruby.h"          /* for RUBY_INTEGER_UNIFICATION */
 #include "internal/vm.h"        /* for rb_method_basic_definition_p */
 
 #define STRING_P(s) (RB_TYPE_P((s), T_STRING) && CLASS_OF(s) == rb_cString)
 
-#ifdef RUBY_INTEGER_UNIFICATION
-# define rb_cFixnum rb_cInteger
-# define rb_cBignum rb_cInteger
-#endif
-
 enum {
-    cmp_opt_Fixnum,
+    cmp_opt_Integer,
     cmp_opt_String,
     cmp_opt_Float,
     cmp_optimizable_count
@@ -42,7 +36,7 @@ struct cmp_opt_data { https://github.com/ruby/ruby/blob/trunk/internal/compar.h#L36
       ((data).opt_methods |= CMP_OPTIMIZABLE_BIT(type))))
 
 #define OPTIMIZED_CMP(a, b, data) \
-    ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data, Fixnum)) ? \
+    ((FIXNUM_P(a) && FIXNUM_P(b) && CMP_OPTIMIZABLE(data, Integer)) ? \
      (((long)a > (long)b) ? 1 : ((long)a < (long)b) ? -1 : 0) : \
      (STRING_P(a) && STRING_P(b) && CMP_OPTIMIZABLE(data, String)) ? \
      rb_str_cmp(a, b) : \
diff --git a/numeric.c b/numeric.c
index b418382..f177788 100644
--- a/numeric.c
+++ b/numeric.c
@@ -192,9 +192,6 @@ static ID id_coerce; https://github.com/ruby/ruby/blob/trunk/numeric.c#L192
 VALUE rb_cNumeric;
 VALUE rb_cFloat;
 VALUE rb_cInteger;
-#ifndef RUBY_INTEGER_UNIFICATION
-VALUE rb_cFixnum;
-#endif
 
 VALUE rb_eZeroDivError;
 VALUE rb_eFloatDomainError;
@@ -5687,9 +5684,6 @@ Init_Numeric(void) https://github.com/ruby/ruby/blob/trunk/numeric.c#L5684
     rb_define_method(rb_cInteger, "bit_length", rb_int_bit_length, 0);
     rb_define_method(rb_cInteger, "digits", rb_int_digits, -1);
 
-#ifndef RUBY_INTEGER_UNIFICATION
-    rb_cFixnum = rb_cInteger;
-#endif
     /* An obsolete class, use Integer */
     rb_define_const(rb_cObject, "Fixnum", rb_cInteger);
     rb_deprecate_constant(rb_cObject, "Fixnum");
diff --git a/spec/ruby/optional/capi/ext/constants_spec.c b/spec/ruby/optional/capi/ext/constants_spec.c
index c8ae843..6f1e03f 100644
--- a/spec/ruby/optional/capi/ext/constants_spec.c
+++ b/spec/ruby/optional/capi/ext/constants_spec.c
@@ -9,12 +9,6 @@ static VALUE constants_spec_rb_cArray(VALUE self) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/constants_spec.c#L9
   return rb_cArray;
 }
 
-#ifndef RUBY_INTEGER_UNIFICATION
-static VALUE constants_spec_rb_cBignum(VALUE self) {
-  return rb_cBignum;
-}
-#endif
-
 static VALUE constants_spec_rb_cClass(VALUE self) {
   return rb_cClass;
 }
@@ -31,12 +25,6 @@ static VALUE constants_spec_rb_cFile(VALUE self) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/constants_spec.c#L25
   return rb_cFile;
 }
 
-#ifndef RUBY_INTEGER_UNIFICATION
-static VALUE constants_spec_rb_cFixnum(VALUE self) {
-  return rb_cFixnum;
-}
-#endif
-
 static VALUE constants_spec_rb_cFloat(VALUE self) {
   return rb_cFloat;
 }
@@ -264,17 +252,11 @@ static VALUE constants_spec_rb_cDir(VALUE self) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/constants_spec.c#L252
 void Init_constants_spec(void) {
   VALUE cls = rb_define_class("CApiConstantsSpecs", rb_cObject);
   rb_define_method(cls, "rb_cArray", constants_spec_rb_cArray, 0);
-#ifndef RUBY_INTEGER_UNIFICATION
-  rb_define_method(cls, "rb_cBignum", constants_spec_rb_cBignum, 0);
-#endif
 
   rb_define_method(cls, "rb_cClass", constants_spec_rb_cClass, 0);
   rb_define_method(cls, "rb_cData", constants_spec_rb_cData, 0);
   rb_define_method(cls, "rb_cFalseClass", constants_spec_rb_cFalseClass, 0);
   rb_define_method(cls, "rb_cFile", constants_spec_rb_cFile, 0);
-#ifndef RUBY_INTEGER_UNIFICATION
-  rb_define_method(cls, "rb_cFixnum", constants_spec_rb_cFixnum, 0);
-#endif
 
   rb_define_method(cls, "rb_cFloat", constants_spec_rb_cFloat, 0);
   rb_define_method(cls, "rb_cHash", constants_spec_rb_cHash, 0);
-- 
cgit v0.10.2


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

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