2011-05-18 17:41:54 +04:00
|
|
|
/**********************************************************************
|
|
|
|
|
|
|
|
internal.h -
|
|
|
|
|
|
|
|
$Author$
|
|
|
|
created at: Tue May 17 11:42:20 JST 2011
|
|
|
|
|
|
|
|
Copyright (C) 2011 Yukihiro Matsumoto
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
#ifndef RUBY_INTERNAL_H
|
|
|
|
#define RUBY_INTERNAL_H 1
|
|
|
|
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#if 0
|
|
|
|
} /* satisfy cc-mode */
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2013-08-06 07:26:34 +04:00
|
|
|
#ifdef HAVE_VALGRIND_MEMCHECK_H
|
|
|
|
# include <valgrind/memcheck.h>
|
|
|
|
# ifndef VALGRIND_MAKE_MEM_DEFINED
|
|
|
|
# define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n))
|
|
|
|
# endif
|
|
|
|
# ifndef VALGRIND_MAKE_MEM_UNDEFINED
|
|
|
|
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n))
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
# define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
|
|
|
|
# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
|
|
|
|
#endif
|
|
|
|
|
* internal.h (numberof): Gathered from various files.
* array.c, math.c, thread_pthread.c, iseq.c, enum.c, string.c, io.c,
load.c, compile.c, struct.c, eval.c, gc.c, parse.y, process.c,
error.c, ruby.c: Remove the definitions of numberof.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-07 14:01:19 +04:00
|
|
|
#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
|
|
|
|
|
2013-07-10 15:47:54 +04:00
|
|
|
#define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
|
|
|
|
|
2013-04-12 16:01:51 +04:00
|
|
|
#define GCC_VERSION_SINCE(major, minor, patchlevel) \
|
|
|
|
(defined(__GNUC__) && !defined(__INTEL_COMPILER) && \
|
|
|
|
((__GNUC__ > (major)) || \
|
|
|
|
(__GNUC__ == (major) && __GNUC_MINOR__ > (minor)) || \
|
|
|
|
(__GNUC__ == (major) && __GNUC_MINOR__ == (minor) && __GNUC_PATCHLEVEL__ >= (patchlevel))))
|
|
|
|
|
2013-04-27 10:52:17 +04:00
|
|
|
#define SIGNED_INTEGER_TYPE_P(int_type) (0 > ((int_type)0)-1)
|
|
|
|
#define SIGNED_INTEGER_MAX(sint_type) \
|
2013-07-03 19:36:10 +04:00
|
|
|
(sint_type) \
|
2013-04-27 10:52:17 +04:00
|
|
|
((((sint_type)1) << (sizeof(sint_type) * CHAR_BIT - 2)) | \
|
|
|
|
((((sint_type)1) << (sizeof(sint_type) * CHAR_BIT - 2)) - 1))
|
|
|
|
#define SIGNED_INTEGER_MIN(sint_type) (-SIGNED_INTEGER_MAX(sint_type)-1)
|
|
|
|
#define UNSIGNED_INTEGER_MAX(uint_type) (~(uint_type)0)
|
|
|
|
|
2013-03-27 00:15:44 +04:00
|
|
|
#if SIGNEDNESS_OF_TIME_T < 0 /* signed */
|
2013-04-27 10:52:17 +04:00
|
|
|
# define TIMET_MAX SIGNED_INTEGER_MAX(time_t)
|
|
|
|
# define TIMET_MIN SIGNED_INTEGER_MIN(time_t)
|
2013-03-27 00:15:44 +04:00
|
|
|
#elif SIGNEDNESS_OF_TIME_T > 0 /* unsigned */
|
2013-04-27 10:52:17 +04:00
|
|
|
# define TIMET_MAX UNSIGNED_INTEGER_MAX(time_t)
|
|
|
|
# define TIMET_MIN ((time_t)0)
|
2013-03-27 00:15:44 +04:00
|
|
|
#endif
|
2013-03-27 07:03:36 +04:00
|
|
|
#define TIMET_MAX_PLUS_ONE (2*(double)(TIMET_MAX/2+1))
|
2013-03-26 19:30:27 +04:00
|
|
|
|
2013-04-09 15:39:53 +04:00
|
|
|
#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \
|
|
|
|
(a) == 0 ? 0 : \
|
|
|
|
(a) == -1 ? (b) < -(max) : \
|
|
|
|
(a) > 0 ? \
|
|
|
|
((b) > 0 ? (max) / (a) < (b) : (min) / (a) > (b)) : \
|
|
|
|
((b) > 0 ? (min) / (a) < (b) : (max) / (a) > (b)))
|
|
|
|
#define MUL_OVERFLOW_FIXNUM_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX)
|
|
|
|
#define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX)
|
2013-04-10 01:37:04 +04:00
|
|
|
#define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX)
|
2013-04-09 15:39:53 +04:00
|
|
|
|
2013-06-21 21:22:14 +04:00
|
|
|
#ifndef swap16
|
|
|
|
# define swap16(x) ((uint16_t)((((x)&0xFF)<<8) | (((x)>>8)&0xFF)))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef swap32
|
2013-07-14 18:28:33 +04:00
|
|
|
# ifdef HAVE_BUILTIN___BUILTIN_BSWAP32
|
2013-06-21 21:22:14 +04:00
|
|
|
# define swap32(x) __builtin_bswap32(x)
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef swap32
|
|
|
|
# define swap32(x) ((uint32_t)((((x)&0xFF)<<24) \
|
|
|
|
|(((x)>>24)&0xFF) \
|
|
|
|
|(((x)&0x0000FF00)<<8) \
|
|
|
|
|(((x)&0x00FF0000)>>8) ))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef swap64
|
2013-07-14 18:28:33 +04:00
|
|
|
# ifdef HAVE_BUILTIN___BUILTIN_BSWAP64
|
2013-06-21 21:22:14 +04:00
|
|
|
# define swap64(x) __builtin_bswap64(x)
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef swap64
|
|
|
|
# ifdef HAVE_INT64_T
|
|
|
|
# define byte_in_64bit(n) ((uint64_t)0xff << (n))
|
|
|
|
# define swap64(x) ((uint64_t)((((x)&byte_in_64bit(0))<<56) \
|
|
|
|
|(((x)>>56)&0xFF) \
|
|
|
|
|(((x)&byte_in_64bit(8))<<40) \
|
|
|
|
|(((x)&byte_in_64bit(48))>>40) \
|
|
|
|
|(((x)&byte_in_64bit(16))<<24) \
|
|
|
|
|(((x)&byte_in_64bit(40))>>24) \
|
|
|
|
|(((x)&byte_in_64bit(24))<<8) \
|
|
|
|
|(((x)&byte_in_64bit(32))>>8)))
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2013-09-01 04:57:00 +04:00
|
|
|
static inline int
|
|
|
|
nlz_int(unsigned int x)
|
|
|
|
{
|
|
|
|
#if defined(HAVE_BUILTIN___BUILTIN_CLZ)
|
|
|
|
if (x == 0) return SIZEOF_INT * CHAR_BIT;
|
|
|
|
return __builtin_clz(x);
|
|
|
|
#else
|
|
|
|
unsigned int y;
|
|
|
|
# if 64 < SIZEOF_INT * CHAR_BIT
|
|
|
|
int n = 128;
|
|
|
|
# elif 32 < SIZEOF_INT * CHAR_BIT
|
|
|
|
int n = 64;
|
|
|
|
# else
|
|
|
|
int n = 32;
|
|
|
|
# endif
|
|
|
|
# if 64 < SIZEOF_INT * CHAR_BIT
|
|
|
|
y = x >> 64; if (y) {n -= 64; x = y;}
|
|
|
|
# endif
|
|
|
|
# if 32 < SIZEOF_INT * CHAR_BIT
|
|
|
|
y = x >> 32; if (y) {n -= 32; x = y;}
|
|
|
|
# endif
|
|
|
|
y = x >> 16; if (y) {n -= 16; x = y;}
|
|
|
|
y = x >> 8; if (y) {n -= 8; x = y;}
|
|
|
|
y = x >> 4; if (y) {n -= 4; x = y;}
|
|
|
|
y = x >> 2; if (y) {n -= 2; x = y;}
|
|
|
|
y = x >> 1; if (y) {return n - 2;}
|
|
|
|
return (int)(n - x);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
nlz_long(unsigned long x)
|
|
|
|
{
|
|
|
|
#if defined(HAVE_BUILTIN___BUILTIN_CLZL)
|
|
|
|
if (x == 0) return SIZEOF_LONG * CHAR_BIT;
|
|
|
|
return __builtin_clzl(x);
|
|
|
|
#else
|
|
|
|
unsigned long y;
|
|
|
|
# if 64 < SIZEOF_LONG * CHAR_BIT
|
|
|
|
int n = 128;
|
|
|
|
# elif 32 < SIZEOF_LONG * CHAR_BIT
|
|
|
|
int n = 64;
|
|
|
|
# else
|
|
|
|
int n = 32;
|
|
|
|
# endif
|
|
|
|
# if 64 < SIZEOF_LONG * CHAR_BIT
|
|
|
|
y = x >> 64; if (y) {n -= 64; x = y;}
|
|
|
|
# endif
|
|
|
|
# if 32 < SIZEOF_LONG * CHAR_BIT
|
|
|
|
y = x >> 32; if (y) {n -= 32; x = y;}
|
|
|
|
# endif
|
|
|
|
y = x >> 16; if (y) {n -= 16; x = y;}
|
|
|
|
y = x >> 8; if (y) {n -= 8; x = y;}
|
|
|
|
y = x >> 4; if (y) {n -= 4; x = y;}
|
|
|
|
y = x >> 2; if (y) {n -= 2; x = y;}
|
|
|
|
y = x >> 1; if (y) {return n - 2;}
|
|
|
|
return (int)(n - x);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_LONG_LONG
|
|
|
|
static inline int
|
|
|
|
nlz_long_long(unsigned LONG_LONG x)
|
|
|
|
{
|
|
|
|
#if defined(HAVE_BUILTIN___BUILTIN_CLZLL)
|
|
|
|
if (x == 0) return SIZEOF_LONG_LONG * CHAR_BIT;
|
|
|
|
return __builtin_clzll(x);
|
|
|
|
#else
|
|
|
|
unsigned LONG_LONG y;
|
|
|
|
# if 64 < SIZEOF_LONG_LONG * CHAR_BIT
|
|
|
|
int n = 128;
|
|
|
|
# elif 32 < SIZEOF_LONG_LONG * CHAR_BIT
|
|
|
|
int n = 64;
|
|
|
|
# else
|
|
|
|
int n = 32;
|
|
|
|
# endif
|
|
|
|
# if 64 < SIZEOF_LONG_LONG * CHAR_BIT
|
|
|
|
y = x >> 64; if (y) {n -= 64; x = y;}
|
|
|
|
# endif
|
|
|
|
# if 32 < SIZEOF_LONG_LONG * CHAR_BIT
|
|
|
|
y = x >> 32; if (y) {n -= 32; x = y;}
|
|
|
|
# endif
|
|
|
|
y = x >> 16; if (y) {n -= 16; x = y;}
|
|
|
|
y = x >> 8; if (y) {n -= 8; x = y;}
|
|
|
|
y = x >> 4; if (y) {n -= 4; x = y;}
|
|
|
|
y = x >> 2; if (y) {n -= 2; x = y;}
|
|
|
|
y = x >> 1; if (y) {return n - 2;}
|
|
|
|
return (int)(n - x);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_UINT128_T
|
|
|
|
static inline int
|
|
|
|
nlz_int128(uint128_t x)
|
|
|
|
{
|
|
|
|
uint128_t y;
|
|
|
|
int n = 128;
|
|
|
|
y = x >> 64; if (y) {n -= 64; x = y;}
|
|
|
|
y = x >> 32; if (y) {n -= 32; x = y;}
|
|
|
|
y = x >> 16; if (y) {n -= 16; x = y;}
|
|
|
|
y = x >> 8; if (y) {n -= 8; x = y;}
|
|
|
|
y = x >> 4; if (y) {n -= 4; x = y;}
|
|
|
|
y = x >> 2; if (y) {n -= 2; x = y;}
|
|
|
|
y = x >> 1; if (y) {return n - 2;}
|
|
|
|
return (int)(n - x);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_UINT128_T)
|
|
|
|
# define bit_length(x) \
|
2013-09-03 02:29:48 +04:00
|
|
|
(sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)x) : \
|
|
|
|
sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)x) : \
|
|
|
|
sizeof(x) <= SIZEOF_LONG_LONG ? SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)x) : \
|
|
|
|
SIZEOF_INT128_T * CHAR_BIT - nlz_int128((uint128_t)x))
|
2013-09-01 04:57:00 +04:00
|
|
|
#elif defined(HAVE_LONG_LONG)
|
|
|
|
# define bit_length(x) \
|
2013-09-03 02:29:48 +04:00
|
|
|
(sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)x) : \
|
|
|
|
sizeof(x) <= SIZEOF_LONG ? SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)x) : \
|
|
|
|
SIZEOF_LONG_LONG * CHAR_BIT - nlz_long_long((unsigned LONG_LONG)x))
|
2013-09-01 04:57:00 +04:00
|
|
|
#else
|
|
|
|
# define bit_length(x) \
|
2013-09-03 02:29:48 +04:00
|
|
|
(sizeof(x) <= SIZEOF_INT ? SIZEOF_INT * CHAR_BIT - nlz_int((unsigned int)x) : \
|
|
|
|
SIZEOF_LONG * CHAR_BIT - nlz_long((unsigned long)x))
|
2013-09-01 04:57:00 +04:00
|
|
|
#endif
|
|
|
|
|
2011-06-18 07:05:11 +04:00
|
|
|
struct rb_deprecated_classext_struct {
|
|
|
|
char conflict[sizeof(VALUE) * 3];
|
|
|
|
};
|
|
|
|
|
2011-05-18 17:41:54 +04:00
|
|
|
struct rb_classext_struct {
|
|
|
|
VALUE super;
|
|
|
|
struct st_table *iv_tbl;
|
|
|
|
struct st_table *const_tbl;
|
2012-06-27 11:48:50 +04:00
|
|
|
VALUE origin;
|
2012-08-06 11:00:19 +04:00
|
|
|
VALUE refined_class;
|
2012-09-08 13:52:26 +04:00
|
|
|
rb_alloc_func_t allocator;
|
2011-05-18 17:41:54 +04:00
|
|
|
};
|
|
|
|
|
2011-06-18 07:05:11 +04:00
|
|
|
#define RCLASS_EXT(c) (RCLASS(c)->ptr)
|
|
|
|
#define RCLASS_IV_TBL(c) (RCLASS_EXT(c)->iv_tbl)
|
|
|
|
#define RCLASS_CONST_TBL(c) (RCLASS_EXT(c)->const_tbl)
|
|
|
|
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
|
|
|
|
#define RCLASS_IV_INDEX_TBL(c) (RCLASS(c)->iv_index_tbl)
|
2012-06-27 11:48:50 +04:00
|
|
|
#define RCLASS_ORIGIN(c) (RCLASS_EXT(c)->origin)
|
2012-08-06 11:00:19 +04:00
|
|
|
#define RCLASS_REFINED_CLASS(c) (RCLASS_EXT(c)->refined_class)
|
2011-06-18 07:05:11 +04:00
|
|
|
|
* include/ruby/ruby.h: constify RBasic::klass and add
RBASIC_CLASS(obj) macro which returns a class of `obj'.
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
This function reveal interal (hidden) object by rb_obj_hide().
Note that do not change class before and after hiding.
Only permitted example is:
klass = RBASIC_CLASS(obj);
rb_obj_hide(obj);
....
rb_obj_reveal(obj, klass);
TODO: API design. rb_obj_reveal() should be replaced with others.
TODO: modify constified variables using cast may be harmful for
compiler's analysis and optimizaton.
Any idea to prohibt inserting RBasic::klass directly?
If rename RBasic::klass and force to use RBASIC_CLASS(obj),
then all codes such as `RBASIC(obj)->klass' will be
compilation error. Is it acceptable? (We have similar
experience at Ruby 1.9,
for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 14:49:11 +04:00
|
|
|
#undef RCLASS_SUPER
|
|
|
|
static inline VALUE
|
2013-06-07 12:31:48 +04:00
|
|
|
RCLASS_SUPER(VALUE klass)
|
* include/ruby/ruby.h: constify RBasic::klass and add
RBASIC_CLASS(obj) macro which returns a class of `obj'.
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
This function reveal interal (hidden) object by rb_obj_hide().
Note that do not change class before and after hiding.
Only permitted example is:
klass = RBASIC_CLASS(obj);
rb_obj_hide(obj);
....
rb_obj_reveal(obj, klass);
TODO: API design. rb_obj_reveal() should be replaced with others.
TODO: modify constified variables using cast may be harmful for
compiler's analysis and optimizaton.
Any idea to prohibt inserting RBasic::klass directly?
If rename RBasic::klass and force to use RBASIC_CLASS(obj),
then all codes such as `RBASIC(obj)->klass' will be
compilation error. Is it acceptable? (We have similar
experience at Ruby 1.9,
for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 14:49:11 +04:00
|
|
|
{
|
2013-06-07 12:31:48 +04:00
|
|
|
return RCLASS_EXT(klass)->super;
|
* include/ruby/ruby.h: constify RBasic::klass and add
RBASIC_CLASS(obj) macro which returns a class of `obj'.
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
This function reveal interal (hidden) object by rb_obj_hide().
Note that do not change class before and after hiding.
Only permitted example is:
klass = RBASIC_CLASS(obj);
rb_obj_hide(obj);
....
rb_obj_reveal(obj, klass);
TODO: API design. rb_obj_reveal() should be replaced with others.
TODO: modify constified variables using cast may be harmful for
compiler's analysis and optimizaton.
Any idea to prohibt inserting RBasic::klass directly?
If rename RBasic::klass and force to use RBASIC_CLASS(obj),
then all codes such as `RBASIC(obj)->klass' will be
compilation error. Is it acceptable? (We have similar
experience at Ruby 1.9,
for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 14:49:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline VALUE
|
2013-06-07 12:31:48 +04:00
|
|
|
RCLASS_SET_SUPER(VALUE klass, VALUE super)
|
2013-05-25 18:55:18 +04:00
|
|
|
{
|
2013-06-07 12:31:48 +04:00
|
|
|
OBJ_WRITE(klass, &RCLASS_EXT(klass)->super, super);
|
|
|
|
return super;
|
* include/ruby/ruby.h: constify RBasic::klass and add
RBASIC_CLASS(obj) macro which returns a class of `obj'.
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
This function reveal interal (hidden) object by rb_obj_hide().
Note that do not change class before and after hiding.
Only permitted example is:
klass = RBASIC_CLASS(obj);
rb_obj_hide(obj);
....
rb_obj_reveal(obj, klass);
TODO: API design. rb_obj_reveal() should be replaced with others.
TODO: modify constified variables using cast may be harmful for
compiler's analysis and optimizaton.
Any idea to prohibt inserting RBasic::klass directly?
If rename RBasic::klass and force to use RBASIC_CLASS(obj),
then all codes such as `RBASIC(obj)->klass' will be
compilation error. Is it acceptable? (We have similar
experience at Ruby 1.9,
for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 14:49:11 +04:00
|
|
|
}
|
|
|
|
|
* internal.h: declare more internal functions.
* iseq.h (rb_method_get_iseq): declared.
* compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
ruby.c, time.c, util.c, vm.c: don't declare internal functions.
* eval.c, parse.y, thread_pthread.c: non-existing function declarations
removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 05:54:57 +04:00
|
|
|
struct vtm; /* defined by timev.h */
|
|
|
|
|
2011-06-18 12:26:19 +04:00
|
|
|
/* array.c */
|
|
|
|
VALUE rb_ary_last(int, VALUE *, VALUE);
|
2011-07-29 18:53:51 +04:00
|
|
|
void rb_ary_set_len(VALUE, long);
|
2012-03-08 19:25:04 +04:00
|
|
|
VALUE rb_ary_cat(VALUE, const VALUE *, long);
|
2012-11-25 17:39:26 +04:00
|
|
|
void rb_ary_delete_same(VALUE, VALUE);
|
2011-06-18 12:26:19 +04:00
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* bignum.c */
|
|
|
|
VALUE rb_big_fdiv(VALUE x, VALUE y);
|
2011-05-29 10:09:08 +04:00
|
|
|
VALUE rb_big_uminus(VALUE x);
|
2012-07-16 13:41:25 +04:00
|
|
|
VALUE rb_integer_float_cmp(VALUE x, VALUE y);
|
2012-07-16 14:39:42 +04:00
|
|
|
VALUE rb_integer_float_eq(VALUE x, VALUE y);
|
2011-05-29 10:09:08 +04:00
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* class.c */
|
|
|
|
VALUE rb_obj_methods(int argc, VALUE *argv, VALUE obj);
|
|
|
|
VALUE rb_obj_protected_methods(int argc, VALUE *argv, VALUE obj);
|
|
|
|
VALUE rb_obj_private_methods(int argc, VALUE *argv, VALUE obj);
|
|
|
|
VALUE rb_obj_public_methods(int argc, VALUE *argv, VALUE obj);
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
int rb_obj_basic_to_s_p(VALUE);
|
2012-08-06 19:31:13 +04:00
|
|
|
VALUE rb_special_singleton_class(VALUE);
|
2012-12-29 06:37:47 +04:00
|
|
|
VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach);
|
2013-05-13 09:50:38 +04:00
|
|
|
VALUE rb_singleton_class_get(VALUE obj);
|
2011-06-18 08:41:53 +04:00
|
|
|
void Init_class_hierarchy(void);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
2013-02-17 15:55:50 +04:00
|
|
|
/* compar.c */
|
|
|
|
VALUE rb_invcmp(VALUE, VALUE);
|
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* compile.c */
|
|
|
|
int rb_dvar_defined(ID);
|
|
|
|
int rb_local_defined(ID);
|
|
|
|
int rb_parse_in_eval(void);
|
|
|
|
int rb_parse_in_main(void);
|
* probes.d: add DTrace probe declarations. [ruby-core:27448]
* array.c (empty_ary_alloc, ary_new): added array create DTrace probe.
* compile.c (rb_insns_name): allowing DTrace probes to access
instruction sequence name.
* Makefile.in: translate probes.d file to appropriate header file.
* common.mk: declare dependencies on the DTrace header.
* configure.in: add a test for existence of DTrace.
* eval.c (setup_exception): add a probe for when an exception is
raised.
* gc.c: Add DTrace probes for mark begin and end, and sweep begin and
end.
* hash.c (empty_hash_alloc): Add a probe for hash allocation.
* insns.def: Add probes for function entry and return.
* internal.h: function declaration for compile.c change.
* load.c (rb_f_load): add probes for `load` entry and exit, require
entry and exit, and wrapping search_required for load path search.
* object.c (rb_obj_alloc): added a probe for general object creation.
* parse.y (yycompile0): added a probe around parse and compile phase.
* string.c (empty_str_alloc, str_new): DTrace probes for string
allocation.
* test/dtrace/*: tests for DTrace probes.
* vm.c (vm_invoke_proc): add probes for function return on exception
raise, hash create, and instruction sequence execution.
* vm_core.h: add probe declarations for function entry and exit.
* vm_dump.c: add probes header file.
* vm_eval.c (vm_call0_cfunc, vm_call0_cfunc_with_frame): add probe on
function entry and return.
* vm_exec.c: expose instruction number to instruction name function.
* vm_insnshelper.c: add function entry and exit probes for cfunc
methods.
* vm_insnhelper.h: vm usage information is always collected, so
uncomment the functions.
12 19:14:50 2012 Akinori MUSHA <knu@iDaemons.org>
* configure.in (isinf, isnan): isinf() and isnan() are macros on
DragonFly which cannot be found by AC_REPLACE_FUNCS(). This
workaround enforces the fact that they exist on DragonFly.
12 15:59:38 2012 Shugo Maeda <shugo@ruby-lang.org>
* vm_core.h (rb_call_info_t::refinements), compile.c (new_callinfo),
vm_insnhelper.c (vm_search_method): revert r37616 because it's too
slow. [ruby-dev:46477]
* test/ruby/test_refinement.rb (test_inline_method_cache): skip
the test until the bug is fixed efficiently.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-13 01:52:12 +04:00
|
|
|
const char * rb_insns_name(int i);
|
* internal.h: declare more internal functions.
* iseq.h (rb_method_get_iseq): declared.
* compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
ruby.c, time.c, util.c, vm.c: don't declare internal functions.
* eval.c, parse.y, thread_pthread.c: non-existing function declarations
removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 05:54:57 +04:00
|
|
|
VALUE rb_insns_name_array(void);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
2012-02-15 18:00:11 +04:00
|
|
|
/* cont.c */
|
|
|
|
VALUE rb_obj_is_fiber(VALUE);
|
|
|
|
void rb_fiber_reset_root_local_storage(VALUE);
|
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* debug.c */
|
|
|
|
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
|
|
|
|
|
|
|
|
/* dmyext.c */
|
|
|
|
void Init_ext(void);
|
|
|
|
|
|
|
|
/* encoding.c */
|
2013-07-02 12:22:15 +04:00
|
|
|
#ifdef RUBY_ENCODING_H
|
|
|
|
enum ruby_preserved_encindex {
|
|
|
|
ENCINDEX_ASCII,
|
|
|
|
ENCINDEX_UTF_8,
|
|
|
|
ENCINDEX_US_ASCII,
|
|
|
|
|
|
|
|
/* preserved indexes */
|
2013-07-02 12:22:34 +04:00
|
|
|
ENCINDEX_UTF_16BE,
|
|
|
|
ENCINDEX_UTF_16LE,
|
|
|
|
ENCINDEX_UTF_32BE,
|
|
|
|
ENCINDEX_UTF_32LE,
|
2013-07-02 12:22:38 +04:00
|
|
|
ENCINDEX_UTF_16,
|
|
|
|
ENCINDEX_UTF_32,
|
2013-07-02 12:22:43 +04:00
|
|
|
ENCINDEX_UTF8_MAC,
|
2013-07-02 12:22:47 +04:00
|
|
|
|
|
|
|
/* for old options of regexp */
|
|
|
|
ENCINDEX_EUC_JP,
|
|
|
|
ENCINDEX_Windows_31J,
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
2013-07-02 12:22:15 +04:00
|
|
|
ENCINDEX_BUILTIN_MAX
|
|
|
|
};
|
|
|
|
#endif
|
2013-07-02 12:22:30 +04:00
|
|
|
#define rb_ascii8bit_encindex() ENCINDEX_ASCII
|
|
|
|
#define rb_utf8_encindex() ENCINDEX_UTF_8
|
|
|
|
#define rb_usascii_encindex() ENCINDEX_US_ASCII
|
2013-07-02 12:22:15 +04:00
|
|
|
ID rb_id_encoding(void);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
void rb_gc_mark_encodings(void);
|
|
|
|
|
* internal.h: declare more internal functions.
* iseq.h (rb_method_get_iseq): declared.
* compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
ruby.c, time.c, util.c, vm.c: don't declare internal functions.
* eval.c, parse.y, thread_pthread.c: non-existing function declarations
removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 05:54:57 +04:00
|
|
|
/* error.c */
|
|
|
|
NORETURN(PRINTF_ARGS(void rb_compile_bug(const char*, int, const char*, ...), 3, 4));
|
|
|
|
VALUE rb_check_backtrace(VALUE);
|
2011-06-29 01:17:29 +04:00
|
|
|
NORETURN(void rb_async_bug_errno(const char *,int));
|
2012-06-29 06:26:46 +04:00
|
|
|
const char *rb_builtin_type_name(int t);
|
2012-11-11 10:38:17 +04:00
|
|
|
const char *rb_builtin_class_name(VALUE x);
|
* internal.h: declare more internal functions.
* iseq.h (rb_method_get_iseq): declared.
* compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
ruby.c, time.c, util.c, vm.c: don't declare internal functions.
* eval.c, parse.y, thread_pthread.c: non-existing function declarations
removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 05:54:57 +04:00
|
|
|
|
* revised r37993 to avoid SEGV/ILL in tests. In r37993, a method
entry with VM_METHOD_TYPE_REFINED holds only the original method
definition, so ci->me is set to a method entry allocated in the
stack, and it causes SEGV/ILL. In this commit, a method entry
with VM_METHOD_TYPE_REFINED holds the whole original method entry.
Furthermore, rb_thread_mark() is changed to mark cfp->klass to
avoid GC for iclasses created by copy_refinement_iclass().
* vm_method.c (rb_method_entry_make): add a method entry with
VM_METHOD_TYPE_REFINED to the class refined by the refinement if
the target module is a refinement. When a method entry with
VM_METHOD_TYPE_UNDEF is invoked by vm_call_method(), a method with
the same name is searched in refinements. If such a method is
found, the method is invoked. Otherwise, the original method in
the refined class (rb_method_definition_t::body.orig_me) is
invoked. This change is made to simplify the normal method lookup
and to improve the performance of normal method calls.
* vm_method.c (EXPR1, search_method, rb_method_entry),
vm_eval.c (rb_call0, rb_search_method_entry): do not use
refinements for method lookup.
* vm_insnhelper.c (vm_call_method): search methods in refinements if
ci->me is VM_METHOD_TYPE_REFINED. If the method is called by
super (i.e., ci->call == vm_call_super_method), skip the same
method entry as the current method to avoid infinite call of the
same method.
* class.c (include_modules_at): add a refined method entry for each
method defined in a module included in a refinement.
* class.c (rb_prepend_module): set an empty table to
RCLASS_M_TBL(klass) to add refined method entries, because
refinements should have priority over prepended modules.
* proc.c (mnew): use rb_method_entry_with_refinements() to get
a refined method.
* vm.c (rb_thread_mark): mark cfp->klass for iclasses created by
copy_refinement_iclass().
* vm.c (Init_VM), cont.c (fiber_init): initialize th->cfp->klass.
* test/ruby/test_refinement.rb (test_inline_method_cache): do not skip
the test because it should pass successfully.
* test/ruby/test_refinement.rb (test_redefine_refined_method): new
test for the case a refined method is redefined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-06 17:08:41 +04:00
|
|
|
/* eval.c */
|
|
|
|
VALUE rb_refinement_module_get_refined_class(VALUE module);
|
|
|
|
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
/* eval_error.c */
|
|
|
|
void ruby_error_print(void);
|
|
|
|
VALUE rb_get_backtrace(VALUE info);
|
|
|
|
|
|
|
|
/* eval_jump.c */
|
|
|
|
void rb_call_end_proc(VALUE data);
|
2012-07-19 09:30:46 +04:00
|
|
|
void rb_mark_end_proc(void);
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* file.c */
|
2013-07-25 08:06:50 +04:00
|
|
|
VALUE rb_home_dir_of(VALUE user, VALUE result);
|
|
|
|
VALUE rb_default_home_dir(VALUE result);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
VALUE rb_realpath_internal(VALUE basedir, VALUE path, int strict);
|
2012-03-01 11:13:22 +04:00
|
|
|
void rb_file_const(const char*, VALUE);
|
|
|
|
int rb_file_load_ok(const char *);
|
2012-08-24 07:44:56 +04:00
|
|
|
VALUE rb_file_expand_path_fast(VALUE, VALUE);
|
|
|
|
VALUE rb_file_expand_path_internal(VALUE, VALUE, int, int, VALUE);
|
2012-11-05 19:27:08 +04:00
|
|
|
VALUE rb_get_path_check_to_string(VALUE, int);
|
|
|
|
VALUE rb_get_path_check_convert(VALUE, VALUE, int);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
void Init_File(void);
|
|
|
|
|
2013-03-15 09:51:37 +04:00
|
|
|
#ifdef RUBY_FUNCTION_NAME_STRING
|
2013-03-15 10:08:13 +04:00
|
|
|
# if defined __GNUC__ && __GNUC__ >= 4
|
|
|
|
# pragma GCC visibility push(default)
|
|
|
|
# endif
|
2013-03-15 15:19:56 +04:00
|
|
|
NORETURN(void rb_sys_fail_path_in(const char *func_name, VALUE path));
|
2013-03-15 10:08:13 +04:00
|
|
|
# if defined __GNUC__ && __GNUC__ >= 4
|
|
|
|
# pragma GCC visibility pop
|
|
|
|
# endif
|
2013-03-15 15:19:56 +04:00
|
|
|
# define rb_sys_fail_path(path) rb_sys_fail_path_in(RUBY_FUNCTION_NAME_STRING, path)
|
2013-03-15 09:51:37 +04:00
|
|
|
#else
|
|
|
|
# define rb_sys_fail_path(path) rb_sys_fail_str(path)
|
|
|
|
#endif
|
|
|
|
|
2012-08-24 07:44:56 +04:00
|
|
|
#ifdef _WIN32
|
|
|
|
/* file.c, win32/file.c */
|
|
|
|
void rb_w32_init_file(void);
|
|
|
|
#endif
|
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* gc.c */
|
|
|
|
void Init_heap(void);
|
2012-01-10 07:49:10 +04:00
|
|
|
void *ruby_mimmalloc(size_t size);
|
2013-05-27 04:21:02 +04:00
|
|
|
void rb_objspace_set_event_hook(const rb_event_flag_t event);
|
2013-07-19 10:11:09 +04:00
|
|
|
void rb_gc_writebarrier_remember_promoted(VALUE obj);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
2013-05-26 20:19:04 +04:00
|
|
|
/* hash.c */
|
|
|
|
struct st_table *rb_hash_tbl_raw(VALUE hash);
|
|
|
|
#define RHASH_TBL_RAW(h) rb_hash_tbl_raw(h)
|
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* inits.c */
|
|
|
|
void rb_call_inits(void);
|
|
|
|
|
|
|
|
/* io.c */
|
|
|
|
const char *ruby_get_inplace_mode(void);
|
|
|
|
void ruby_set_inplace_mode(const char *);
|
|
|
|
ssize_t rb_io_bufread(VALUE io, void *buf, size_t size);
|
|
|
|
void rb_stdio_set_default_encoding(void);
|
2012-12-25 08:38:18 +04:00
|
|
|
void rb_write_error_str(VALUE mesg);
|
2013-08-15 15:53:41 +04:00
|
|
|
VALUE rb_io_flush_raw(VALUE, int);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
|
|
|
/* iseq.c */
|
|
|
|
VALUE rb_iseq_clone(VALUE iseqval, VALUE newcbase);
|
|
|
|
|
|
|
|
/* load.c */
|
|
|
|
VALUE rb_get_load_path(void);
|
2012-11-05 19:27:08 +04:00
|
|
|
VALUE rb_get_expanded_load_path(void);
|
2012-03-07 11:30:31 +04:00
|
|
|
NORETURN(void rb_load_fail(VALUE, const char*));
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
|
|
|
/* math.c */
|
2011-07-09 14:50:51 +04:00
|
|
|
VALUE rb_math_atan2(VALUE, VALUE);
|
|
|
|
VALUE rb_math_cos(VALUE);
|
|
|
|
VALUE rb_math_cosh(VALUE);
|
|
|
|
VALUE rb_math_exp(VALUE);
|
|
|
|
VALUE rb_math_hypot(VALUE, VALUE);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
VALUE rb_math_log(int argc, VALUE *argv);
|
2011-07-09 14:50:51 +04:00
|
|
|
VALUE rb_math_sin(VALUE);
|
|
|
|
VALUE rb_math_sinh(VALUE);
|
|
|
|
VALUE rb_math_sqrt(VALUE);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
|
|
|
/* newline.c */
|
|
|
|
void Init_newline(void);
|
|
|
|
|
|
|
|
/* numeric.c */
|
|
|
|
int rb_num_to_uint(VALUE val, unsigned int *ret);
|
2013-03-06 10:30:03 +04:00
|
|
|
VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl);
|
* internal.h: declare more internal functions.
* iseq.h (rb_method_get_iseq): declared.
* compile.c, eval.c, eval_error.c, iseq.c, parse.y, proc.c, range.c,
ruby.c, time.c, util.c, vm.c: don't declare internal functions.
* eval.c, parse.y, thread_pthread.c: non-existing function declarations
removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 05:54:57 +04:00
|
|
|
int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl);
|
2012-03-14 10:10:01 +04:00
|
|
|
double ruby_float_mod(double x, double y);
|
2013-02-22 07:46:47 +04:00
|
|
|
int rb_num_negative_p(VALUE);
|
2013-03-05 05:20:20 +04:00
|
|
|
VALUE rb_int_succ(VALUE num);
|
|
|
|
VALUE rb_int_pred(VALUE num);
|
2011-06-09 18:45:56 +04:00
|
|
|
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
/* object.c */
|
|
|
|
VALUE rb_obj_equal(VALUE obj1, VALUE obj2);
|
* include/ruby/ruby.h: constify RBasic::klass and add
RBASIC_CLASS(obj) macro which returns a class of `obj'.
This change is a part of RGENGC branch [ruby-trunk - Feature #8339].
* object.c: add new function rb_obj_reveal().
This function reveal interal (hidden) object by rb_obj_hide().
Note that do not change class before and after hiding.
Only permitted example is:
klass = RBASIC_CLASS(obj);
rb_obj_hide(obj);
....
rb_obj_reveal(obj, klass);
TODO: API design. rb_obj_reveal() should be replaced with others.
TODO: modify constified variables using cast may be harmful for
compiler's analysis and optimizaton.
Any idea to prohibt inserting RBasic::klass directly?
If rename RBasic::klass and force to use RBASIC_CLASS(obj),
then all codes such as `RBASIC(obj)->klass' will be
compilation error. Is it acceptable? (We have similar
experience at Ruby 1.9,
for example "RARRAY(ary)->ptr" to "RARRAY_PTR(ary)".
* internal.h: add some macros.
* RBASIC_CLEAR_CLASS(obj) clear RBasic::klass to make it internal
object.
* RBASIC_SET_CLASS(obj, cls) set RBasic::klass.
* RBASIC_SET_CLASS_RAW(obj, cls) same as RBASIC_SET_CLASS
without write barrier (planned).
* RCLASS_SET_SUPER(a, b) set super class of a.
* array.c, class.c, compile.c, encoding.c, enum.c, error.c, eval.c,
file.c, gc.c, hash.c, io.c, iseq.c, marshal.c, object.c,
parse.y, proc.c, process.c, random.c, ruby.c, sprintf.c,
string.c, thread.c, transcode.c, vm.c, vm_eval.c, win32/file.c:
Use above macros and functions to access RBasic::klass.
* ext/coverage/coverage.c, ext/readline/readline.c,
ext/socket/ancdata.c, ext/socket/init.c,
* ext/zlib/zlib.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 14:49:11 +04:00
|
|
|
|
|
|
|
struct RBasicRaw {
|
|
|
|
VALUE flags;
|
|
|
|
VALUE klass;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define RBASIC_CLEAR_CLASS(obj) (((struct RBasicRaw *)((VALUE)(obj)))->klass = 0)
|
|
|
|
#define RBASIC_SET_CLASS_RAW(obj, cls) (((struct RBasicRaw *)((VALUE)(obj)))->klass = (cls))
|
* gc.c: support RGENGC. [ruby-trunk - Feature #8339]
See this ticet about RGENGC.
* gc.c: Add several flags:
* RGENGC_DEBUG: if >0, then prints debug information.
* RGENGC_CHECK_MODE: if >0, add assertions.
* RGENGC_PROFILE: if >0, add profiling features.
check GC.stat and GC::Profiler.
* include/ruby/ruby.h: disable RGENGC by default (USE_RGENGC == 0).
* array.c: add write barriers for T_ARRAY and generate sunny objects.
* include/ruby/ruby.h (RARRAY_PTR_USE): added. Use this macro if
you want to access raw pointers. If you modify the contents which
pointer pointed, then you need to care write barrier.
* bignum.c, marshal.c, random.c: generate T_BIGNUM sunny objects.
* complex.c, include/ruby/ruby.h: add write barriers for T_COMPLEX
and generate sunny objects.
* rational.c (nurat_s_new_internal), include/ruby/ruby.h: add write
barriers for T_RATIONAL and generate sunny objects.
* internal.h: add write barriers for RBasic::klass.
* numeric.c (rb_float_new_in_heap): generate sunny T_FLOAT objects.
* object.c (rb_class_allocate_instance), range.c:
generate sunny T_OBJECT objects.
* string.c: add write barriers for T_STRING and generate sunny objects.
* variable.c: add write barriers for ivars.
* vm_insnhelper.c (vm_setivar): ditto.
* include/ruby/ruby.h, debug.c: use two flags
FL_WB_PROTECTED and FL_OLDGEN.
* node.h (NODE_FL_CREF_PUSHED_BY_EVAL, NODE_FL_CREF_OMOD_SHARED):
move flag bits.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13 22:07:47 +04:00
|
|
|
#define RBASIC_SET_CLASS(obj, cls) do { \
|
|
|
|
VALUE _obj_ = (obj); \
|
|
|
|
OBJ_WRITE(_obj_, &((struct RBasicRaw *)(_obj_))->klass, cls); \
|
|
|
|
} while (0)
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* parse.y */
|
|
|
|
VALUE rb_parser_get_yydebug(VALUE);
|
|
|
|
VALUE rb_parser_set_yydebug(VALUE, VALUE);
|
2011-07-22 16:06:42 +04:00
|
|
|
int rb_is_const_name(VALUE name);
|
|
|
|
int rb_is_class_name(VALUE name);
|
|
|
|
int rb_is_global_name(VALUE name);
|
|
|
|
int rb_is_instance_name(VALUE name);
|
|
|
|
int rb_is_attrset_name(VALUE name);
|
|
|
|
int rb_is_local_name(VALUE name);
|
|
|
|
int rb_is_method_name(VALUE name);
|
|
|
|
int rb_is_junk_name(VALUE name);
|
2012-07-19 09:30:46 +04:00
|
|
|
void rb_gc_mark_parser(void);
|
|
|
|
void rb_gc_mark_symbols(void);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
2011-06-18 12:26:19 +04:00
|
|
|
/* proc.c */
|
|
|
|
VALUE rb_proc_location(VALUE self);
|
2012-02-21 04:13:44 +04:00
|
|
|
st_index_t rb_hash_proc(st_index_t hash, VALUE proc);
|
2013-07-15 08:26:58 +04:00
|
|
|
int rb_block_arity(void);
|
2011-06-18 12:26:19 +04:00
|
|
|
|
2012-06-04 14:19:32 +04:00
|
|
|
/* process.c */
|
2013-02-21 08:41:39 +04:00
|
|
|
#define RB_MAX_GROUPS (65536)
|
2012-06-04 14:19:32 +04:00
|
|
|
|
2012-06-20 15:46:50 +04:00
|
|
|
struct rb_execarg {
|
|
|
|
int use_shell;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
VALUE shell_script;
|
|
|
|
} sh;
|
|
|
|
struct {
|
|
|
|
VALUE command_name;
|
|
|
|
VALUE command_abspath; /* full path string or nil */
|
|
|
|
VALUE argv_str;
|
|
|
|
VALUE argv_buf;
|
|
|
|
} cmd;
|
|
|
|
} invoke;
|
|
|
|
VALUE redirect_fds;
|
|
|
|
VALUE envp_str;
|
|
|
|
VALUE envp_buf;
|
|
|
|
VALUE dup2_tmpbuf;
|
2012-06-22 15:30:29 +04:00
|
|
|
unsigned pgroup_given : 1;
|
2012-06-20 16:27:09 +04:00
|
|
|
unsigned umask_given : 1;
|
2012-06-23 05:43:51 +04:00
|
|
|
unsigned unsetenv_others_given : 1;
|
|
|
|
unsigned unsetenv_others_do : 1;
|
2012-06-23 08:23:03 +04:00
|
|
|
unsigned close_others_given : 1;
|
|
|
|
unsigned close_others_do : 1;
|
2012-06-23 10:23:35 +04:00
|
|
|
unsigned chdir_given : 1;
|
2012-06-23 18:21:47 +04:00
|
|
|
unsigned new_pgroup_given : 1;
|
|
|
|
unsigned new_pgroup_flag : 1;
|
2012-10-09 12:13:29 +04:00
|
|
|
unsigned uid_given : 1;
|
|
|
|
unsigned gid_given : 1;
|
2012-06-25 06:35:29 +04:00
|
|
|
rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0<V). */
|
2012-06-23 11:30:26 +04:00
|
|
|
VALUE rlimit_limits; /* Qfalse or [[rtype, softlim, hardlim], ...] */
|
2012-06-20 16:27:09 +04:00
|
|
|
mode_t umask_mask;
|
2012-10-09 12:13:29 +04:00
|
|
|
rb_uid_t uid;
|
|
|
|
rb_gid_t gid;
|
2012-06-23 15:35:32 +04:00
|
|
|
VALUE fd_dup2;
|
|
|
|
VALUE fd_close;
|
|
|
|
VALUE fd_open;
|
|
|
|
VALUE fd_dup2_child;
|
2012-06-23 08:23:03 +04:00
|
|
|
int close_others_maxhint;
|
2012-06-23 12:18:34 +04:00
|
|
|
VALUE env_modification; /* Qfalse or [[k1,v1], ...] */
|
2012-06-23 10:23:35 +04:00
|
|
|
VALUE chdir_dir;
|
2012-06-20 15:46:50 +04:00
|
|
|
};
|
|
|
|
|
2012-06-04 15:01:41 +04:00
|
|
|
/* argv_str contains extra two elements.
|
|
|
|
* The beginning one is for /bin/sh used by exec_with_sh.
|
|
|
|
* The last one for terminating NULL used by execve.
|
2012-06-04 14:19:32 +04:00
|
|
|
* See rb_exec_fillarg() in process.c. */
|
2012-06-04 15:01:41 +04:00
|
|
|
#define ARGVSTR2ARGC(argv_str) (RSTRING_LEN(argv_str) / sizeof(char *) - 2)
|
|
|
|
#define ARGVSTR2ARGV(argv_str) ((char **)RSTRING_PTR(argv_str) + 1)
|
2012-06-04 14:19:32 +04:00
|
|
|
|
2012-06-10 15:21:07 +04:00
|
|
|
rb_pid_t rb_fork_ruby(int *status);
|
2012-08-29 18:44:08 +04:00
|
|
|
void rb_last_status_clear(void);
|
2012-06-10 15:21:07 +04:00
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* rational.c */
|
|
|
|
VALUE rb_lcm(VALUE x, VALUE y);
|
2011-07-09 15:06:43 +04:00
|
|
|
VALUE rb_rational_reciprocal(VALUE x);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
|
|
|
/* re.c */
|
|
|
|
VALUE rb_reg_compile(VALUE str, int options, const char *sourcefile, int sourceline);
|
|
|
|
VALUE rb_reg_check_preprocess(VALUE);
|
|
|
|
|
|
|
|
/* signal.c */
|
|
|
|
int rb_get_next_signal(void);
|
2012-12-15 18:20:12 +04:00
|
|
|
int rb_sigaltstack_size(void);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
2011-08-27 14:06:25 +04:00
|
|
|
/* strftime.c */
|
|
|
|
#ifdef RUBY_ENCODING_H
|
|
|
|
size_t rb_strftime_timespec(char *s, size_t maxsize, const char *format, rb_encoding *enc,
|
|
|
|
const struct vtm *vtm, struct timespec *ts, int gmt);
|
|
|
|
size_t rb_strftime(char *s, size_t maxsize, const char *format, rb_encoding *enc,
|
|
|
|
const struct vtm *vtm, VALUE timev, int gmt);
|
|
|
|
#endif
|
|
|
|
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
/* string.c */
|
|
|
|
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
|
2012-06-09 18:36:17 +04:00
|
|
|
int rb_str_symname_p(VALUE);
|
2012-12-22 19:04:57 +04:00
|
|
|
VALUE rb_str_quote_unprintable(VALUE);
|
|
|
|
VALUE rb_id_quote_unprintable(ID);
|
|
|
|
#define QUOTE(str) rb_str_quote_unprintable(str)
|
|
|
|
#define QUOTE_ID(id) rb_id_quote_unprintable(id)
|
2013-07-12 11:28:40 +04:00
|
|
|
void rb_str_fill_terminator(VALUE str, const int termlen);
|
2013-07-28 12:49:25 +04:00
|
|
|
VALUE rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg);
|
2013-08-31 08:30:25 +04:00
|
|
|
#ifdef RUBY_ENCODING_H
|
|
|
|
VALUE rb_external_str_with_enc(VALUE str, rb_encoding *eenc);
|
|
|
|
#endif
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
|
|
|
/* struct.c */
|
|
|
|
VALUE rb_struct_init_copy(VALUE copy, VALUE s);
|
|
|
|
|
|
|
|
/* time.c */
|
|
|
|
struct timeval rb_time_timeval(VALUE);
|
|
|
|
|
|
|
|
/* thread.c */
|
|
|
|
VALUE rb_obj_is_mutex(VALUE obj);
|
2012-08-16 15:41:24 +04:00
|
|
|
VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
|
2011-06-09 19:02:46 +04:00
|
|
|
void rb_thread_execute_interrupts(VALUE th);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
void rb_clear_trace_func(void);
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
VALUE rb_get_coverages(void);
|
2012-07-05 12:32:23 +04:00
|
|
|
VALUE rb_thread_shield_new(void);
|
|
|
|
VALUE rb_thread_shield_wait(VALUE self);
|
|
|
|
VALUE rb_thread_shield_release(VALUE self);
|
|
|
|
VALUE rb_thread_shield_destroy(VALUE self);
|
2012-11-28 12:30:51 +04:00
|
|
|
void rb_mutex_allow_trap(VALUE self, int val);
|
2012-12-05 23:37:49 +04:00
|
|
|
VALUE rb_uninterruptible(VALUE (*b_proc)(ANYARGS), VALUE data);
|
2012-12-15 09:40:18 +04:00
|
|
|
VALUE rb_mutex_owned_p(VALUE self);
|
2013-03-19 14:51:49 +04:00
|
|
|
void ruby_kill(rb_pid_t pid, int sig);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
|
|
|
/* thread_pthread.c, thread_win32.c */
|
|
|
|
void Init_native_thread(void);
|
|
|
|
|
|
|
|
/* vm.c */
|
|
|
|
VALUE rb_obj_is_thread(VALUE obj);
|
|
|
|
void rb_vm_mark(void *ptr);
|
|
|
|
void Init_BareVM(void);
|
|
|
|
VALUE rb_vm_top_self(void);
|
|
|
|
void rb_thread_recycle_stack_release(VALUE *);
|
|
|
|
void rb_vm_change_state(void);
|
|
|
|
void rb_vm_inc_const_missing_count(void);
|
|
|
|
void rb_thread_mark(void *th);
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
const void **rb_vm_get_insns_address_table(void);
|
2011-09-03 19:11:53 +04:00
|
|
|
VALUE rb_sourcefilename(void);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
|
|
|
/* vm_dump.c */
|
|
|
|
void rb_vm_bugreport(void);
|
2013-04-02 11:02:54 +04:00
|
|
|
void rb_print_backtrace(void);
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
|
|
|
/* vm_eval.c */
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
void Init_vm_eval(void);
|
2011-06-18 12:26:19 +04:00
|
|
|
VALUE rb_current_realfilepath(void);
|
2012-09-19 19:42:26 +04:00
|
|
|
VALUE rb_check_block_call(VALUE, ID, int, VALUE *, VALUE (*)(ANYARGS), VALUE);
|
2013-08-27 11:08:32 +04:00
|
|
|
typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
|
|
|
|
VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
|
2012-12-23 10:05:50 +04:00
|
|
|
rb_check_funcall_hook *hook, VALUE arg);
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
|
2013-08-27 11:46:08 +04:00
|
|
|
/* vm_insnhelper.c */
|
|
|
|
VALUE rb_equal_opt(VALUE obj1, VALUE obj2);
|
|
|
|
|
* method.h, internal.h iseq.h: declare internal functions.
* compile.c, eval.c, iseq.c, object.c, parse.y, proc.c, process.c,
thread.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_method.c: don't
declare internal functions.
Note that rb_method_entry_eq() is defined in vm_method.c but
there was a declaration in proc.c with different const-ness.
Now it is declared in method.h with same const-ness to the
definition.
* object.c (rb_mod_module_exec): don't declare functions declared in
include/ruby/intern.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 07:49:33 +04:00
|
|
|
/* vm_method.c */
|
|
|
|
void Init_eval_method(void);
|
2012-05-24 10:09:23 +04:00
|
|
|
int rb_method_defined_by(VALUE obj, ID mid, VALUE (*cfunc)(ANYARGS));
|
* internal.h: declare internal functions here.
* node.h: declare NODE dependent internal functions here.
* iseq.h: declare rb_iseq_t dependent internal functions here.
* vm_core.h: declare rb_thread_t dependent internal functions here.
* bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c,
enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c,
iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y,
proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c,
thread.c, time.c, transcode.c, variable.c, vm.c,
tool/compile_prelude.rb: don't declare internal functions declared
in above headers. include above headers if required.
Note that rb_thread_mark() was declared as
void rb_thread_mark(rb_thread_t *th) in cont.c but defined as
void rb_thread_mark(void *ptr) in vm.c. Now it is declared as
the later in internal.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-18 02:43:38 +04:00
|
|
|
|
|
|
|
/* miniprelude.c, prelude.c */
|
|
|
|
void Init_prelude(void);
|
2011-06-09 19:02:46 +04:00
|
|
|
|
2012-06-02 19:59:37 +04:00
|
|
|
/* vm_backtrace.c */
|
|
|
|
void Init_vm_backtrace(void);
|
2013-03-06 10:30:03 +04:00
|
|
|
VALUE rb_vm_thread_backtrace(int argc, VALUE *argv, VALUE thval);
|
|
|
|
VALUE rb_vm_thread_backtrace_locations(int argc, VALUE *argv, VALUE thval);
|
2012-11-19 10:07:06 +04:00
|
|
|
|
2012-06-02 19:59:37 +04:00
|
|
|
VALUE rb_make_backtrace(void);
|
|
|
|
void rb_backtrace_print_as_bugreport(void);
|
|
|
|
int rb_backtrace_p(VALUE obj);
|
|
|
|
VALUE rb_backtrace_to_str_ary(VALUE obj);
|
|
|
|
VALUE rb_vm_backtrace_object();
|
|
|
|
|
2013-04-05 14:29:38 +04:00
|
|
|
RUBY_SYMBOL_EXPORT_BEGIN
|
2011-06-30 12:37:06 +04:00
|
|
|
const char *rb_objspace_data_type_name(VALUE obj);
|
2011-07-10 09:19:47 +04:00
|
|
|
|
2011-07-10 16:52:03 +04:00
|
|
|
/* Temporary. This API will be removed (renamed). */
|
2011-07-10 09:19:47 +04:00
|
|
|
VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
|
|
|
|
|
2013-06-06 15:57:35 +04:00
|
|
|
/* bignum.c */
|
2013-07-07 18:01:40 +04:00
|
|
|
VALUE rb_big_mul_normal(VALUE x, VALUE y);
|
|
|
|
VALUE rb_big_mul_balance(VALUE x, VALUE y);
|
|
|
|
VALUE rb_big_mul_karatsuba(VALUE x, VALUE y);
|
2013-07-08 17:05:57 +04:00
|
|
|
VALUE rb_big_mul_toom3(VALUE x, VALUE y);
|
|
|
|
VALUE rb_big_sq_fast(VALUE x);
|
2013-09-01 15:35:57 +04:00
|
|
|
VALUE rb_big2str_poweroftwo(VALUE x, int base);
|
|
|
|
VALUE rb_big2str_generic(VALUE x, int base);
|
2013-09-01 18:34:53 +04:00
|
|
|
#if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H)
|
|
|
|
VALUE rb_big_mul_gmp(VALUE x, VALUE y);
|
|
|
|
VALUE rb_big2str_gmp(VALUE x, int base);
|
|
|
|
#endif
|
2013-06-06 15:57:35 +04:00
|
|
|
|
2013-08-11 00:44:10 +04:00
|
|
|
/* file.c */
|
|
|
|
#ifdef __APPLE__
|
|
|
|
VALUE rb_str_normalize_ospath(const char *ptr, long len);
|
|
|
|
#endif
|
|
|
|
|
2011-11-01 07:37:01 +04:00
|
|
|
/* io.c */
|
|
|
|
void rb_maygvl_fd_fix_cloexec(int fd);
|
|
|
|
|
2013-08-02 18:48:55 +04:00
|
|
|
/* numeric.c */
|
|
|
|
VALUE rb_int_positive_pow(long x, unsigned long y);
|
|
|
|
|
2012-06-10 05:29:58 +04:00
|
|
|
/* process.c */
|
2012-06-20 15:46:50 +04:00
|
|
|
int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t errmsg_buflen);
|
2012-06-10 05:29:58 +04:00
|
|
|
rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen);
|
2012-06-20 14:31:02 +04:00
|
|
|
VALUE rb_execarg_new(int argc, VALUE *argv, int accept_shell);
|
2012-06-20 15:46:50 +04:00
|
|
|
struct rb_execarg *rb_execarg_get(VALUE execarg_obj); /* dangerous. needs GC guard. */
|
2012-06-21 13:39:10 +04:00
|
|
|
VALUE rb_execarg_init(int argc, VALUE *argv, int accept_shell, VALUE execarg_obj);
|
2012-06-21 16:18:40 +04:00
|
|
|
int rb_execarg_addopt(VALUE execarg_obj, VALUE key, VALUE val);
|
2012-06-21 01:25:20 +04:00
|
|
|
void rb_execarg_fixup(VALUE execarg_obj);
|
2012-06-20 15:46:50 +04:00
|
|
|
int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char* errmsg, size_t errmsg_buflen);
|
2012-06-27 04:15:51 +04:00
|
|
|
VALUE rb_execarg_extract_options(VALUE execarg_obj, VALUE opthash);
|
|
|
|
void rb_execarg_setenv(VALUE execarg_obj, VALUE env);
|
2012-06-10 05:29:58 +04:00
|
|
|
|
2013-07-03 17:32:14 +04:00
|
|
|
/* util.c */
|
|
|
|
extern const signed char ruby_digit36_to_number_table[];
|
|
|
|
|
2012-07-19 09:30:46 +04:00
|
|
|
/* variable.c */
|
|
|
|
void rb_gc_mark_global_tbl(void);
|
|
|
|
void rb_mark_generic_ivar(VALUE);
|
|
|
|
void rb_mark_generic_ivar_tbl(void);
|
|
|
|
|
2013-06-14 13:23:54 +04:00
|
|
|
int rb_st_insert_id_and_value(VALUE obj, st_table *tbl, ID key, VALUE value);
|
|
|
|
st_table *rb_st_copy(VALUE obj, struct st_table *orig_tbl);
|
|
|
|
|
2013-05-27 14:01:45 +04:00
|
|
|
/* gc.c */
|
|
|
|
size_t rb_gc_count();
|
|
|
|
|
2013-04-05 14:29:38 +04:00
|
|
|
RUBY_SYMBOL_EXPORT_END
|
2011-06-21 16:31:17 +04:00
|
|
|
|
2011-05-18 17:41:54 +04:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
#if 0
|
|
|
|
{ /* satisfy cc-mode */
|
|
|
|
#endif
|
|
|
|
} /* extern "C" { */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* RUBY_INTERNAL_H */
|