debase-ruby_core_source 0.10.6 → 0.10.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/README.md +1 -1
  4. data/Rakefile +6 -3
  5. data/debase-ruby_core_source.gemspec +2 -1
  6. data/lib/debase/ruby_core_source.rb +1 -1
  7. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/addr2line.h +21 -0
  8. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/builtin.h +78 -0
  9. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/build_assert/build_assert.h +40 -0
  10. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/check_type/check_type.h +63 -0
  11. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/container_of/container_of.h +142 -0
  12. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/list/list.h +788 -0
  13. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ccan/str/str.h +16 -0
  14. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/constant.h +50 -0
  15. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/debug_counter.h +390 -0
  16. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/dln.h +51 -0
  17. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/encindex.h +69 -0
  18. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/eval_intern.h +312 -0
  19. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/gc.h +131 -0
  20. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/hrtime.h +168 -0
  21. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/id.h +290 -0
  22. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/id_table.h +34 -0
  23. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/insns.inc +253 -0
  24. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/insns_info.inc +9197 -0
  25. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/internal.h +2697 -0
  26. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/iseq.h +312 -0
  27. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/known_errors.inc +791 -0
  28. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/method.h +229 -0
  29. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/mjit.h +177 -0
  30. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/mjit_compile.inc +7779 -0
  31. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/node.h +476 -0
  32. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/node_name.inc +208 -0
  33. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/opt_sc.inc +109 -0
  34. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/optinsn.inc +128 -0
  35. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/optunifs.inc +43 -0
  36. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/parse.h +210 -0
  37. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/probes_helper.h +42 -0
  38. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/regenc.h +254 -0
  39. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/regint.h +938 -0
  40. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/regparse.h +370 -0
  41. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/revision.h +2 -0
  42. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ruby_assert.h +15 -0
  43. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/ruby_atomic.h +244 -0
  44. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/siphash.h +48 -0
  45. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/symbol.h +119 -0
  46. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/thread_pthread.h +75 -0
  47. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/thread_win32.h +36 -0
  48. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/timev.h +56 -0
  49. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/transcode_data.h +139 -0
  50. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/transient_heap.h +62 -0
  51. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/variable.h +9 -0
  52. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/version.h +77 -0
  53. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm.inc +5466 -0
  54. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_call_iseq_optimized.inc +237 -0
  55. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_core.h +1968 -0
  56. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_debug.h +34 -0
  57. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_exec.h +193 -0
  58. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_insnhelper.h +267 -0
  59. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vm_opts.h +72 -0
  60. data/lib/debase/ruby_core_source/ruby-2.7.0-p0/vmtc.inc +247 -0
  61. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/addr2line.h +20 -0
  62. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/builtin.h +83 -0
  63. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/build_assert/build_assert.h +40 -0
  64. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/check_type/check_type.h +63 -0
  65. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/container_of/container_of.h +142 -0
  66. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/list/list.h +788 -0
  67. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ccan/str/str.h +16 -0
  68. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/constant.h +55 -0
  69. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/debug_counter.h +423 -0
  70. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/dln.h +36 -0
  71. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/encindex.h +70 -0
  72. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/eval_intern.h +312 -0
  73. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/gc.h +140 -0
  74. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/hrtime.h +168 -0
  75. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/id.h +290 -0
  76. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/id_table.h +36 -0
  77. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/insns.inc +249 -0
  78. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/insns_info.inc +8979 -0
  79. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal.h +107 -0
  80. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/array.h +114 -0
  81. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/bignum.h +246 -0
  82. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/bits.h +566 -0
  83. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/class.h +168 -0
  84. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compar.h +50 -0
  85. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compile.h +32 -0
  86. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/compilers.h +108 -0
  87. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/complex.h +29 -0
  88. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/cont.h +25 -0
  89. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/dir.h +17 -0
  90. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enc.h +20 -0
  91. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/encoding.h +28 -0
  92. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enum.h +19 -0
  93. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/enumerator.h +22 -0
  94. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/error.h +131 -0
  95. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/eval.h +33 -0
  96. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/file.h +39 -0
  97. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/fixnum.h +185 -0
  98. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/gc.h +154 -0
  99. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/hash.h +240 -0
  100. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/imemo.h +243 -0
  101. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/inits.h +51 -0
  102. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/io.h +35 -0
  103. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/load.h +19 -0
  104. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/loadpath.h +17 -0
  105. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/math.h +24 -0
  106. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/missing.h +19 -0
  107. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/mjit.h +29 -0
  108. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/numeric.h +252 -0
  109. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/object.h +83 -0
  110. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/parse.h +23 -0
  111. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/proc.h +32 -0
  112. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/process.h +136 -0
  113. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/random.h +17 -0
  114. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/range.h +37 -0
  115. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/rational.h +69 -0
  116. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/re.h +29 -0
  117. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/sanitizers.h +191 -0
  118. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/scheduler.h +35 -0
  119. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/serial.h +24 -0
  120. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/signal.h +22 -0
  121. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/static_assert.h +17 -0
  122. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/string.h +135 -0
  123. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/struct.h +154 -0
  124. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/symbol.h +41 -0
  125. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/thread.h +60 -0
  126. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/time.h +35 -0
  127. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/transcode.h +21 -0
  128. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/util.h +31 -0
  129. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/variable.h +83 -0
  130. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/vm.h +135 -0
  131. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/internal/warnings.h +17 -0
  132. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/iseq.h +304 -0
  133. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/known_errors.inc +791 -0
  134. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/method.h +245 -0
  135. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/mjit.h +197 -0
  136. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/mjit_compile.inc +8082 -0
  137. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/node.h +484 -0
  138. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/node_name.inc +210 -0
  139. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/opt_sc.inc +109 -0
  140. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/optinsn.inc +128 -0
  141. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/optunifs.inc +43 -0
  142. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/parse.h +211 -0
  143. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/probes_helper.h +44 -0
  144. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor.h +271 -0
  145. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ractor_pub.h +50 -0
  146. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regenc.h +254 -0
  147. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regint.h +938 -0
  148. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/regparse.h +370 -0
  149. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/revision.h +2 -0
  150. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_assert.h +15 -0
  151. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/ruby_atomic.h +236 -0
  152. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/siphash.h +48 -0
  153. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/symbol.h +119 -0
  154. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/thread_pthread.h +106 -0
  155. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/thread_win32.h +66 -0
  156. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/timev.h +57 -0
  157. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/transcode_data.h +138 -0
  158. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/transient_heap.h +61 -0
  159. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/variable.h +21 -0
  160. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/version.h +89 -0
  161. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm.inc +5360 -0
  162. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_call_iseq_optimized.inc +244 -0
  163. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_callinfo.h +457 -0
  164. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_core.h +1952 -0
  165. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_debug.h +116 -0
  166. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_exec.h +196 -0
  167. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_insnhelper.h +260 -0
  168. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_opts.h +73 -0
  169. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vm_sync.h +97 -0
  170. data/lib/debase/ruby_core_source/ruby-3.0.0-preview1/vmtc.inc +243 -0
  171. data/lib/debase/ruby_core_source/version.rb +1 -1
  172. metadata +183 -5
