From 0362ad83a7c1852d638915859ca56f49d39fb8ac Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 17 May 2016 06:53:48 +0000 Subject: [Feature #12005] Unify Fixnum and Bignum into Integer * [Feature #12005] Unify Fixnum and Bignum into Integer * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums. * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG. * vm_core.h: Ditto. * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead of FIXNUM_REDEFINED_OP_FLAG. * vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of rb_cFixnum and rb_cBignum. (C): Use Integer instead of Fixnum and Bignum. * numeric.c (fix_succ): Removed. (Init_Numeric): Define Fixnum as Integer. * bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum. (rb_int_coerce): replaced from rb_big_coerce and return fixnums as-is. (Init_Bignum): Define Bignum as Integer. Don't define ===. * error.c (builtin_class_name): Return "Integer" for fixnums. * sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum. * ext/-test-/testutil: New directory to test. Currently it provides utilities for fixnum and bignum. * ext/json/generator/generator.c: Define mInteger_to_json. * lib/mathn.rb (Fixnum#/): Redefinition removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index 5c1e718efe..9ae72477e2 100644 --- a/vm_core.h +++ b/vm_core.h @@ -569,12 +569,12 @@ typedef struct rb_vm_struct { #define RUBY_VM_FIBER_MACHINE_STACK_SIZE_MIN ( 16 * 1024 * sizeof(VALUE)) /* 64 KB or 128 KB */ /* optimize insn */ -#define FIXNUM_REDEFINED_OP_FLAG (1 << 0) +#define INTEGER_REDEFINED_OP_FLAG (1 << 0) #define FLOAT_REDEFINED_OP_FLAG (1 << 1) #define STRING_REDEFINED_OP_FLAG (1 << 2) #define ARRAY_REDEFINED_OP_FLAG (1 << 3) #define HASH_REDEFINED_OP_FLAG (1 << 4) -#define BIGNUM_REDEFINED_OP_FLAG (1 << 5) +/* #define BIGNUM_REDEFINED_OP_FLAG (1 << 5) */ #define SYMBOL_REDEFINED_OP_FLAG (1 << 6) #define TIME_REDEFINED_OP_FLAG (1 << 7) #define REGEXP_REDEFINED_OP_FLAG (1 << 8) -- cgit v1.2.3