diff options
113 files changed, 1327 insertions, 689 deletions
@@ -10,14 +10,25 @@ Copyright (C) 2000 Information-technology Promotion Agency, Japan **********************************************************************/ #include "ruby/encoding.h" -#include "ruby/util.h" #include "ruby/st.h" -#include "probes.h" -#include "id.h" -#include "debug_counter.h" #include "transient_heap.h" -#include "internal.h" #if !ARRAY_DEBUG # define NDEBUG @@ -1,11 +1,15 @@ /* indent-tabs-mode: nil */ #include "ruby.h" #include "ruby/encoding.h" #include "ruby/util.h" -#include "internal.h" -#include "node.h" #include "vm_core.h" -#include "iseq.h" #include "builtin.h" static VALUE rb_mAST; @@ -9,27 +9,40 @@ **********************************************************************/ -#include "internal.h" -#include "ruby/thread.h" -#include "ruby/util.h" -#include "id.h" #ifdef HAVE_STRINGS_H -#include <strings.h> #endif -#include <math.h> -#include <float.h> -#include <ctype.h> #ifdef HAVE_IEEEFP_H -#include <ieeefp.h> #endif -#include "ruby_assert.h" #if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H) -#define USE_GMP -#include <gmp.h> #endif #define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM) #ifndef RUBY_INTEGER_UNIFICATION @@ -23,12 +23,20 @@ * \{ */ #include "internal.h" #include "ruby/st.h" -#include "constant.h" #include "vm_core.h" -#include "id_table.h" -#include <ctype.h> #define id_attached id__attached__ @@ -9,9 +9,12 @@ **********************************************************************/ -#include "ruby/ruby.h" #include "id.h" #include "internal.h" VALUE rb_mComparable; @@ -9,25 +9,39 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/re.h" -#include "ruby/util.h" -#include "internal.h" -#include "encindex.h" #include <math.h> #include "vm_core.h" #include "vm_debug.h" #include "builtin.h" -#include "iseq.h" #include "insns.inc" #include "insns_info.inc" -#include "id_table.h" -#include "gc.h" - -#ifdef HAVE_DLADDR -# include <dlfcn.h> -#endif #undef RUBY_UNTYPED_DATA_WARNING #define RUBY_UNTYPED_DATA_WARNING 0 @@ -6,15 +6,25 @@ */ #include "ruby/config.h" #if defined _MSC_VER /* Microsoft Visual C does not define M_PI and others by default */ # define _USE_MATH_DEFINES 1 #endif #include <math.h> -#include "internal.h" -#include "id.h" #define NDEBUG #include "ruby_assert.h" #define ZERO INT2FIX(0) @@ -1700,8 +1710,6 @@ numeric_to_c(VALUE self) return rb_complex_new1(self); } -#include <ctype.h> - inline static int issign(int c) { @@ -10,6 +10,8 @@ **********************************************************************/ #ifndef CONSTANT_H #define CONSTANT_H typedef enum { CONST_DEPRECATED = 0x100, @@ -9,19 +9,25 @@ **********************************************************************/ -#include "internal.h" -#include "vm_core.h" -#include "gc.h" -#include "eval_intern.h" -#include "mjit.h" - -#include COROUTINE_H #ifndef _WIN32 #include <unistd.h> #include <sys/mman.h> #endif static const int DEBUG = 0; #define RB_PAGE_SIZE (pagesize) @@ -8,6 +8,8 @@ #pragma once #include <assert.h> #include <string.h> #define COROUTINE __attribute__((noreturn)) void @@ -8,6 +8,8 @@ #pragma once #include <assert.h> #include <string.h> #define COROUTINE __attribute__((noreturn)) void @@ -8,6 +8,8 @@ #pragma once #include <assert.h> #include <string.h> #define COROUTINE __attribute__((noreturn)) void @@ -1,6 +1,8 @@ #pragma once #include <assert.h> #include <string.h> #define COROUTINE __attribute__((noreturn)) void @@ -8,6 +8,8 @@ #pragma once #include <assert.h> #include <string.h> #define COROUTINE __declspec(noreturn) void __fastcall @@ -8,6 +8,8 @@ #pragma once #include <assert.h> #include <string.h> #define COROUTINE __declspec(noreturn) void @@ -8,6 +8,8 @@ #pragma once #include <assert.h> #include <string.h> #define COROUTINE __attribute__((noreturn, fastcall)) void @@ -9,15 +9,22 @@ **********************************************************************/ -#include "ruby/ruby.h" #include "ruby/encoding.h" #include "ruby/io.h" #include "ruby/util.h" -#include "vm_debug.h" -#include "eval_intern.h" -#include "vm_core.h" #include "symbol.h" -#include "id.h" /* This is the only place struct RIMemo is actually used */ struct RIMemo { @@ -11,12 +11,10 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/thread.h" -#include "internal.h" -#include "id.h" -#include "encindex.h" #include <sys/types.h> #include <sys/stat.h> @@ -36,12 +34,10 @@ # define USE_OPENDIR_AT 0 # endif #endif #if USE_OPENDIR_AT # include <fcntl.h> #endif -#ifndef AT_FDCWD -# define AT_FDCWD -1 -#endif #undef HAVE_DIRENT_NAMLEN #if defined HAVE_DIRENT_H && !defined _WIN32 @@ -68,8 +64,6 @@ # endif #endif -#include <errno.h> - #ifndef HAVE_STDLIB_H char *getenv(); #endif @@ -78,28 +72,6 @@ char *getenv(); char *strchr(char*,char); #endif -#include <ctype.h> - -#include "ruby/util.h" - -#define vm_initialized rb_cThread - -/* define system APIs */ -#ifdef _WIN32 -#undef chdir -#define chdir(p) rb_w32_uchdir(p) -#undef mkdir -#define mkdir(p, m) rb_w32_umkdir((p), (m)) -#undef rmdir -#define rmdir(p) rb_w32_urmdir(p) -#undef opendir -#define opendir(p) rb_w32_uopendir(p) -#define ruby_getcwd() rb_w32_ugetcwd(NULL, 0) -#define IS_WIN32 1 -#else -#define IS_WIN32 0 -#endif - #ifdef HAVE_SYS_ATTR_H #include <sys/attr.h> #endif @@ -123,15 +95,51 @@ char *strchr(char*,char); #ifdef __APPLE__ # define NORMALIZE_UTF8PATH 1 #else # define NORMALIZE_UTF8PATH 0 #endif -#if NORMALIZE_UTF8PATH -#include <sys/param.h> -#include <sys/mount.h> -#include <sys/vnode.h> # if defined HAVE_FGETATTRLIST || !defined HAVE_GETATTRLIST # define need_normalization(dirp, path) need_normalization(dirp) # else @@ -1244,6 +1244,8 @@ rb_w32_check_imported(HMODULE ext, HMODULE mine) #endif #ifdef USE_DLN_DLOPEN COMPILER_WARNING_PUSH #if defined(__clang__) || GCC_VERSION_SINCE(4, 2, 0) COMPILER_WARNING_IGNORED(-Wpedantic) @@ -11,6 +11,7 @@ #ifndef DLN_H #define DLN_H #ifdef __cplusplus # ifndef HAVE_S @@ -9,7 +9,7 @@ **********************************************************************/ -#include "internal.h" #define ENC_REPLICATE(name, orig) rb_encdb_replicate((name), (orig)) #define ENC_ALIAS(name, orig) rb_encdb_alias((name), (orig)) @@ -11,6 +11,7 @@ #ifndef RUBY_ENCINDEX_H #define RUBY_ENCINDEX_H 1 #if defined(__cplusplus) extern "C" { #if 0 @@ -9,14 +9,24 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "internal.h" #include "encindex.h" #include "regenc.h" -#include <ctype.h> #include "ruby/util.h" - #include "ruby_assert.h" #ifndef ENC_DEBUG #define ENC_DEBUG 0 #endif @@ -9,14 +9,20 @@ **********************************************************************/ -#include "ruby/encoding.h" #include "internal.h" #include "ruby/util.h" -#include "id.h" #include "symbol.h" -#include <assert.h> - VALUE rb_mEnumerable; static ID id_next; @@ -12,14 +12,22 @@ ************************************************/ -#include "ruby/ruby.h" -#include "internal.h" -#include "id.h" #ifdef HAVE_FLOAT_H #include <float.h> #endif /* * Document-class: Enumerator * @@ -9,27 +9,40 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/st.h" -#include "internal.h" -#include "ruby_assert.h" -#include "vm_core.h" -#include "builtin.h" -#include <stdio.h> #include <stdarg.h> #ifdef HAVE_STDLIB_H -#include <stdlib.h> #endif -#include <errno.h> #ifdef HAVE_UNISTD_H -#include <unistd.h> #endif #if defined __APPLE__ # include <AvailabilityMacros.h> #endif /*! * \defgroup exception Exception handlings * \{ @@ -11,18 +11,30 @@ **********************************************************************/ -#include "internal.h" #include "eval_intern.h" -#include "iseq.h" #include "gc.h" -#include "ruby/vm.h" -#include "vm_core.h" #include "mjit.h" #include "probes.h" #include "probes_helper.h" -#ifdef HAVE_SYS_PRCTL_H -#include <sys/prctl.h> -#endif NORETURN(void rb_raise_jump(VALUE, VALUE)); void rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec); @@ -1,4 +1,4 @@ -#include "internal.h" static VALUE big(VALUE x) @@ -1,4 +1,4 @@ -#include "internal.h" static VALUE bug_big_zero(VALUE self, VALUE length) @@ -1,4 +1,4 @@ -#include "internal.h" static VALUE big(VALUE x) @@ -1,4 +1,4 @@ -#include "internal.h" static VALUE rb_integer_pack_raw_m(VALUE val, VALUE buf, VALUE numwords_arg, VALUE wordsize_arg, VALUE nails, VALUE flags) @@ -1,4 +1,4 @@ -#include "internal.h" static VALUE big(VALUE x) @@ -1,4 +1,4 @@ -#include "internal.h" static VALUE str2big_poweroftwo(VALUE str, VALUE vbase, VALUE badcheck) @@ -1,4 +1,4 @@ -#include "internal.h" static VALUE int_bignum_p(VALUE self) @@ -1,4 +1,4 @@ -#include "internal.h" #if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H) static VALUE @@ -1,5 +1,5 @@ #include "ruby.h" -#include "internal.h" static VALUE bug_str_capacity(VALUE klass, VALUE str) @@ -1,5 +1,6 @@ -#include "ruby/encoding.h" #include "internal.h" static VALUE bug_str_cstr_term(VALUE str) @@ -1,4 +1,4 @@ -#include "internal.h" #ifdef __APPLE__ static VALUE @@ -1,6 +1,5 @@ -#include "ruby.h" -void ruby_reset_leap_second_info(void); static VALUE bug_time_s_reset_leap_second_info(VALUE klass) { @@ -8,9 +8,11 @@ ************************************************/ #include "ruby.h" #include "vm_core.h" -#include "gc.h" static int current_mode; static VALUE me2counter = Qnil; @@ -12,12 +12,16 @@ **********************************************************************/ -#include <ruby/io.h> #include "internal.h" -#include <ruby/st.h> -#include <ruby/re.h> #include "node.h" -#include "gc.h" #include "symbol.h" /* @@ -12,13 +12,15 @@ **********************************************************************/ -#include "ruby/io.h" -#include "internal.h" -#include "ruby/debug.h" #include "gc.h" #include "node.h" -#include "vm_core.h" #include "objspace.h" static VALUE sym_output, sym_stdout, sym_string, sym_file; static VALUE sym_full; @@ -1,45 +1,51 @@ -#include "ruby/config.h" #ifdef RUBY_EXTCONF_H -#include RUBY_EXTCONF_H #endif -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <sys/file.h> -#include <fcntl.h> -#include <errno.h> #ifdef HAVE_PWD_H -#include <pwd.h> #endif #ifdef HAVE_SYS_IOCTL_H -#include <sys/ioctl.h> #endif #ifdef HAVE_LIBUTIL_H -#include <libutil.h> #endif #ifdef HAVE_UTIL_H -#include <util.h> #endif #ifdef HAVE_PTY_H -#include <pty.h> #endif #if defined(HAVE_SYS_PARAM_H) - /* for __FreeBSD_version */ # include <sys/param.h> #endif #ifdef HAVE_SYS_WAIT_H -#include <sys/wait.h> #else -#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) #endif -#include <ctype.h> - -#include "ruby/io.h" -#include "internal.h" -#include "ruby/util.h" -#include <signal.h> #ifdef HAVE_SYS_STROPTS_H #include <sys/stropts.h> #endif @@ -48,6 +54,12 @@ #include <unistd.h> #endif #define DEVICELEN 16 #ifndef HAVE_SETEUID @@ -1,12 +1,12 @@ #ifndef RUBY_SOCKET_H #define RUBY_SOCKET_H 1 -#include "ruby/ruby.h" -#include "ruby/io.h" -#include "ruby/thread.h" -#include "ruby/util.h" -#include "internal.h" #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> @@ -56,12 +56,11 @@ #ifdef HAVE_NETPACKET_PACKET_H # include <netpacket/packet.h> #endif #ifdef HAVE_NET_ETHERNET_H # include <net/ethernet.h> #endif -#include <errno.h> - #ifdef HAVE_SYS_UN_H # include <sys/un.h> #endif @@ -87,12 +86,15 @@ # endif # include <ifaddrs.h> #endif #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif #ifdef HAVE_SYS_SOCKIO_H # include <sys/sockio.h> #endif #ifdef HAVE_NET_IF_H # include <net/if.h> #endif @@ -100,16 +102,40 @@ #ifdef HAVE_SYS_PARAM_H # include <sys/param.h> #endif #ifdef HAVE_SYS_UCRED_H # include <sys/ucred.h> #endif #ifdef HAVE_UCRED_H # include <ucred.h> #endif #ifdef HAVE_NET_IF_DL_H # include <net/if_dl.h> #endif #ifndef HAVE_TYPE_SOCKLEN_T typedef int socklen_t; #endif @@ -143,11 +169,6 @@ unsigned int if_nametoindex(const char *); */ #define pseudo_AF_FTIP pseudo_AF_RTIP -#ifndef HAVE_GETADDRINFO -# include "addrinfo.h" -#endif - -#include "sockport.h" #ifndef NI_MAXHOST # define NI_MAXHOST 1025 @@ -255,9 +276,7 @@ extern VALUE rb_eSocket; #ifdef SOCKS extern VALUE rb_cSOCKSSocket; -# ifdef SOCKS5 -# include <socks.h> -# else void SOCKSinit(); int Rconnect(); # endif @@ -11,14 +11,22 @@ **********************************************************************/ #ifdef _WIN32 -#include "missing/file.h" #endif #ifdef __CYGWIN__ -#include <windows.h> -#include <sys/cygwin.h> -#include <wchar.h> #endif #ifdef __APPLE__ # if !(defined(__has_feature) && defined(__has_attribute)) /* Maybe a bug in SDK of Xcode 10.2.1 */ @@ -28,21 +36,13 @@ # define API_AVAILABLE(...) # define API_DEPRECATED(...) # endif -#include <CoreFoundation/CFString.h> #endif -#include "id.h" -#include "ruby/encoding.h" -#include "ruby/io.h" -#include "ruby/util.h" -#include "ruby/thread.h" -#include "internal.h" -#include "dln.h" -#include "encindex.h" - #ifdef HAVE_UNISTD_H -#include <unistd.h> #endif #ifdef HAVE_SYS_TIME_H # include <sys/time.h> #endif @@ -60,77 +60,73 @@ int flock(int, int); # define MAXPATHLEN 1024 #endif -#include <ctype.h> - -#include <time.h> - #ifdef HAVE_UTIME_H -#include <utime.h> #elif defined HAVE_SYS_UTIME_H -#include <sys/utime.h> #endif #ifdef HAVE_PWD_H -#include <pwd.h> #endif #ifdef HAVE_SYS_SYSMACROS_H -#include <sys/sysmacros.h> #endif #include <sys/types.h> #include <sys/stat.h> #ifdef HAVE_SYS_MKDEV_H -#include <sys/mkdev.h> #endif #if defined(HAVE_FCNTL_H) -#include <fcntl.h> #endif #if defined(HAVE_SYS_TIME_H) -#include <sys/time.h> #endif #if !defined HAVE_LSTAT && !defined lstat -#define lstat stat #endif /* define system APIs */ #ifdef _WIN32 -#include "win32/file.h" -#define STAT(p, s) rb_w32_ustati128((p), (s)) -#undef lstat -#define lstat(p, s) rb_w32_ulstati128((p), (s)) -#undef access -#define access(p, m) rb_w32_uaccess((p), (m)) -#undef truncate -#define truncate(p, n) rb_w32_utruncate((p), (n)) -#undef chmod -#define chmod(p, m) rb_w32_uchmod((p), (m)) -#undef chown -#define chown(p, o, g) rb_w32_uchown((p), (o), (g)) -#undef lchown -#define lchown(p, o, g) rb_w32_ulchown((p), (o), (g)) -#undef utimensat -#define utimensat(s, p, t, f) rb_w32_uutimensat((s), (p), (t), (f)) -#undef link -#define link(f, t) rb_w32_ulink((f), (t)) -#undef unlink -#define unlink(p) rb_w32_uunlink(p) -#undef rename -#define rename(f, t) rb_w32_urename((f), (t)) -#undef symlink -#define symlink(s, l) rb_w32_usymlink((s), (l)) - -#ifdef HAVE_REALPATH /* Don't use native realpath(3) on Windows, as the check for absolute paths does not work for drive letters. */ -#undef HAVE_REALPATH -#endif #else -#define STAT(p, s) stat((p), (s)) #endif #if defined _WIN32 || defined __APPLE__ @@ -143,7 +139,7 @@ int flock(int, int); /* utime may fail if time is out-of-range for the FS [ruby-dev:38277] */ #if defined DOSISH || defined __CYGWIN__ -# define UTIME_EINVAL #endif /* Solaris 10 realpath(3) doesn't support File.realpath */ @@ -152,10 +148,29 @@ int flock(int, int); #endif #ifdef HAVE_REALPATH -#include <limits.h> -#include <stdlib.h> #endif VALUE rb_cFile; VALUE rb_mFileTest; VALUE rb_cStat; @@ -14,43 +14,25 @@ #define rb_data_object_alloc rb_data_object_alloc #define rb_data_typed_object_alloc rb_data_typed_object_alloc -#include "ruby/encoding.h" -#include "ruby/io.h" -#include "ruby/st.h" -#include "ruby/re.h" -#include "ruby/thread.h" -#include "ruby/util.h" -#include "ruby/debug.h" -#include "internal.h" -#include "eval_intern.h" -#include "vm_core.h" -#include "builtin.h" -#include "gc.h" -#include "constant.h" -#include "ruby_atomic.h" -#include "probes.h" -#include "id_table.h" -#include "symbol.h" -#include <stdio.h> -#include <stdarg.h> -#include <setjmp.h> -#include <sys/types.h> -#include "ruby_assert.h" -#include "debug_counter.h" -#include "transient_heap.h" -#include "mjit.h" -#undef rb_data_object_wrap #ifndef HAVE_MALLOC_USABLE_SIZE # ifdef _WIN32 -# define HAVE_MALLOC_USABLE_SIZE -# define malloc_usable_size(a) _msize(a) # elif defined HAVE_MALLOC_SIZE -# define HAVE_MALLOC_USABLE_SIZE -# define malloc_usable_size(a) malloc_size(a) # endif #endif #ifdef HAVE_MALLOC_USABLE_SIZE # ifdef RUBY_ALTERNATIVE_MALLOC_HEADER # include RUBY_ALTERNATIVE_MALLOC_HEADER @@ -64,28 +46,73 @@ #endif #ifdef HAVE_SYS_TIME_H -#include <sys/time.h> #endif #ifdef HAVE_SYS_RESOURCE_H -#include <sys/resource.h> #endif #if defined _WIN32 || defined __CYGWIN__ -#include <windows.h> #elif defined(HAVE_POSIX_MEMALIGN) #elif defined(HAVE_MEMALIGN) -#include <malloc.h> #endif -#define rb_setjmp(env) RUBY_SETJMP(env) -#define rb_jmp_buf rb_jmpbuf_t #if defined(_MSC_VER) && defined(_WIN64) -#include <intrin.h> -#pragma intrinsic(_umul128) #endif /* Expecting this struct to be eliminated by function inlinings */ struct optional { bool left; @@ -3807,8 +3834,6 @@ rb_obj_id(VALUE obj) return rb_find_object_id(obj, cached_object_id); } -#include "regint.h" - static size_t obj_memsize_of(VALUE obj, int use_all_types) { @@ -1,6 +1,6 @@ - #ifndef RUBY_GC_H #define RUBY_GC_H 1 #if defined(__x86_64__) && !defined(_ILP32) && defined(__GNUC__) #define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p))) @@ -11,17 +11,10 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/st.h" -#include "ruby/util.h" -#include "internal.h" #include <errno.h> -#include "probes.h" -#include "id.h" -#include "symbol.h" -#include "debug_counter.h" -#include "transient_heap.h" -#include "ruby_assert.h" #ifdef __APPLE__ # ifdef HAVE_CRT_EXTERNS_H # include <crt_externs.h> @@ -30,6 +23,26 @@ # endif #endif #ifndef HASH_DEBUG #define HASH_DEBUG 0 #endif @@ -1,5 +1,7 @@ #ifndef RUBY_ID_TABLE_H #define RUBY_ID_TABLE_H 1 #include "ruby/ruby.h" struct rb_id_table; @@ -9,7 +9,8 @@ **********************************************************************/ -#include "internal.h" #include "builtin.h" #include "prelude.rbinc" @@ -18,17 +18,9 @@ # error not for C++ #endif -#include "ruby/encoding.h" -#include "ruby/io.h" -#include "internal/stdbool.h" -#include "internal/bits.h" - #define LIKELY(x) RB_LIKELY(x) #define UNLIKELY(x) RB_UNLIKELY(x) -#include "internal/compilers.h" -#include "internal/sanitizers.h" - #define numberof(array) ((int)(sizeof(array) / sizeof((array)[0]))) #define roomof(x, y) (((x) + (y) - 1) / (y)) #define type_roomof(x, y) roomof(sizeof(x), sizeof(y)) @@ -36,54 +28,50 @@ /* Prevent compiler from reordering access */ #define ACCESS_ONCE(type,x) (*((volatile type *)&(x))) -#include "internal/serial.h" -#include "internal/static_assert.h" -#include "internal/time.h" -#include "internal/fixnum.h" -#include "internal/bignum.h" -#include "internal/rational.h" -#include "internal/numeric.h" -#include "internal/complex.h" -#include "internal/hash.h" -#include "internal/missing.h" -#include "internal/struct.h" -#include "internal/class.h" -#include "internal/imemo.h" -#include "internal/compar.h" -#include "internal/variable.h" -#include "internal/array.h" -#include "internal/debug.h" -#include "internal/compile.h" -#include "internal/cont.h" -#include "internal/dir.h" -#include "internal/encoding.h" -#include "internal/enum.h" -#include "internal/eval.h" -#include "internal/error.h" -#include "internal/file.h" -#include "internal/gc.h" -#include "internal/io.h" -#include "internal/load.h" -#include "internal/loadpath.h" -#include "internal/math.h" -#include "internal/mjit.h" -#include "internal/object.h" -#include "internal/parse.h" -#include "internal/proc.h" -#include "internal/process.h" -#include "internal/range.h" -#include "internal/re.h" -#include "internal/signal.h" -#include "internal/string.h" -#include "internal/symbol.h" -#include "internal/thread.h" -#include "internal/transcode.h" -#include "internal/enc.h" -#include "internal/util.h" -#include "internal/vm.h" -#include "internal/enumerator.h" -#include "internal/random.h" -#include "internal/inits.h" -#include "internal/warnings.h" #endif /* RUBY_INTERNAL_H */ @@ -9,7 +9,6 @@ * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. */ - #include "ruby/config.h" #include <stddef.h> /* for size_t */ #include "internal/static_assert.h" /* for STATIC_ASSERT */ @@ -87,6 +86,7 @@ RARY_TRANSIENT_UNSET(VALUE ary) #endif } #if defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO) #define rb_ary_new_from_args(n, ...) \ __extension__ ({ \ @@ -16,8 +16,13 @@ #include "ruby/intern.h" /* for rb_alloc_func_t */ #include "ruby/ruby.h" /* for struct RBasic */ -#undef RClass /* See also include/ruby/backward.h */ -#undef RCLASS_SUPER struct rb_deprecated_classext_struct { char conflict[sizeof(VALUE) * 3]; @@ -9,7 +9,6 @@ * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. */ - #include "ruby/defines.h" /* for GCC_VERSION_SINCE */ #ifdef _MSC_VER @@ -17,7 +17,16 @@ #include "ruby/intern.h" /* for rb_exc_raise */ #include "ruby/ruby.h" /* for enum ruby_value_type */ -#undef Check_Type /* in ruby/ruby.h */ #define rb_raise_static(e, m) \ rb_raise_cstr_i((e), rb_str_new_static((m), rb_strlen_lit(m))) #ifdef RUBY_FUNCTION_NAME_STRING @@ -18,9 +18,11 @@ struct rb_execution_context_struct; /* in vm_core.h */ -#undef NEWOBJ_OF -#undef RB_NEWOBJ_OF -#undef RB_OBJ_WRITE /* optimized version of NEWOBJ() */ #define RB_NEWOBJ_OF(var, T, c, f) \ @@ -55,8 +55,14 @@ struct RHash { }; #define RHASH(obj) (R_CAST(RHash)(obj)) -#undef RHASH_IFNONE -#undef RHASH_SIZE /* hash.c */ void rb_hash_st_table_set(VALUE hash, st_table *st); @@ -19,6 +19,9 @@ VALUE rb_io_flush_raw(VALUE, int); size_t rb_io_memsize(const rb_io_t *); int rb_stderr_tty_p(void); void rb_io_fptr_finalize_internal(void *ptr); #define rb_io_fptr_finalize rb_io_fptr_finalize_internal RUBY_SYMBOL_EXPORT_BEGIN @@ -10,11 +10,6 @@ * file COPYING are met. Consult the file for details. */ #include "ruby/ruby.h" /* for VALUE */ - -#ifndef USE_SYMBOL_GC -# define USE_SYMBOL_GC 1 -#endif - struct rb_iseq_struct; /* in vm_core.h */ /* parse.y */ @@ -19,6 +19,10 @@ #define STR_NOEMBED FL_USER1 #define STR_SHARED FL_USER2 /* = ELTS_SHARED */ /* string.c */ VALUE rb_fstring(VALUE); VALUE rb_fstring_cstr(const char *str); @@ -12,6 +12,7 @@ #include "internal/gc.h" /* for RB_OBJ_WRITE */ #include "internal/stdbool.h" /* for bool */ #include "ruby/ruby.h" /* for struct RBasic */ enum { RSTRUCT_EMBED_LEN_MAX = RVALUE_EMBED_LEN_MAX, @@ -32,10 +33,22 @@ struct RStruct { }; #define RSTRUCT(obj) (R_CAST(RStruct)(obj)) -#undef RSTRUCT_LEN -#undef RSTRUCT_PTR -#undef RSTRUCT_SET -#undef RSTRUCT_GET /* struct.c */ VALUE rb_struct_init_copy(VALUE copy, VALUE s); @@ -13,6 +13,10 @@ #include "ruby/encoding.h" /* for rb_encoding */ #include "internal/compilers.h" /* for __has_builtin */ /* symbol.c */ VALUE rb_to_symbol_type(VALUE obj); VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc); @@ -9,7 +9,6 @@ * modify this file, provided that the conditions mentioned in the * file COPYING are met. Consult the file for details. */ - #include "ruby/config.h" #include <stddef.h> /* for size_t */ #include "constant.h" /* for rb_const_entry_t */ @@ -15,6 +15,14 @@ #include "ruby/ruby.h" /* for ID */ #include "ruby/st.h" /* for st_table */ /* I have several reasons to choose 64 here: * * - A cache line must be a power-of-two size. @@ -11,38 +11,31 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/io.h" -#include "ruby/thread.h" -#include "internal.h" -#include "dln.h" -#include "encindex.h" -#include "id.h" #include <ctype.h> #include <errno.h> -#include "ruby_atomic.h" -#include "ccan/list/list.h" /* non-Linux poll may not work on all FDs */ #if defined(HAVE_POLL) -# if defined(__linux__) -# define USE_POLL 1 -# endif -# if defined(__FreeBSD_version) && __FreeBSD_version >= 1100000 -# define USE_POLL 1 -# endif #endif #ifndef USE_POLL -# define USE_POLL 0 -#endif - -#if !USE_POLL -# include "vm_core.h" #endif -#include "builtin.h" - #undef free #define free(x) xfree(x) @@ -119,7 +112,31 @@ # include <copyfile.h> #endif #include "ruby/util.h" #ifndef O_ACCMODE #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) @@ -9,25 +9,37 @@ **********************************************************************/ -#include "internal.h" -#include "ruby/util.h" -#include "eval_intern.h" #ifdef HAVE_DLADDR # include <dlfcn.h> #endif -#define RUBY_VM_INSNS_INFO 1 -/* #define RUBY_MARK_FREE_DEBUG 1 */ #include "gc.h" -#include "vm_core.h" -#include "iseq.h" #include "id_table.h" -#include "builtin.h" #include "insns.inc" #include "insns_info.inc" -#include "mjit.h" VALUE rb_cISeq; static VALUE iseqw_new(const rb_iseq_t *iseq); @@ -11,6 +11,8 @@ #ifndef RUBY_ISEQ_H #define RUBY_ISEQ_H 1 RUBY_EXTERN const int ruby_api_version[]; #define ISEQ_MAJOR_VERSION ((unsigned int)ruby_api_version[0]) @@ -2,13 +2,20 @@ * load methods from eval.c */ -#include "ruby/encoding.h" -#include "ruby/util.h" -#include "internal.h" #include "dln.h" #include "eval_intern.h" -#include "probes.h" #include "iseq.h" static VALUE ruby_dln_librefs; @@ -9,13 +9,7 @@ **********************************************************************/ -#include "ruby/ruby.h" -#include "ruby/io.h" -#include "internal.h" -#include "ruby/st.h" -#include "ruby/util.h" -#include "encindex.h" -#include "id_table.h" #include <math.h> #ifdef HAVE_FLOAT_H @@ -25,6 +19,23 @@ #include <ieeefp.h> #endif #define BITSPERSHORT (2*CHAR_BIT) #define SHORTMASK ((1<<BITSPERSHORT)-1) #define SHORTDN(x) RSHIFT((x),BITSPERSHORT) @@ -9,13 +9,22 @@ **********************************************************************/ #ifdef _MSC_VER # define _USE_MATH_DEFINES 1 #endif -#include "internal.h" #include <float.h> #include <math.h> -#include <errno.h> #if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun) && \ !defined(signbit) @@ -12,6 +12,9 @@ #define RUBY_METHOD_H 1 #include "internal.h" #ifndef END_OF_ENUMERATION # if defined(__GNUC__) &&! defined(__STRICT_ANSI__) @@ -1,6 +1,7 @@ #include "internal.h" -#include "vm_core.h" #include "iseq.h" #include "builtin.h" #include "miniprelude.c" @@ -11,14 +11,20 @@ // To share variables privately, include mjit_worker.c instead of linking. -#include "internal.h" #if USE_MJIT -#include "mjit_worker.c" - #include "constant.h" #include "id_table.h" // Copy ISeq's states so that race condition does not happen on compilation. static void @@ -9,11 +9,14 @@ #ifndef RUBY_MJIT_H #define RUBY_MJIT_H 1 -#include "ruby.h" -#include "debug_counter.h" #if USE_MJIT // Special address values of a function generated from the // corresponding iseq by MJIT: enum rb_mjit_iseq_func { @@ -10,17 +10,22 @@ // call Ruby methods (C functions that may call rb_funcall) or trigger // GC (using ZALLOC, xmalloc, xfree, etc.) in this file. -#include "internal.h" #if USE_MJIT #include "vm_core.h" #include "vm_exec.h" -#include "mjit.h" #include "builtin.h" #include "insns.inc" #include "insns_info.inc" -#include "vm_insnhelper.h" // Macros to check if a position is already compiled using compile_status.stack_size_for_pos #define NOT_COMPILED_STACK_SIZE -1 @@ -9,6 +9,9 @@ **********************************************************************/ #include "ruby/ruby.h" #include "vm_core.h" @@ -9,10 +9,8 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/util.h" -#include "internal.h" -#include "id.h" #include <assert.h> #include <ctype.h> #include <math.h> @@ -26,6 +24,22 @@ #include <ieeefp.h> #endif /* use IEEE 64bit values if not defined */ #ifndef FLT_RADIX #define FLT_RADIX 2 @@ -11,18 +11,31 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/st.h" -#include "ruby/util.h" -#include "internal.h" -#include <stdio.h> -#include <errno.h> #include <ctype.h> -#include <math.h> #include <float.h> #include "constant.h" #include "id.h" #include "probes.h" /*! * \defgroup object Core objects and their operations @@ -9,12 +9,20 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "internal.h" -#include <sys/types.h> #include <ctype.h> #include <errno.h> #include <float.h> #include "builtin.h" /* @@ -20,18 +20,37 @@ #define YYLTYPE rb_code_location_t #define YYLTYPE_IS_DECLARED 1 -#include "ruby/ruby.h" -#include "ruby/st.h" -#include "ruby/encoding.h" #include "internal.h" #include "node.h" #include "parse.h" -#include "symbol.h" -#include "regenc.h" -#include <stdio.h> -#include <errno.h> -#include <ctype.h> #include "probes.h" #ifndef WARN_PAST_SCOPE # define WARN_PAST_SCOPE 0 @@ -5531,9 +5550,6 @@ ripper_dis_delayed_token(struct parser_params *p, enum yytokentype t) #define has_delayed_token(p) (!NIL_P(p->delayed.token)) #endif /* RIPPER */ -#include "ruby/regex.h" -#include "ruby/util.h" - static inline int is_identchar(const char *ptr, const char *MAYBE_UNUSED(ptr_end), rb_encoding *enc) { @@ -10,10 +10,15 @@ **********************************************************************/ #include "eval_intern.h" -#include "internal.h" #include "gc.h" -#include "vm_core.h" #include "iseq.h" /* Proc.new with no block will raise an exception in the future * versions */ @@ -12,82 +12,106 @@ **********************************************************************/ #include "ruby/config.h" -#include "ruby/io.h" -#include "internal.h" -#include "ruby/thread.h" -#include "ruby/util.h" -#include "vm_core.h" -#include "hrtime.h" -#include <stdio.h> #include <errno.h> #include <signal.h> #ifdef HAVE_STDLIB_H -#include <stdlib.h> #endif #ifdef HAVE_UNISTD_H -#include <unistd.h> #endif #ifdef HAVE_FCNTL_H -#include <fcntl.h> #endif #ifdef HAVE_PROCESS_H -#include <process.h> #endif -#include <time.h> -#include <ctype.h> - #ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 #endif #ifndef EXIT_FAILURE -#define EXIT_FAILURE 1 #endif #ifdef HAVE_SYS_WAIT_H # include <sys/wait.h> #endif #ifdef HAVE_SYS_RESOURCE_H # include <sys/resource.h> #endif #ifdef HAVE_VFORK_H # include <vfork.h> #endif #ifdef HAVE_SYS_PARAM_H # include <sys/param.h> #endif #ifndef MAXPATHLEN # define MAXPATHLEN 1024 #endif -#include "ruby/st.h" #include <sys/stat.h> #ifdef HAVE_SYS_TIME_H -#include <sys/time.h> #endif #ifdef HAVE_SYS_TIMES_H -#include <sys/times.h> #endif #ifdef HAVE_PWD_H -#include <pwd.h> #endif #ifdef HAVE_GRP_H -#include <grp.h> # ifdef __CYGWIN__ int initgroups(const char *, rb_gid_t); # endif #endif #ifdef HAVE_SYS_ID_H -#include <sys/id.h> #endif #ifdef __APPLE__ # include <mach/mach_time.h> #endif /* define system APIs */ #ifdef _WIN32 #undef open @@ -317,8 +341,6 @@ close_unless_reserved(int fd) /*#define DEBUG_REDIRECT*/ #if defined(DEBUG_REDIRECT) -#include <stdarg.h> - static void ttyprintf(const char *fmt, ...) { @@ -1572,8 +1594,6 @@ after_fork_ruby(void) } #endif -#include "dln.h" - #if defined(HAVE_WORKING_FORK) /* try_with_sh and exec_with_sh should be async-signal-safe. Actually it is.*/ @@ -9,41 +9,59 @@ **********************************************************************/ -#include "internal.h" #include <limits.h> #ifdef HAVE_UNISTD_H -#include <unistd.h> #endif -#include <time.h> #include <sys/types.h> #include <sys/stat.h> #ifdef HAVE_FCNTL_H -#include <fcntl.h> #endif -#include <math.h> -#include <errno.h> #if defined(HAVE_SYS_TIME_H) -#include <sys/time.h> #endif #ifdef HAVE_SYSCALL_H -#include <syscall.h> #elif defined HAVE_SYS_SYSCALL_H -#include <sys/syscall.h> #endif #ifdef _WIN32 -#include <windows.h> -#include <wincrypt.h> #endif -#include "ruby_atomic.h" #ifdef __OpenBSD__ /* to define OpenBSD for version check */ -#include <sys/param.h> #endif typedef int int_must_be_32bit_at_least[sizeof(int) * CHAR_BIT < 32 ? -1 : 1]; #include "missing/mt19937.c" @@ -320,11 +338,7 @@ fill_random_bytes_urandom(void *seed, size_t size) # define fill_random_bytes_urandom(seed, size) -1 #endif -#if defined HAVE_GETRANDOM -# include <sys/random.h> -#elif defined __linux__ && defined __NR_getrandom -# include <linux/random.h> - # ifndef GRND_NONBLOCK # define GRND_NONBLOCK 0x0001 /* not defined in musl libc */ # endif @@ -9,14 +9,24 @@ **********************************************************************/ -#include "internal.h" -#include "id.h" #include <assert.h> #ifdef HAVE_FLOAT_H #include <float.h> #endif -#include <math.h> VALUE rb_cRange; static ID id_beg, id_end, id_excl; @@ -5,23 +5,32 @@ which is written in ruby. */ -#include "internal.h" -#include "id.h" -#include <math.h> #include <float.h> #ifdef HAVE_IEEEFP_H #include <ieeefp.h> #endif -#define NDEBUG -#include "ruby_assert.h" - #if defined(HAVE_LIBGMP) && defined(HAVE_GMP_H) #define USE_GMP #include <gmp.h> #endif #define ZERO INT2FIX(0) #define ONE INT2FIX(1) #define TWO INT2FIX(2) @@ -2299,8 +2308,6 @@ float_rationalize(int argc, VALUE *argv, VALUE self) } } -#include <ctype.h> - inline static int issign(int c) { @@ -9,13 +9,20 @@ **********************************************************************/ #include "ruby/encoding.h" #include "ruby/re.h" #include "ruby/util.h" -#include "internal.h" -#include "regint.h" -#include "encindex.h" -#include <ctype.h> VALUE rb_eRegexpError; @@ -11,38 +11,57 @@ **********************************************************************/ -#ifdef __CYGWIN__ -#include <windows.h> -#include <sys/cygwin.h> -#endif -#include "ruby/encoding.h" -#include "ruby/thread.h" -#include "ruby/version.h" -#include "internal.h" -#include "eval_intern.h" -#include "dln.h" #include <stdio.h> #include <sys/types.h> -#include <ctype.h> #ifdef __hpux -#include <sys/pstat.h> #endif #if defined(LOAD_RELATIVE) && defined(HAVE_DLADDR) -#include <dlfcn.h> #endif #ifdef HAVE_UNISTD_H -#include <unistd.h> #endif #if defined(HAVE_FCNTL_H) -#include <fcntl.h> #elif defined(HAVE_SYS_FCNTL_H) -#include <sys/fcntl.h> #endif #ifdef HAVE_SYS_PARAM_H # include <sys/param.h> #endif #ifndef MAXPATHLEN # define MAXPATHLEN 1024 #endif @@ -50,10 +69,6 @@ # define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) #endif -#include "ruby/util.h" - -#include "mjit.h" - void Init_ruby_description(void); #ifndef HAVE_STDLIB_H @@ -11,36 +11,39 @@ **********************************************************************/ -#include "internal.h" -#include "vm_core.h" #include <signal.h> #include <stdio.h> -#include <errno.h> -#include "ruby_atomic.h" -#include "eval_intern.h" #ifdef HAVE_UNISTD_H # include <unistd.h> #endif #ifdef HAVE_SYS_UIO_H -#include <sys/uio.h> #endif #ifdef HAVE_UCONTEXT_H -#include <ucontext.h> #endif -#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 #ifdef NEED_RUBY_ATOMIC_OPS rb_atomic_t ruby_atomic_exchange(rb_atomic_t *ptr, rb_atomic_t val) @@ -395,7 +398,6 @@ interrupt_init(int argc, VALUE *argv, VALUE self) return rb_call_super(2, args); } -#include "debug_counter.h" void rb_malloc_info_show_results(void); /* gc.c */ void @@ -728,10 +730,6 @@ rb_signal_buff_size(void) return signal_buff.size; } -#if HAVE_PTHREAD_H -#include <pthread.h> -#endif - static void rb_disable_interrupt(void) { @@ -11,17 +11,27 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/re.h" -#include "internal.h" -#include "id.h" #include <math.h> #include <stdarg.h> #ifdef HAVE_IEEEFP_H -#include <ieeefp.h> #endif #define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */ static char *fmt_setup(char*,size_t,int,int,int,int); @@ -105,6 +105,9 @@ #include "st.h" #else #include "internal.h" #endif #include <stdio.h> @@ -47,10 +47,7 @@ * January 1996 */ -#include "ruby/ruby.h" -#include "ruby/encoding.h" -#include "timev.h" -#include "internal.h" #ifndef GAWK #include <stdio.h> @@ -68,6 +65,14 @@ #endif #include <math.h> /* defaults: season to taste */ #define SYSV_EXT 1 /* stuff in System V ascftime routine */ #define SUNOS_EXT 1 /* stuff in SunOS strftime routine */ @@ -11,37 +11,52 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/re.h" -#include "internal.h" -#include "encindex.h" -#include "probes.h" -#include "gc.h" -#include "ruby_assert.h" -#include "id.h" -#include "debug_counter.h" -#include "ruby/util.h" - -#define BEG(no) (regs->beg[(no)]) -#define END(no) (regs->end[(no)]) #include <errno.h> #include <math.h> -#include <ctype.h> #ifdef HAVE_UNISTD_H -#include <unistd.h> #endif #if defined HAVE_CRYPT_R # if defined HAVE_CRYPT_H -# include <crypt.h> # endif #elif !defined HAVE_CRYPT # include "missing/crypt.h" # define HAVE_CRYPT_R 1 #endif #undef rb_str_new #undef rb_usascii_str_new #undef rb_utf8_str_new @@ -9,10 +9,17 @@ **********************************************************************/ -#include "internal.h" -#include "vm_core.h" #include "id.h" #include "transient_heap.h" /* only for struct[:field] access */ enum { @@ -9,13 +9,22 @@ **********************************************************************/ #include "ruby/encoding.h" #include "ruby/st.h" -#include "internal.h" #include "symbol.h" -#include "gc.h" -#include "probes.h" #ifndef SYMBOL_DEBUG # define SYMBOL_DEBUG 0 #endif @@ -13,6 +13,7 @@ #define RUBY_SYMBOL_H 1 #include "id.h" #define DYNAMIC_ID_P(id) (!(id&ID_STATIC_SYM)&&id>tLAST_OP_ID) #define STATIC_ID2SYM(id) (((VALUE)(id)<<RUBY_SPECIAL_SHIFT)|SYMBOL_FLAG) @@ -87,10 +87,11 @@ Prelude.new(output, ARGV, vpath).instance_eval do sources: <%= @preludes.map {|n,*| prelude_base(n)}.join(', ') %><%=%> */ %unless @preludes.empty? -#include "ruby/ruby.h" #include "internal.h" -#include "vm_core.h" #include "iseq.h" % preludes = @preludes.values.sort % preludes.each {|i, prelude, lines, sub| @@ -64,23 +64,34 @@ /* for model 2 */ #include "ruby/config.h" -#include "ruby/io.h" #include "eval_intern.h" -#include "timev.h" -#include "ruby/thread.h" -#include "ruby/thread_native.h" -#include "ruby/debug.h" #include "gc.h" #include "internal.h" #include "iseq.h" -#include "vm_core.h" #include "mjit.h" -#include "hrtime.h" - -#ifdef __linux__ -// Normally, gcc(1) translates calls to alloca() with inlined code. This is not done when either the -ansi, -std=c89, -std=c99, or the -std=c11 option is given and the header <alloca.h> is not included. -#include <alloca.h> -#endif #ifndef USE_NATIVE_THREAD_PRIORITY #define USE_NATIVE_THREAD_PRIORITY 0 @@ -11,29 +11,37 @@ #define _DEFAULT_SOURCE #define _BSD_SOURCE -#include "ruby/encoding.h" -#include "internal.h" -#include <sys/types.h> -#include <time.h> #include <errno.h> #ifdef HAVE_UNISTD_H -#include <unistd.h> #endif -#include <float.h> -#include <math.h> - #ifdef HAVE_STRINGS_H -#include <strings.h> #endif #if defined(HAVE_SYS_TIME_H) -#include <sys/time.h> #endif -#include "timev.h" #include "id.h" static ID id_submicro, id_nano_num, id_nano_den, id_offset, id_zone; static ID id_nanosecond, id_microsecond, id_millisecond, id_nsec, id_usec; @@ -1,5 +1,6 @@ #ifndef RUBY_TIMEV_H #define RUBY_TIMEV_H #if 0 struct vtm {/* dummy for TAGS */}; @@ -127,13 +127,18 @@ def mk_builtin_header file f.puts "// auto-generated file" f.puts "// by #{__FILE__}" f.puts "// with #{file}" f.puts - lineno = 6 line_file = file.gsub('\\', '/') inlines.each{|cfunc_name, (body_lineno, text, params, func_name)| if String === cfunc_name - f.puts "static VALUE #{cfunc_name}(rb_execution_context_t *ec, const VALUE self) {" lineno += 1 params.reverse_each.with_index{|param, i| @@ -9,10 +9,18 @@ **********************************************************************/ -#include "ruby/encoding.h" #include "internal.h" #include "transcode_data.h" -#include <ctype.h> #define ENABLE_ECONV_NEWLINE_OPTION 1 @@ -6,14 +6,20 @@ **********************************************************************/ -#include "ruby/ruby.h" -#include "ruby/debug.h" -#include "vm_debug.h" #include "gc.h" #include "internal.h" #include "ruby_assert.h" #include "transient_heap.h" -#include "debug_counter.h" #if USE_TRANSIENT_HEAP /* USE_TRANSIENT_HEAP */ /* @@ -10,21 +10,24 @@ **********************************************************************/ #if defined __MINGW32__ || defined __MINGW64__ -#define MINGW_HAS_SECURE_API 1 #endif -#include "internal.h" #include <ctype.h> -#include <stdio.h> #include <errno.h> -#include <math.h> #include <float.h> #ifdef _WIN32 -#include "missing/file.h" #endif #include "ruby/util.h" const char ruby_hexdigits[] = "0123456789abcdef0123456789ABCDEF"; @@ -11,19 +11,30 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/st.h" -#include "ruby/util.h" -#include "internal.h" -#include "id_table.h" #include "constant.h" #include "id.h" -#include "ccan/list/list.h" #include "id_table.h" -#include "debug_counter.h" -#include "vm_core.h" #include "transient_heap.h" #include "variable.h" static struct rb_id_table *rb_global_tbl; static ID autoload, classpath, tmp_classpath; @@ -8,17 +8,33 @@ **********************************************************************/ -#include "internal.h" -#include "ruby/vm.h" -#include "ruby/st.h" - #define vm_exec rb_vm_exec #include "gc.h" #include "vm_core.h" #include "vm_debug.h" -#include "iseq.h" -#include "eval_intern.h" #include "builtin.h" #ifndef MJIT_HEADER @@ -338,9 +354,6 @@ extern VALUE rb_vm_invoke_bmethod(rb_execution_context_t *ec, rb_proc_t *proc, V const rb_callable_method_entry_t *me); static VALUE vm_invoke_proc(rb_execution_context_t *ec, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, int kw_splat, VALUE block_handler); -#include "mjit.h" -#include "vm_insnhelper.h" -#include "vm_exec.h" #include "vm_insnhelper.c" #ifndef MJIT_HEADER @@ -9,13 +9,13 @@ **********************************************************************/ -#include "ruby/encoding.h" -#include "ruby/debug.h" -#include "internal.h" - -#include "vm_core.h" #include "eval_intern.h" #include "iseq.h" static VALUE rb_cBacktrace; static VALUE rb_cBacktraceLocation; @@ -46,6 +46,19 @@ #define VMDEBUG 3 #endif #include "ruby_assert.h" #if VM_CHECK_MODE > 0 @@ -57,27 +70,21 @@ #define VM_UNREACHABLE(func) UNREACHABLE #endif -#define RUBY_VM_THREAD_MODEL 2 - -/* - * implementation selector of get_insn_info algorithm - * 0: linear search - * 1: binary search - * 2: succinct bitvector - */ -#ifndef VM_INSN_INFO_TABLE_IMPL -# define VM_INSN_INFO_TABLE_IMPL 2 -#endif - -#include "ruby/ruby.h" -#include "ruby/st.h" -#include "node.h" -#include "vm_opts.h" #include "id.h" #include "method.h" #include "ruby_atomic.h" -#include "ccan/list/list.h" #include "ruby/thread_native.h" #if defined(_WIN32) @@ -86,8 +93,17 @@ #include "thread_pthread.h" #endif -#include <setjmp.h> -#include <signal.h> #if defined(NSIG_MAX) /* POSIX issue 8 */ # undef NSIG @@ -123,14 +139,6 @@ /* define to 0 to test old code path */ #define WAITPID_USE_SIGCHLD (RUBY_SIGCHLD || SIGCHLD_LOSSY) -#ifdef HAVE_STDARG_S -#include <stdarg.h> -#define va_init_list(a,b) va_start((a),(b)) -#else -#include <varargs.h> -#define va_init_list(a,b) va_start((a)) -#endif - #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__) # define USE_SIGALTSTACK void *rb_register_sigaltstack(void); @@ -8,27 +8,32 @@ **********************************************************************/ - -#include "internal.h" -#include "addr2line.h" -#include "vm_core.h" -#include "iseq.h" -#include "gc.h" #ifdef HAVE_UCONTEXT_H -#include <ucontext.h> #endif #ifdef __APPLE__ -#ifdef HAVE_LIBPROC_H -#include <libproc.h> -#endif -#include <mach/vm_map.h> -#include <mach/mach_init.h> -#ifdef __LP64__ -#define vm_region_recurse vm_region_recurse_64 -#endif #endif /* see vm_insnhelper.h for the values */ #ifndef VMDEBUG #define VMDEBUG 0 @@ -8,18 +8,29 @@ **********************************************************************/ -/* finish iseq array */ -#include "insns.inc" -#ifndef MJIT_HEADER -#include "insns_info.inc" -#endif #include <math.h> #include "constant.h" #include "internal.h" #include "ruby/config.h" -#include "debug_counter.h" #include "variable.h" extern rb_method_definition_t *rb_method_definition_create(rb_method_type_t type, ID mid); extern void rb_method_definition_set(const rb_method_entry_t *me, rb_method_definition_t *def, void *opts); extern int rb_method_definition_eq(const rb_method_definition_t *d1, const rb_method_definition_t *d2); @@ -21,13 +21,15 @@ * */ #include "internal.h" #include "ruby/debug.h" - #include "vm_core.h" -#include "mjit.h" -#include "iseq.h" -#include "eval_intern.h" #include "builtin.h" /* (1) trace mechanisms */ @@ -1,5 +1,8 @@ #ifndef RUBY_WIN32_DIR_H #define RUBY_WIN32_DIR_H #define DT_UNKNOWN 0 #define DT_DIR (S_IFDIR>>12) @@ -5,6 +5,7 @@ #include "ruby/ruby.h" #include "ruby/encoding.h" #include "internal.h" #include <winbase.h> #include <wchar.h> #include <shlwapi.h> @@ -55,6 +55,10 @@ #include "win32/file.h" #include "id.h" #include "internal.h" #include "encindex.h" #define isdirsep(x) ((x) == '/' || (x) == '\\') |