@@ -0,0 +1,51 @@
1
+ #ifndef INTERNAL_INITS_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_INITS_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header aggregating init functions.
11
+ */
12
+
13
+ /* class.c */
14
+ void Init_class_hierarchy(void);
15
+
16
+ /* dmyext.c */
17
+ void Init_enc(void);
18
+ void Init_ext(void);
19
+
20
+ /* file.c */
21
+ void Init_File(void);
22
+
23
+ /* gc.c */
24
+ void Init_heap(void);
25
+
26
+ /* localeinit.c */
27
+ int Init_enc_set_filesystem_encoding(void);
28
+
29
+ /* newline.c */
30
+ void Init_newline(void);
31
+
32
+ /* vm.c */
33
+ void Init_BareVM(void);
34
+ void Init_vm_objects(void);
35
+
36
+ /* vm_backtrace.c */
37
+ void Init_vm_backtrace(void);
38
+
39
+ /* vm_eval.c */
40
+ void Init_vm_eval(void);
41
+
42
+ /* vm_insnhelper.c */
43
+ void Init_vm_stack_canary(void);
44
+
45
+ /* vm_method.c */
46
+ void Init_eval_method(void);
47
+
48
+ /* inits.c */
49
+ void rb_call_inits(void);
50
+
51
+ #endif /* INTERNAL_INITS_H */
@@ -0,0 +1,35 @@
1
+ #ifndef INTERNAL_IO_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_IO_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for IO.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+ #include "ruby/io.h" /* for rb_io_t */
14
+
15
+ /* io.c */
16
+ void ruby_set_inplace_mode(const char *);
17
+ void rb_stdio_set_default_encoding(void);
18
+ VALUE rb_io_flush_raw(VALUE, int);
19
+ size_t rb_io_memsize(const rb_io_t *);
20
+ int rb_stderr_tty_p(void);
21
+ void rb_io_fptr_finalize_internal(void *ptr);
22
+ #ifdef rb_io_fptr_finalize
23
+ # undef rb_io_fptr_finalize
24
+ #endif
25
+ #define rb_io_fptr_finalize rb_io_fptr_finalize_internal
26
+ VALUE rb_io_popen(VALUE pname, VALUE pmode, VALUE env, VALUE opt);
27
+
28
+ RUBY_SYMBOL_EXPORT_BEGIN
29
+ /* io.c (export) */
30
+ void rb_maygvl_fd_fix_cloexec(int fd);
31
+ int rb_gc_for_fd(int err);
32
+ void rb_write_error_str(VALUE mesg);
33
+ RUBY_SYMBOL_EXPORT_END
34
+
35
+ #endif /* INTERNAL_IO_H */
@@ -0,0 +1,19 @@
1
+ #ifndef INTERNAL_LOAD_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_LOAD_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for require.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+
14
+ /* load.c */
15
+ VALUE rb_get_expanded_load_path(void);
16
+ int rb_require_internal(VALUE fname);
17
+ NORETURN(void rb_load_fail(VALUE, const char*));
18
+
19
+ #endif /* INTERNAL_LOAD_H */
@@ -0,0 +1,17 @@
1
+ #ifndef INTERNAL_LOADPATH_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_LOADPATH_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for $LOAD_PATH.
11
+ */
12
+
13
+ /* loadpath.c */
14
+ extern const char ruby_exec_prefix[];
15
+ extern const char ruby_initial_load_paths[];
16
+
17
+ #endif /* INTERNAL_LOADPATH_H */
@@ -0,0 +1,24 @@
1
+ #ifndef INTERNAL_MATH_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_MATH_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Math.
11
+ */
12
+ #include "ruby/ruby.h" /* for VALUE */
13
+
14
+ /* math.c */
15
+ VALUE rb_math_atan2(VALUE, VALUE);
16
+ VALUE rb_math_cos(VALUE);
17
+ VALUE rb_math_cosh(VALUE);
18
+ VALUE rb_math_exp(VALUE);
19
+ VALUE rb_math_hypot(VALUE, VALUE);
20
+ VALUE rb_math_log(int argc, const VALUE *argv);
21
+ VALUE rb_math_sin(VALUE);
22
+ VALUE rb_math_sinh(VALUE);
23
+
24
+ #endif /* INTERNAL_MATH_H */
@@ -0,0 +1,19 @@
1
+ #ifndef INTERNAL_MISSING_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_MISSING_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header corresponding missing.
11
+ */
12
+ #include "ruby/internal/config.h" /* for HAVE_SETPROCTITLE */
13
+
14
+ /* missing/setproctitle.c */
15
+ #ifndef HAVE_SETPROCTITLE
16
+ extern void ruby_init_setproctitle(int argc, char *argv[]);
17
+ #endif
18
+
19
+ #endif /* INTERNAL_MISSING_H */
@@ -0,0 +1,29 @@
1
+ #ifndef INTERNAL_MJIT_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_MJIT_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for MJIT.
11
+ */
12
+ #include "ruby/internal/stdbool.h" /* for bool */
13
+ #include "ruby/ruby.h" /* for VALUE */
14
+
15
+ /* mjit.c */
16
+
17
+ #if USE_MJIT
18
+ extern bool mjit_enabled;
19
+ VALUE mjit_pause(bool wait_p);
20
+ VALUE mjit_resume(void);
21
+ void mjit_finish(bool close_handle_p);
22
+ #else
23
+ #define mjit_enabled 0
24
+ static inline VALUE mjit_pause(bool wait_p){ return Qnil; } // unreachable
25
+ static inline VALUE mjit_resume(void){ return Qnil; } // unreachable
26
+ static inline void mjit_finish(bool close_handle_p){}
27
+ #endif
28
+
29
+ #endif /* INTERNAL_MJIT_H */
@@ -0,0 +1,252 @@
1
+ #ifndef INTERNAL_NUMERIC_H /*-*-C-*-vi:se ft=c:*/
2
+ #define INTERNAL_NUMERIC_H
3
+ /**
4
+ * @file
5
+ * @author Ruby developers <ruby-core@ruby-lang.org>
6
+ * @copyright This file is a part of the programming language Ruby.
7
+ * Permission is hereby granted, to either redistribute and/or
8
+ * modify this file, provided that the conditions mentioned in the
9
+ * file COPYING are met. Consult the file for details.
10
+ * @brief Internal header for Numeric.
11
+ */
12
+ #include "internal/bignum.h" /* for BIGNUM_POSITIVE_P */
13
+ #include "internal/bits.h" /* for RUBY_BIT_ROTL */
14
+ #include "internal/fixnum.h" /* for FIXNUM_POSITIVE_P */
15
+ #include "internal/vm.h" /* for rb_method_basic_definition_p */
16
+ #include "ruby/intern.h" /* for rb_cmperr */
17
+ #include "ruby/ruby.h" /* for USE_FLONUM */
18
+
19
+ #define ROUND_TO(mode, even, up, down) \
20
+ ((mode) == RUBY_NUM_ROUND_HALF_EVEN ? even : \
21
+ (mode) == RUBY_NUM_ROUND_HALF_UP ? up : down)
22
+ #define ROUND_FUNC(mode, name) \
23
+ ROUND_TO(mode, name##_half_even, name##_half_up, name##_half_down)
24
+ #define ROUND_CALL(mode, name, args) \
25
+ ROUND_TO(mode, name##_half_even args, \
26
+ name##_half_up args, name##_half_down args)
27
+
28
+ #ifndef ROUND_DEFAULT
29
+ # define ROUND_DEFAULT RUBY_NUM_ROUND_HALF_UP
30
+ #endif
31
+
32
+ enum ruby_num_rounding_mode {
33
+ RUBY_NUM_ROUND_HALF_UP,
34
+ RUBY_NUM_ROUND_HALF_EVEN,
35
+ RUBY_NUM_ROUND_HALF_DOWN,
36
+ RUBY_NUM_ROUND_DEFAULT = ROUND_DEFAULT,
37
+ };
38
+
39
+ struct RFloat {
40
+ struct RBasic basic;
41
+ double float_value;
42
+ };
43
+
44
+ #define RFLOAT(obj) ((struct RFloat *)(obj))
45
+
46
+ /* numeric.c */
47
+ int rb_num_to_uint(VALUE val, unsigned int *ret);
48
+ VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl);
49
+ double ruby_float_step_size(double beg, double end, double unit, int excl);
50
+ int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless);
51
+ int rb_num_negative_p(VALUE);
52
+ VALUE rb_int_succ(VALUE num);
53
+ VALUE rb_int_uminus(VALUE num);
54
+ VALUE rb_float_uminus(VALUE num);
55
+ VALUE rb_int_plus(VALUE x, VALUE y);
56
+ VALUE rb_float_plus(VALUE x, VALUE y);
57
+ VALUE rb_int_minus(VALUE x, VALUE y);
58
+ VALUE rb_int_mul(VALUE x, VALUE y);
59
+ VALUE rb_float_mul(VALUE x, VALUE y);
60
+ VALUE rb_float_div(VALUE x, VALUE y);
61
+ VALUE rb_int_idiv(VALUE x, VALUE y);
62
+ VALUE rb_int_modulo(VALUE x, VALUE y);
63
+ VALUE rb_int2str(VALUE num, int base);
64
+ VALUE rb_fix_plus(VALUE x, VALUE y);
65
+ VALUE rb_int_gt(VALUE x, VALUE y);
66
+ VALUE rb_float_gt(VALUE x, VALUE y);
67
+ VALUE rb_int_ge(VALUE x, VALUE y);
68
+ enum ruby_num_rounding_mode rb_num_get_rounding_option(VALUE opts);
69
+ double rb_int_fdiv_double(VALUE x, VALUE y);
70
+ VALUE rb_int_pow(VALUE x, VALUE y);
71
+ VALUE rb_float_pow(VALUE x, VALUE y);
72
+ VALUE rb_int_cmp(VALUE x, VALUE y);
73
+ VALUE rb_int_equal(VALUE x, VALUE y);
74
+ VALUE rb_int_divmod(VALUE x, VALUE y);
75
+ VALUE rb_int_and(VALUE x, VALUE y);
76
+ VALUE rb_int_lshift(VALUE x, VALUE y);
77
+ VALUE rb_int_div(VALUE x, VALUE y);
78
+ int rb_int_positive_p(VALUE num);
79
+ int rb_int_negative_p(VALUE num);
80
+ VALUE rb_num_pow(VALUE x, VALUE y);
81
+ VALUE rb_float_ceil(VALUE num, int ndigits);
82
+ VALUE rb_float_abs(VALUE flt);
83
+ static inline VALUE rb_num_compare_with_zero(VALUE num, ID mid);
84
+ static inline int rb_num_positive_int_p(VALUE num);
85
+ static inline int rb_num_negative_int_p(VALUE num);
86
+ static inline double rb_float_flonum_value(VALUE v);
87
+ static inline double rb_float_noflonum_value(VALUE v);
88
+ static inline double rb_float_value_inline(VALUE v);
89
+ static inline VALUE rb_float_new_inline(double d);
90
+ static inline bool INT_POSITIVE_P(VALUE num);
91
+ static inline bool INT_NEGATIVE_P(VALUE num);
92
+ static inline bool FLOAT_ZERO_P(VALUE num);
93
+ #define rb_float_value rb_float_value_inline
94
+ #define rb_float_new rb_float_new_inline
95
+
96
+ RUBY_SYMBOL_EXPORT_BEGIN
97
+ /* numeric.c (export) */
98
+ VALUE rb_int_positive_pow(long x, unsigned long y);
99
+ RUBY_SYMBOL_EXPORT_END
100
+
101
+ MJIT_SYMBOL_EXPORT_BEGIN
102
+ VALUE rb_flo_div_flo(VALUE x, VALUE y);
103
+ double ruby_float_mod(double x, double y);
104
+ VALUE rb_float_equal(VALUE x, VALUE y);
105
+ int rb_float_cmp(VALUE x, VALUE y);
106
+ VALUE rb_float_eql(VALUE x, VALUE y);
107
+ VALUE rb_fix_aref(VALUE fix, VALUE idx);
108
+ VALUE rb_int_zero_p(VALUE num);
109
+ VALUE rb_int_even_p(VALUE num);
110
+ VALUE rb_int_odd_p(VALUE num);
111
+ VALUE rb_int_abs(VALUE num);
112
+ VALUE rb_int_bit_length(VALUE num);
113
+ MJIT_SYMBOL_EXPORT_END
114
+
115
+ static inline bool
116
+ INT_POSITIVE_P(VALUE num)
117
+ {
118
+ if (FIXNUM_P(num)) {
119
+ return FIXNUM_POSITIVE_P(num);
120
+ }
121
+ else {
122
+ return BIGNUM_POSITIVE_P(num);
123
+ }
124
+ }
125
+
126
+ static inline bool
127
+ INT_NEGATIVE_P(VALUE num)
128
+ {
129
+ if (FIXNUM_P(num)) {
130
+ return FIXNUM_NEGATIVE_P(num);
131
+ }
132
+ else {
133
+ return BIGNUM_NEGATIVE_P(num);
134
+ }
135
+ }
136
+
137
+ static inline bool
138
+ FLOAT_ZERO_P(VALUE num)
139
+ {
140
+ return RFLOAT_VALUE(num) == 0.0;
141
+ }
142
+
143
+ static inline VALUE
144
+ rb_num_compare_with_zero(VALUE num, ID mid)
145
+ {
146
+ VALUE zero = INT2FIX(0);
147
+ VALUE r = rb_check_funcall(num, mid, 1, &zero);
148
+ if (r == Qundef) {
149
+ rb_cmperr(num, zero);
150
+ }
151
+ return r;
152
+ }
153
+
154
+ static inline int
155
+ rb_num_positive_int_p(VALUE num)
156
+ {
157
+ const ID mid = '>';
158
+
159
+ if (FIXNUM_P(num)) {
160
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
161
+ return FIXNUM_POSITIVE_P(num);
162
+ }
163
+ else if (RB_TYPE_P(num, T_BIGNUM)) {
164
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
165
+ return BIGNUM_POSITIVE_P(num);
166
+ }
167
+ return RTEST(rb_num_compare_with_zero(num, mid));
168
+ }
169
+
170
+ static inline int
171
+ rb_num_negative_int_p(VALUE num)
172
+ {
173
+ const ID mid = '<';
174
+
175
+ if (FIXNUM_P(num)) {
176
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
177
+ return FIXNUM_NEGATIVE_P(num);
178
+ }
179
+ else if (RB_TYPE_P(num, T_BIGNUM)) {
180
+ if (rb_method_basic_definition_p(rb_cInteger, mid))
181
+ return BIGNUM_NEGATIVE_P(num);
182
+ }
183
+ return RTEST(rb_num_compare_with_zero(num, mid));
184
+ }
185
+
186
+ static inline double
187
+ rb_float_flonum_value(VALUE v)
188
+ {
189
+ #if USE_FLONUM
190
+ if (v != (VALUE)0x8000000000000002) { /* LIKELY */
191
+ union {
192
+ double d;
193
+ VALUE v;
194
+ } t;
195
+
196
+ VALUE b63 = (v >> 63);
197
+ /* e: xx1... -> 011... */
198
+ /* xx0... -> 100... */
199
+ /* ^b63 */
200
+ t.v = RUBY_BIT_ROTR((2 - b63) | (v & ~(VALUE)0x03), 3);
201
+ return t.d;
202
+ }
203
+ #endif
204
+ return 0.0;
205
+ }
206
+
207
+ static inline double
208
+ rb_float_noflonum_value(VALUE v)
209
+ {
210
+ return RFLOAT(v)->float_value;
211
+ }
212
+
213
+ static inline double
214
+ rb_float_value_inline(VALUE v)
215
+ {
216
+ if (FLONUM_P(v)) {
217
+ return rb_float_flonum_value(v);
218
+ }
219
+ return rb_float_noflonum_value(v);
220
+ }
221
+
222
+ static inline VALUE
223
+ rb_float_new_inline(double d)
224
+ {
225
+ #if USE_FLONUM
226
+ union {
227
+ double d;
228
+ VALUE v;
229
+ } t;
230
+ int bits;
231
+
232
+ t.d = d;
233
+ bits = (int)((VALUE)(t.v >> 60) & 0x7);
234
+ /* bits contains 3 bits of b62..b60. */
235
+ /* bits - 3 = */
236
+ /* b011 -> b000 */
237
+ /* b100 -> b001 */
238
+
239
+ if (t.v != 0x3000000000000000 /* 1.72723e-77 */ &&
240
+ !((bits-3) & ~0x01)) {
241
+ return (RUBY_BIT_ROTL(t.v, 3) & ~(VALUE)0x01) | 0x02;
242
+ }
243
+ else if (t.v == (VALUE)0) {
244
+ /* +0.0 */
245
+ return 0x8000000000000002;
246
+ }
247
+ /* out of range */
248
+ #endif
249
+ return rb_float_new_in_heap(d);
250
+ }
251
+
252
+ #endif /* INTERNAL_NUMERIC_H */