kanayago 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +5 -48
  4. data/ext/kanayago/extconf.rb +8 -0
  5. data/lib/kanayago/version.rb +1 -1
  6. data/script/setup_parser.rb +136 -0
  7. metadata +2 -64
  8. data/ext/kanayago/ccan/check_type/check_type.h +0 -63
  9. data/ext/kanayago/ccan/container_of/container_of.h +0 -142
  10. data/ext/kanayago/ccan/list/list.h +0 -791
  11. data/ext/kanayago/ccan/str/str.h +0 -17
  12. data/ext/kanayago/constant.h +0 -53
  13. data/ext/kanayago/id.h +0 -354
  14. data/ext/kanayago/id_table.h +0 -54
  15. data/ext/kanayago/include/ruby/st.h +0 -199
  16. data/ext/kanayago/internal/array.h +0 -154
  17. data/ext/kanayago/internal/basic_operators.h +0 -65
  18. data/ext/kanayago/internal/bignum.h +0 -245
  19. data/ext/kanayago/internal/bits.h +0 -650
  20. data/ext/kanayago/internal/compile.h +0 -34
  21. data/ext/kanayago/internal/compilers.h +0 -107
  22. data/ext/kanayago/internal/complex.h +0 -29
  23. data/ext/kanayago/internal/encoding.h +0 -39
  24. data/ext/kanayago/internal/error.h +0 -251
  25. data/ext/kanayago/internal/fixnum.h +0 -185
  26. data/ext/kanayago/internal/gc.h +0 -358
  27. data/ext/kanayago/internal/hash.h +0 -194
  28. data/ext/kanayago/internal/imemo.h +0 -322
  29. data/ext/kanayago/internal/io.h +0 -163
  30. data/ext/kanayago/internal/namespace.h +0 -81
  31. data/ext/kanayago/internal/numeric.h +0 -275
  32. data/ext/kanayago/internal/parse.h +0 -131
  33. data/ext/kanayago/internal/rational.h +0 -71
  34. data/ext/kanayago/internal/re.h +0 -33
  35. data/ext/kanayago/internal/ruby_parser.h +0 -125
  36. data/ext/kanayago/internal/sanitizers.h +0 -346
  37. data/ext/kanayago/internal/serial.h +0 -23
  38. data/ext/kanayago/internal/set_table.h +0 -70
  39. data/ext/kanayago/internal/static_assert.h +0 -16
  40. data/ext/kanayago/internal/string.h +0 -203
  41. data/ext/kanayago/internal/symbol.h +0 -46
  42. data/ext/kanayago/internal/thread.h +0 -112
  43. data/ext/kanayago/internal/variable.h +0 -74
  44. data/ext/kanayago/internal/vm.h +0 -136
  45. data/ext/kanayago/internal/warnings.h +0 -16
  46. data/ext/kanayago/internal.h +0 -105
  47. data/ext/kanayago/lex.c +0 -302
  48. data/ext/kanayago/method.h +0 -271
  49. data/ext/kanayago/node.c +0 -446
  50. data/ext/kanayago/node.h +0 -122
  51. data/ext/kanayago/node_name.inc +0 -224
  52. data/ext/kanayago/parse.c +0 -27377
  53. data/ext/kanayago/parse.h +0 -244
  54. data/ext/kanayago/parser_bits.h +0 -564
  55. data/ext/kanayago/parser_node.h +0 -32
  56. data/ext/kanayago/parser_st.c +0 -165
  57. data/ext/kanayago/parser_st.h +0 -162
  58. data/ext/kanayago/parser_value.h +0 -106
  59. data/ext/kanayago/probes.h +0 -4
  60. data/ext/kanayago/ruby_assert.h +0 -14
  61. data/ext/kanayago/ruby_atomic.h +0 -66
  62. data/ext/kanayago/ruby_parser.c +0 -1137
  63. data/ext/kanayago/rubyparser.h +0 -1394
  64. data/ext/kanayago/shape.h +0 -444
  65. data/ext/kanayago/st.c +0 -3223
  66. data/ext/kanayago/symbol.h +0 -116
  67. data/ext/kanayago/thread_pthread.h +0 -175
  68. data/ext/kanayago/universal_parser.c +0 -211
  69. data/ext/kanayago/vm_core.h +0 -2349
  70. data/ext/kanayago/vm_opts.h +0 -67
@@ -1,46 +0,0 @@
1
- #ifndef INTERNAL_SYMBOL_H /*-*-C-*-vi:se ft=c:*/
2
- #define INTERNAL_SYMBOL_H
3
- /**
4
- * @author Ruby developers <ruby-core@ruby-lang.org>
5
- * @copyright This file is a part of the programming language Ruby.
6
- * Permission is hereby granted, to either redistribute and/or
7
- * modify this file, provided that the conditions mentioned in the
8
- * file COPYING are met. Consult the file for details.
9
- * @brief Internal header for Symbol.
10
- */
11
- #include "ruby/ruby.h" /* for VALUE */
12
- #include "ruby/encoding.h" /* for rb_encoding */
13
- #include "internal/compilers.h" /* for __has_builtin */
14
-
15
- #ifdef rb_sym_intern_ascii_cstr
16
- # undef rb_sym_intern_ascii_cstr
17
- #endif
18
-
19
- /* symbol.c */
20
- void rb_sym_global_symbols_mark_and_move(void);
21
- VALUE rb_to_symbol_type(VALUE obj);
22
- VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc);
23
- VALUE rb_sym_intern_ascii(const char *ptr, long len);
24
- VALUE rb_sym_intern_ascii_cstr(const char *ptr);
25
- int rb_is_const_name(VALUE name);
26
- int rb_is_class_name(VALUE name);
27
- int rb_is_instance_name(VALUE name);
28
- int rb_is_local_name(VALUE name);
29
- PUREFUNC(int rb_is_const_sym(VALUE sym));
30
- PUREFUNC(int rb_is_attrset_sym(VALUE sym));
31
- ID rb_make_internal_id(void);
32
- ID rb_make_temporary_id(size_t n);
33
- bool rb_obj_is_symbol_table(VALUE obj);
34
- void rb_sym_global_symbol_table_foreach_weak_reference(int (*callback)(VALUE *key, void *data), void *data);
35
- void rb_gc_free_dsymbol(VALUE);
36
- int rb_static_id_valid_p(ID id);
37
- void rb_free_global_symbol_table(void);
38
-
39
- #if __has_builtin(__builtin_constant_p)
40
- #define rb_sym_intern_ascii_cstr(ptr) \
41
- (__builtin_constant_p(ptr) ? \
42
- rb_sym_intern_ascii((ptr), (long)strlen(ptr)) : \
43
- rb_sym_intern_ascii_cstr(ptr))
44
- #endif
45
-
46
- #endif /* INTERNAL_SYMBOL_H */
@@ -1,112 +0,0 @@
1
- #ifndef INTERNAL_THREAD_H /*-*-C-*-vi:se ft=c:*/
2
- #define INTERNAL_THREAD_H
3
- /**
4
- * @author Ruby developers <ruby-core@ruby-lang.org>
5
- * @copyright This file is a part of the programming language Ruby.
6
- * Permission is hereby granted, to either redistribute and/or
7
- * modify this file, provided that the conditions mentioned in the
8
- * file COPYING are met. Consult the file for details.
9
- * @brief Internal header for Thread.
10
- */
11
- #include "ruby/ruby.h" /* for VALUE */
12
- #include "ruby/intern.h" /* for rb_blocking_function_t */
13
- #include "ccan/list/list.h" /* for list in rb_io_close_wait_list */
14
-
15
- struct rb_thread_struct; /* in vm_core.h */
16
- struct rb_io;
17
-
18
- #define RB_VM_SAVE_MACHINE_CONTEXT(th) \
19
- do { \
20
- FLUSH_REGISTER_WINDOWS; \
21
- setjmp((th)->ec->machine.regs); \
22
- SET_MACHINE_STACK_END(&(th)->ec->machine.stack_end); \
23
- } while (0)
24
-
25
- /* thread.c */
26
- #define COVERAGE_INDEX_LINES 0
27
- #define COVERAGE_INDEX_BRANCHES 1
28
- #define COVERAGE_TARGET_LINES 1
29
- #define COVERAGE_TARGET_BRANCHES 2
30
- #define COVERAGE_TARGET_METHODS 4
31
- #define COVERAGE_TARGET_ONESHOT_LINES 8
32
- #define COVERAGE_TARGET_EVAL 16
33
-
34
- #define RUBY_FATAL_THREAD_KILLED INT2FIX(0)
35
- #define RUBY_FATAL_THREAD_TERMINATED INT2FIX(1)
36
- #define RUBY_FATAL_FIBER_KILLED RB_INT2FIX(2)
37
-
38
- VALUE rb_obj_is_mutex(VALUE obj);
39
- VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
40
- void rb_thread_execute_interrupts(VALUE th);
41
- VALUE rb_get_coverages(void);
42
- int rb_get_coverage_mode(void);
43
- VALUE rb_default_coverage(int);
44
- VALUE rb_thread_shield_new(void);
45
- bool rb_thread_shield_owned(VALUE self);
46
- VALUE rb_thread_shield_wait(VALUE self);
47
- VALUE rb_thread_shield_release(VALUE self);
48
- VALUE rb_thread_shield_destroy(VALUE self);
49
- int rb_thread_to_be_killed(VALUE thread);
50
- void rb_thread_acquire_fork_lock(void);
51
- void rb_thread_release_fork_lock(void);
52
- void rb_thread_reset_fork_lock(void);
53
- void rb_mutex_allow_trap(VALUE self, int val);
54
- VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data);
55
- VALUE rb_mutex_owned_p(VALUE self);
56
- VALUE rb_exec_recursive_outer_mid(VALUE (*f)(VALUE g, VALUE h, int r), VALUE g, VALUE h, ID mid);
57
- void ruby_mn_threads_params(void);
58
-
59
- int rb_thread_io_wait(struct rb_io *io, int events, struct timeval * timeout);
60
- int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
61
-
62
- size_t rb_thread_io_close_interrupt(struct rb_io *);
63
- void rb_thread_io_close_wait(struct rb_io *);
64
-
65
- void rb_ec_check_ints(struct rb_execution_context_struct *ec);
66
-
67
- void rb_thread_free_native_thread(void *th_ptr);
68
-
69
- RUBY_SYMBOL_EXPORT_BEGIN
70
-
71
- void *rb_thread_prevent_fork(void *(*func)(void *), void *data); /* for ext/socket/raddrinfo.c */
72
-
73
- /* Temporary. This API will be removed (renamed). */
74
- VALUE rb_thread_io_blocking_region(struct rb_io *io, rb_blocking_function_t *func, void *data1);
75
- VALUE rb_thread_io_blocking_call(struct rb_io *io, rb_blocking_function_t *func, void *data1, int events);
76
-
77
- // Invoke the given function, with the specified argument, in a way that `IO#close` from another execution context can interrupt it.
78
- VALUE rb_thread_io_blocking_operation(VALUE self, VALUE(*function)(VALUE), VALUE argument);
79
-
80
- /* thread.c (export) */
81
- int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
82
-
83
- RUBY_SYMBOL_EXPORT_END
84
-
85
- int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing);
86
- bool rb_thread_mn_schedulable(VALUE thread);
87
-
88
- bool rb_thread_resolve_unblock_function(rb_unblock_function_t **unblock_function, void **data2, struct rb_thread_struct *thread);
89
-
90
- // interrupt exec
91
-
92
- typedef VALUE (rb_interrupt_exec_func_t)(void *data);
93
-
94
- enum rb_interrupt_exec_flag {
95
- rb_interrupt_exec_flag_none = 0x00,
96
- rb_interrupt_exec_flag_value_data = 0x01,
97
- rb_interrupt_exec_flag_new_thread = 0x02,
98
- };
99
-
100
- // interrupt the target_th and run func.
101
- struct rb_ractor_struct;
102
-
103
- void rb_threadptr_interrupt_exec(struct rb_thread_struct *target_th,
104
- rb_interrupt_exec_func_t *func, void *data, enum rb_interrupt_exec_flag flags);
105
-
106
- // create a thread in the target_r and run func on the created thread.
107
- void rb_ractor_interrupt_exec(struct rb_ractor_struct *target_r,
108
- rb_interrupt_exec_func_t *func, void *data, enum rb_interrupt_exec_flag flags);
109
-
110
- void rb_threadptr_interrupt_exec_task_mark(struct rb_thread_struct *th);
111
-
112
- #endif /* INTERNAL_THREAD_H */
@@ -1,74 +0,0 @@
1
- #ifndef INTERNAL_VARIABLE_H /*-*-C-*-vi:se ft=c:*/
2
- #define INTERNAL_VARIABLE_H
3
- /**
4
- * @author Ruby developers <ruby-core@ruby-lang.org>
5
- * @copyright This file is a part of the programming language Ruby.
6
- * Permission is hereby granted, to either redistribute and/or
7
- * modify this file, provided that the conditions mentioned in the
8
- * file COPYING are met. Consult the file for details.
9
- * @brief Internal header for variables.
10
- */
11
- #include "ruby/internal/config.h"
12
- #include <stddef.h> /* for size_t */
13
- #include "constant.h" /* for rb_const_entry_t */
14
- #include "ruby/internal/stdbool.h" /* for bool */
15
- #include "ruby/ruby.h" /* for VALUE */
16
- #include "shape.h" /* for shape_id_t */
17
-
18
- /* variable.c */
19
- void rb_gc_mark_global_tbl(void);
20
- void rb_gc_update_global_tbl(void);
21
- VALUE rb_search_class_path(VALUE);
22
- VALUE rb_attr_delete(VALUE, ID);
23
- void rb_autoload_str(VALUE mod, ID id, VALUE file);
24
- VALUE rb_autoload_at_p(VALUE, ID, int);
25
- void rb_autoload_copy_table_for_namespace(st_table *, const rb_namespace_t *);
26
- NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE));
27
- rb_gvar_getter_t *rb_gvar_getter_function_of(ID);
28
- rb_gvar_setter_t *rb_gvar_setter_function_of(ID);
29
- void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_);
30
- void rb_gvar_ractor_local(const char *name);
31
- void rb_gvar_namespace_ready(const char *name);
32
-
33
- /**
34
- * Sets the name of a module.
35
- *
36
- * Non-permanently named classes can have a temporary name assigned (or
37
- * cleared). In that case the name will be used for `#inspect` and `#to_s`, and
38
- * nested classes/modules will be named with the temporary name as a prefix.
39
- *
40
- * After the module is assigned to a constant, the temporary name will be
41
- * discarded, and the name will be computed based on the nesting.
42
- *
43
- * @param[in] mod An instance of ::rb_cModule.
44
- * @param[in] name An instance of ::rb_cString.
45
- * @retval mod
46
- */
47
- VALUE rb_mod_set_temporary_name(VALUE, VALUE);
48
-
49
- void rb_obj_copy_ivs_to_hash_table(VALUE obj, st_table *table);
50
- void rb_obj_init_too_complex(VALUE obj, st_table *table);
51
- void rb_evict_ivars_to_hash(VALUE obj);
52
- VALUE rb_obj_field_get(VALUE obj, shape_id_t target_shape_id);
53
- void rb_ivar_set_internal(VALUE obj, ID id, VALUE val);
54
- attr_index_t rb_ivar_set_index(VALUE obj, ID id, VALUE val);
55
- attr_index_t rb_obj_field_set(VALUE obj, shape_id_t target_shape_id, ID field_name, VALUE val);
56
- VALUE rb_ivar_get_at(VALUE obj, attr_index_t index, ID id);
57
- VALUE rb_ivar_get_at_no_ractor_check(VALUE obj, attr_index_t index);
58
-
59
- RUBY_SYMBOL_EXPORT_BEGIN
60
- /* variable.c (export) */
61
- void rb_mark_generic_ivar(VALUE obj);
62
- VALUE rb_const_missing(VALUE klass, VALUE name);
63
- bool rb_class_ivar_set(VALUE klass, ID vid, VALUE value);
64
- void rb_fields_tbl_copy(VALUE dst, VALUE src);
65
- RUBY_SYMBOL_EXPORT_END
66
-
67
- VALUE rb_ivar_lookup(VALUE obj, ID id, VALUE undef);
68
- VALUE rb_gvar_get(ID);
69
- VALUE rb_gvar_set(ID, VALUE);
70
- VALUE rb_gvar_defined(ID);
71
- void rb_const_warn_if_deprecated(const rb_const_entry_t *, VALUE, ID);
72
- void rb_ensure_iv_list_size(VALUE obj, uint32_t current_len, uint32_t newsize);
73
-
74
- #endif /* INTERNAL_VARIABLE_H */
@@ -1,136 +0,0 @@
1
- #ifndef INTERNAL_VM_H /*-*-C-*-vi:se ft=c:*/
2
- #define INTERNAL_VM_H
3
- /**
4
- * @author Ruby developers <ruby-core@ruby-lang.org>
5
- * @copyright This file is a part of the programming language Ruby.
6
- * Permission is hereby granted, to either redistribute and/or
7
- * modify this file, provided that the conditions mentioned in the
8
- * file COPYING are met. Consult the file for details.
9
- * @brief Internal header for RubyVM.
10
- */
11
- #include "ruby/internal/stdbool.h" /* for bool */
12
- #include "internal/serial.h" /* for rb_serial_t */
13
- #include "internal/static_assert.h" /* for STATIC_ASSERT */
14
- #include "ruby/ruby.h" /* for ID */
15
- #include "ruby/st.h" /* for st_table */
16
-
17
- #ifdef rb_funcallv
18
- # undef rb_funcallv
19
- #endif
20
-
21
- #ifdef rb_method_basic_definition_p
22
- # undef rb_method_basic_definition_p
23
- #endif
24
-
25
- struct rb_callable_method_entry_struct; /* in method.h */
26
- struct rb_method_definition_struct; /* in method.h */
27
- struct rb_execution_context_struct; /* in vm_core.h */
28
- struct rb_control_frame_struct; /* in vm_core.h */
29
- struct rb_callinfo; /* in vm_core.h */
30
-
31
- enum method_missing_reason {
32
- MISSING_NOENTRY = 0x00,
33
- MISSING_PRIVATE = 0x01,
34
- MISSING_PROTECTED = 0x02,
35
- MISSING_FCALL = 0x04,
36
- MISSING_VCALL = 0x08,
37
- MISSING_SUPER = 0x10,
38
- MISSING_MISSING = 0x20,
39
- MISSING_NONE = 0x40
40
- };
41
-
42
- /* vm_insnhelper.h */
43
- VALUE rb_vm_push_frame_fname(struct rb_execution_context_struct *ec, VALUE fname);
44
-
45
- /* vm.c */
46
- VALUE rb_obj_is_thread(VALUE obj);
47
- void rb_vm_mark(void *ptr);
48
- void rb_vm_register_global_object(VALUE obj);
49
- void rb_vm_each_stack_value(void *ptr, void (*cb)(VALUE, void*), void *ctx);
50
- PUREFUNC(VALUE rb_vm_top_self(void));
51
- const void **rb_vm_get_insns_address_table(void);
52
- VALUE rb_source_location(int *pline);
53
- const char *rb_source_location_cstr(int *pline);
54
- void rb_vm_pop_cfunc_frame(void);
55
- void rb_vm_check_redefinition_by_prepend(VALUE klass);
56
- int rb_vm_check_optimizable_mid(VALUE mid);
57
- VALUE rb_yield_refine_block(VALUE refinement, VALUE refinements);
58
- VALUE ruby_vm_special_exception_copy(VALUE);
59
-
60
- void rb_lastline_set_up(VALUE val, unsigned int up);
61
-
62
- /* vm_eval.c */
63
- VALUE rb_current_realfilepath(void);
64
- VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE);
65
- typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
66
- VALUE rb_check_funcall_with_hook_kw(VALUE recv, ID mid, int argc, const VALUE *argv,
67
- rb_check_funcall_hook *hook, VALUE arg, int kw_splat);
68
- const char *rb_type_str(enum ruby_value_type type);
69
- VALUE rb_check_funcall_default(VALUE, ID, int, const VALUE *, VALUE);
70
- VALUE rb_check_funcall_basic_kw(VALUE, ID, VALUE, int, const VALUE*, int);
71
- VALUE rb_yield_1(VALUE val);
72
- VALUE rb_yield_force_blockarg(VALUE values);
73
- VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv,
74
- rb_block_call_func_t bl_proc, int min_argc, int max_argc,
75
- VALUE data2);
76
- void rb_check_stack_overflow(void);
77
- #define RB_BLOCK_NO_USE_PACKED_ARGS 2
78
- VALUE rb_block_call2(VALUE obj, ID mid, int argc, const VALUE *argv, rb_block_call_func_t bl_proc, VALUE data2, long flags);
79
- struct vm_ifunc *rb_current_ifunc(void);
80
- VALUE rb_gccct_clear_table(VALUE);
81
-
82
- #if USE_YJIT || USE_ZJIT
83
- /* vm_exec.c */
84
- extern uint64_t rb_vm_insn_count;
85
- #endif
86
-
87
- extern bool rb_free_at_exit;
88
-
89
- /* miniinit.c and builtin.c */
90
- void rb_free_loaded_builtin_table(void);
91
-
92
- /* vm_insnhelper.c */
93
- VALUE rb_equal_opt(VALUE obj1, VALUE obj2);
94
- VALUE rb_eql_opt(VALUE obj1, VALUE obj2);
95
-
96
- struct rb_iseq_struct;
97
- const struct rb_callcache *rb_vm_search_method_slowpath(const struct rb_callinfo *ci, VALUE klass);
98
-
99
- /* vm_method.c */
100
- int rb_ec_obj_respond_to(struct rb_execution_context_struct *ec, VALUE obj, ID id, int priv);
101
-
102
- void rb_clear_constant_cache(void);
103
-
104
- /* vm_dump.c */
105
- void rb_print_backtrace(FILE *);
106
-
107
- /* vm_backtrace.c */
108
- VALUE rb_vm_thread_backtrace(int argc, const VALUE *argv, VALUE thval);
109
- VALUE rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval);
110
- VALUE rb_vm_backtrace(int argc, const VALUE * argv, struct rb_execution_context_struct * ec);
111
- VALUE rb_vm_backtrace_locations(int argc, const VALUE * argv, struct rb_execution_context_struct * ec);
112
- VALUE rb_make_backtrace(void);
113
- void rb_backtrace_print_as_bugreport(FILE*);
114
- int rb_backtrace_p(VALUE obj);
115
- VALUE rb_backtrace_to_str_ary(VALUE obj);
116
- VALUE rb_backtrace_to_location_ary(VALUE obj);
117
- VALUE rb_location_ary_to_backtrace(VALUE ary);
118
- void rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output);
119
- int rb_frame_info_p(VALUE obj);
120
- int rb_get_node_id_from_frame_info(VALUE obj);
121
- const struct rb_iseq_struct *rb_get_iseq_from_frame_info(VALUE obj);
122
-
123
- VALUE rb_ec_backtrace_object(const struct rb_execution_context_struct *ec);
124
-
125
- #define RUBY_DTRACE_CREATE_HOOK(name, arg) \
126
- RUBY_DTRACE_HOOK(name##_CREATE, arg)
127
- #define RUBY_DTRACE_HOOK(name, arg) \
128
- do { \
129
- if (UNLIKELY(RUBY_DTRACE_##name##_ENABLED())) { \
130
- int dtrace_line; \
131
- const char *dtrace_file = rb_source_location_cstr(&dtrace_line); \
132
- if (!dtrace_file) dtrace_file = ""; \
133
- RUBY_DTRACE_##name(arg, dtrace_file, dtrace_line); \
134
- } \
135
- } while (0)
136
- #endif /* INTERNAL_VM_H */
@@ -1,16 +0,0 @@
1
- #ifndef INTERNAL_WARNINGS_H /*-*-C-*-vi:se ft=c:*/
2
- #define INTERNAL_WARNINGS_H
3
- /**
4
- * @author Ruby developers <ruby-core@ruby-lang.org>
5
- * @copyright This file is a part of the programming language Ruby.
6
- * Permission is hereby granted, to either redistribute and/or
7
- * modify this file, provided that the conditions mentioned in the
8
- * file COPYING are met. Consult the file for details.
9
- * @brief Internal header to suppress / mandate warnings.
10
- */
11
- #include "ruby/internal/warning_push.h"
12
- #define COMPILER_WARNING_PUSH RBIMPL_WARNING_PUSH()
13
- #define COMPILER_WARNING_POP RBIMPL_WARNING_POP()
14
- #define COMPILER_WARNING_ERROR(flag) RBIMPL_WARNING_ERROR(flag)
15
- #define COMPILER_WARNING_IGNORED(flag) RBIMPL_WARNING_IGNORED(flag)
16
- #endif /* INTERNAL_WARNINGS_H */
@@ -1,105 +0,0 @@
1
- #ifndef RUBY_INTERNAL_H /*-*-C-*-vi:se ft=c:*/
2
- #define RUBY_INTERNAL_H 1
3
- /**
4
- * @author $Author$
5
- * @date Tue May 17 11:42:20 JST 2011
6
- * @copyright Copyright (C) 2011 Yukihiro Matsumoto
7
- * @copyright This file is a part of the programming language Ruby.
8
- * Permission is hereby granted, to either redistribute and/or
9
- * modify this file, provided that the conditions mentioned in the
10
- * file COPYING are met. Consult the file for details.
11
- */
12
- #include "ruby/internal/config.h"
13
-
14
- #ifdef __cplusplus
15
- # error not for C++
16
- #endif
17
-
18
- #define LIKELY(x) RB_LIKELY(x)
19
- #define UNLIKELY(x) RB_UNLIKELY(x)
20
-
21
- #define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
22
- #define roomof(x, y) (((x) + (y) - 1) / (y))
23
- #define type_roomof(x, y) roomof(sizeof(x), sizeof(y))
24
-
25
- /* Prevent compiler from reordering access */
26
- #define ACCESS_ONCE(type,x) (*((volatile type *)&(x)))
27
-
28
- #define UNDEF_P RB_UNDEF_P
29
- #define NIL_OR_UNDEF_P RB_NIL_OR_UNDEF_P
30
-
31
- #include "ruby/ruby.h"
32
-
33
- /* Following macros were formerly defined in this header but moved to somewhere
34
- * else. In order to detect them we undef here. */
35
-
36
- /* internal/array.h */
37
- #undef RARRAY_AREF
38
-
39
- /* internal/class.h */
40
- #undef RClass
41
- #undef RCLASS_SUPER
42
-
43
- /* internal/hash.h */
44
- #undef RHASH_IFNONE
45
- #undef RHASH_SIZE
46
- #undef RHASH_TBL
47
- #undef RHASH_EMPTY_P
48
-
49
- /* internal/struct.h */
50
- #undef RSTRUCT_LEN
51
- #undef RSTRUCT_PTR
52
- #undef RSTRUCT_SET
53
- #undef RSTRUCT_GET
54
-
55
- /* Also, we keep the following macros here. They are expected to be
56
- * overridden in each headers. */
57
-
58
- /* internal/array.h */
59
- #define rb_ary_new_from_args(...) rb_nonexistent_symbol(__VA_ARGS__)
60
-
61
- /* internal/string.h */
62
- #define rb_fstring_cstr(...) rb_nonexistent_symbol(__VA_ARGS__)
63
-
64
- /* internal/symbol.h */
65
- #define rb_sym_intern_ascii_cstr(...) rb_nonexistent_symbol(__VA_ARGS__)
66
-
67
- /* internal/vm.h */
68
- #define rb_funcallv(...) rb_nonexistent_symbol(__VA_ARGS__)
69
- #define rb_method_basic_definition_p(...) rb_nonexistent_symbol(__VA_ARGS__)
70
-
71
-
72
- /* MRI debug support */
73
-
74
- /* gc.c */
75
- void rb_obj_info_dump(VALUE obj);
76
- void rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func);
77
-
78
- /* debug.c */
79
-
80
- RUBY_SYMBOL_EXPORT_BEGIN
81
- void ruby_debug_breakpoint(void);
82
- PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
83
- RUBY_SYMBOL_EXPORT_END
84
-
85
- // show obj data structure without any side-effect
86
- #define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
87
-
88
- // same as rp, but add message header
89
- #define rp_m(msg, obj) do { \
90
- fputs((msg), stderr); \
91
- rb_obj_info_dump((VALUE)(obj)); \
92
- } while (0)
93
-
94
- // `ruby_debug_breakpoint()` does nothing,
95
- // but breakpoint is set in run.gdb, so `make gdb` can stop here.
96
- #define bp() ruby_debug_breakpoint()
97
-
98
- #define RBOOL(v) ((v) ? Qtrue : Qfalse)
99
- #define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
100
-
101
- #ifndef __MINGW32__
102
- #undef memcpy
103
- #define memcpy ruby_nonempty_memcpy
104
- #endif
105
- #endif /* RUBY_INTERNAL_H */