diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/darray.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview1/darray.h deleted file mode 100644 index 7183041f..00000000 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/darray.h +++ /dev/null @@ -1,179 +0,0 @@ -#ifndef RUBY_DARRAY_H -#define RUBY_DARRAY_H - -#include -#include -#include - -// Type for a dynamic array. Use to declare a dynamic array. -// It is a pointer so it fits in st_table nicely. Designed -// to be fairly type-safe. -// -// NULL is a valid empty dynamic array. -// -// Example: -// rb_darray(char) char_array = NULL; -// rb_darray_append(&char_array, 'e'); -// printf("pushed %c\n", *rb_darray_ref(char_array, 0)); -// rb_darray_free(char_array); -// -#define rb_darray(T) struct { rb_darray_meta_t meta; T data[]; } * - -// Copy an element out of the array. Warning: not bounds checked. -// -// T rb_darray_get(rb_darray(T) ary, size_t idx); -// -#define rb_darray_get(ary, idx) ((ary)->data[(idx)]) - -// Assign to an element. Warning: not bounds checked. -// -// void rb_darray_set(rb_darray(T) ary, size_t idx, T element); -// -#define rb_darray_set(ary, idx, element) ((ary)->data[(idx)] = (element)) - -// Get a pointer to an element. Warning: not bounds checked. -// -// T *rb_darray_ref(rb_darray(T) ary, size_t idx); -// -#define rb_darray_ref(ary, idx) (&((ary)->data[(idx)])) - -// Copy a new element into the array. ptr_to_ary is evaluated multiple times. -// -// void rb_darray_append(rb_darray(T) *ptr_to_ary, T element); -// -#define rb_darray_append(ptr_to_ary, element) do { \ - rb_darray_ensure_space((ptr_to_ary), sizeof(**(ptr_to_ary)), \ - sizeof((*(ptr_to_ary))->data[0])); \ - rb_darray_set(*(ptr_to_ary), \ - (*(ptr_to_ary))->meta.size, \ - (element)); \ - (*(ptr_to_ary))->meta.size++; \ -} while (0) - - -// Last element of the array -// -#define rb_darray_back(ary) ((ary)->data[(ary)->meta.size - 1]) - -// Remove the last element of the array. -// -#define rb_darray_pop_back(ary) ((ary)->meta.size--) - -// Remove element at idx and replace it by the last element -#define rb_darray_remove_unordered(ary, idx) do { \ - rb_darray_set(ary, idx, rb_darray_back(ary)); \ - rb_darray_pop_back(ary); \ -} while (0); - -// Iterate over items of the array in a for loop -// -#define rb_darray_foreach(ary, idx_name, elem_ptr_var) \ - for (size_t idx_name = 0; idx_name < rb_darray_size(ary) && ((elem_ptr_var) = rb_darray_ref(ary, idx_name)); ++idx_name) - -// Iterate over valid indices in the array in a for loop -// -#define rb_darray_for(ary, idx_name) \ - for (size_t idx_name = 0; idx_name < rb_darray_size(ary); ++idx_name) - -// Make a dynamic array of a certain size. All bytes backing the elements are set to zero. -// -// Note that NULL is a valid empty dynamic array. -// -// void rb_darray_make(rb_darray(T) *ptr_to_ary, size_t size); -// -#define rb_darray_make(ptr_to_ary, size) \ - rb_darray_make_impl((ptr_to_ary), size, sizeof(**(ptr_to_ary)), \ - sizeof((*(ptr_to_ary))->data[0])) - -#define rb_darray_data_ptr(ary) ((ary)->data) - -// Set the size of the array to zero without freeing the backing memory. -// Allows reusing the same array. -// -#define rb_darray_clear(ary) (ary->meta.size = 0) - -typedef struct rb_darray_meta { - size_t size; - size_t capa; -} rb_darray_meta_t; - -// Get the size of the dynamic array. -// -static inline size_t -rb_darray_size(const void *ary) -{ - const rb_darray_meta_t *meta = ary; - return meta ? meta->size : 0; -} - -// Get the capacity of the dynamic array. -// -static inline size_t -rb_darray_capa(const void *ary) -{ - const rb_darray_meta_t *meta = ary; - return meta ? meta->capa : 0; -} - -// Free the dynamic array. -// -static inline void -rb_darray_free(void *ary) -{ - rb_darray_meta_t *meta = ary; - ruby_sized_xfree(ary, meta->capa); -} - -// Internal function -// Ensure there is space for one more element. -// Note: header_size can be bigger than sizeof(rb_darray_meta_t) when T is __int128_t, for example. -static inline void -rb_darray_ensure_space(void *ptr_to_ary, size_t header_size, size_t element_size) -{ - rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; - rb_darray_meta_t *meta = *ptr_to_ptr_to_meta; - size_t current_capa = rb_darray_capa(meta); - if (rb_darray_size(meta) < current_capa) return; - - // Double the capacity - size_t new_capa = current_capa == 0 ? 1 : current_capa * 2; - - rb_darray_meta_t *doubled_ary = rb_xrealloc_mul_add(meta, new_capa, element_size, header_size); - // rb_xrealloc functions guarantee that NULL is not returned - assert(doubled_ary != NULL); - - if (meta == NULL) { - // First allocation. Initialize size. On subsequence allocations - // realloc takes care of carrying over the size. - doubled_ary->size = 0; - } - - doubled_ary->capa = new_capa; - - // We don't have access to the type of the dynamic array in function context. - // Write out result with memcpy to avoid strict aliasing issue. - memcpy(ptr_to_ary, &doubled_ary, sizeof(doubled_ary)); -} - -static inline void -rb_darray_make_impl(void *ptr_to_ary, size_t array_size, size_t header_size, size_t element_size) -{ - rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; - if (array_size == 0) { - *ptr_to_ptr_to_meta = NULL; - return; - } - - rb_darray_meta_t *meta = rb_xcalloc_mul_add(array_size, element_size, header_size); - // rb_xcalloc functions guarantee that NULL is not returned - assert(meta != NULL); - - meta->size = array_size; - meta->capa = array_size; - - // We don't have access to the type of the dynamic array in function context. - // Write out result with memcpy to avoid strict aliasing issue. - memcpy(ptr_to_ary, &meta, sizeof(meta)); -} - -#endif /* RUBY_DARRAY_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/io.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/io.h deleted file mode 100644 index b5f15499..00000000 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/io.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef INTERNAL_IO_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_IO_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for IO. - */ -#include "ruby/ruby.h" /* for VALUE */ -#include "ruby/io.h" /* for rb_io_t */ - -/* io.c */ -void ruby_set_inplace_mode(const char *); -void rb_stdio_set_default_encoding(void); -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); -#ifdef rb_io_fptr_finalize -# undef rb_io_fptr_finalize -#endif -#define rb_io_fptr_finalize rb_io_fptr_finalize_internal -VALUE rb_io_popen(VALUE pname, VALUE pmode, VALUE env, VALUE opt); - -VALUE rb_io_prep_stdin(void); -VALUE rb_io_prep_stdout(void); -VALUE rb_io_prep_stderr(void); - -RUBY_SYMBOL_EXPORT_BEGIN -/* io.c (export) */ -void rb_maygvl_fd_fix_cloexec(int fd); -int rb_gc_for_fd(int err); -void rb_write_error_str(VALUE mesg); -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_IO_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/parse.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/parse.h deleted file mode 100644 index f242c384..00000000 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/parse.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef INTERNAL_PARSE_H /*-*-C-*-vi:se ft=c:*/ -#define INTERNAL_PARSE_H -/** - * @author Ruby developers - * @copyright This file is a part of the programming language Ruby. - * Permission is hereby granted, to either redistribute and/or - * modify this file, provided that the conditions mentioned in the - * file COPYING are met. Consult the file for details. - * @brief Internal header for the parser. - */ -#include "ruby/ruby.h" /* for VALUE */ -struct rb_iseq_struct; /* in vm_core.h */ - -/* parse.y */ -VALUE rb_parser_set_yydebug(VALUE, VALUE); -void *rb_parser_load_file(VALUE parser, VALUE name); -void rb_parser_keep_script_lines(VALUE vparser); -void rb_parser_error_tolerant(VALUE vparser); -void rb_parser_keep_tokens(VALUE vparser); - -RUBY_SYMBOL_EXPORT_BEGIN -VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int); -RUBY_SYMBOL_EXPORT_END - -#endif /* INTERNAL_PARSE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node.h deleted file mode 100644 index befb1328..00000000 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node.h +++ /dev/null @@ -1,514 +0,0 @@ -#ifndef RUBY_NODE_H -#define RUBY_NODE_H 1 -/********************************************************************** - - node.h - - - $Author$ - created at: Fri May 28 15:14:02 JST 1993 - - Copyright (C) 1993-2007 Yukihiro Matsumoto - -**********************************************************************/ - -#include "internal/compilers.h" - -#if defined(__cplusplus) -extern "C" { -#if 0 -} /* satisfy cc-mode */ -#endif -#endif - -enum node_type { - NODE_SCOPE, - NODE_BLOCK, - NODE_IF, - NODE_UNLESS, - NODE_CASE, - NODE_CASE2, - NODE_CASE3, - NODE_WHEN, - NODE_IN, - NODE_WHILE, - NODE_UNTIL, - NODE_ITER, - NODE_FOR, - NODE_FOR_MASGN, - NODE_BREAK, - NODE_NEXT, - NODE_REDO, - NODE_RETRY, - NODE_BEGIN, - NODE_RESCUE, - NODE_RESBODY, - NODE_ENSURE, - NODE_AND, - NODE_OR, - NODE_MASGN, - NODE_LASGN, - NODE_DASGN, - NODE_GASGN, - NODE_IASGN, - NODE_CDECL, - NODE_CVASGN, - NODE_OP_ASGN1, - NODE_OP_ASGN2, - NODE_OP_ASGN_AND, - NODE_OP_ASGN_OR, - NODE_OP_CDECL, - NODE_CALL, - NODE_OPCALL, - NODE_FCALL, - NODE_VCALL, - NODE_QCALL, - NODE_SUPER, - NODE_ZSUPER, - NODE_LIST, - NODE_ZLIST, - NODE_VALUES, - NODE_HASH, - NODE_RETURN, - NODE_YIELD, - NODE_LVAR, - NODE_DVAR, - NODE_GVAR, - NODE_IVAR, - NODE_CONST, - NODE_CVAR, - NODE_NTH_REF, - NODE_BACK_REF, - NODE_MATCH, - NODE_MATCH2, - NODE_MATCH3, - NODE_LIT, - NODE_STR, - NODE_DSTR, - NODE_XSTR, - NODE_DXSTR, - NODE_EVSTR, - NODE_DREGX, - NODE_ONCE, - NODE_ARGS, - NODE_ARGS_AUX, - NODE_OPT_ARG, - NODE_KW_ARG, - NODE_POSTARG, - NODE_ARGSCAT, - NODE_ARGSPUSH, - NODE_SPLAT, - NODE_BLOCK_PASS, - NODE_DEFN, - NODE_DEFS, - NODE_ALIAS, - NODE_VALIAS, - NODE_UNDEF, - NODE_CLASS, - NODE_MODULE, - NODE_SCLASS, - NODE_COLON2, - NODE_COLON3, - NODE_DOT2, - NODE_DOT3, - NODE_FLIP2, - NODE_FLIP3, - NODE_SELF, - NODE_NIL, - NODE_TRUE, - NODE_FALSE, - NODE_ERRINFO, - NODE_DEFINED, - NODE_POSTEXE, - NODE_DSYM, - NODE_ATTRASGN, - NODE_LAMBDA, - NODE_ARYPTN, - NODE_HSHPTN, - NODE_FNDPTN, - NODE_ERROR, - NODE_LAST -}; - -typedef struct rb_code_position_struct { - int lineno; - int column; -} rb_code_position_t; - -typedef struct rb_code_location_struct { - rb_code_position_t beg_pos; - rb_code_position_t end_pos; -} rb_code_location_t; - -static inline rb_code_location_t -code_loc_gen(const rb_code_location_t *loc1, const rb_code_location_t *loc2) -{ - rb_code_location_t loc; - loc.beg_pos = loc1->beg_pos; - loc.end_pos = loc2->end_pos; - return loc; -} - -typedef struct rb_ast_id_table { - int size; - ID ids[FLEX_ARY_LEN]; -} rb_ast_id_table_t; - -typedef struct RNode { - VALUE flags; - union { - struct RNode *node; - ID id; - VALUE value; - rb_ast_id_table_t *tbl; - } u1; - union { - struct RNode *node; - ID id; - long argc; - VALUE value; - } u2; - union { - struct RNode *node; - ID id; - long state; - struct rb_args_info *args; - struct rb_ary_pattern_info *apinfo; - struct rb_fnd_pattern_info *fpinfo; - VALUE value; - } u3; - rb_code_location_t nd_loc; - int node_id; -} NODE; - -#define RNODE(obj) ((struct RNode *)(obj)) - -/* FL : 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: FINALIZE, 8: UNUSED, 9: UNUSED, 10: EXIVAR, 11: FREEZE */ -/* NODE_FL: 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: NODE_FL_NEWLINE, - * 8..14: nd_type, - * 15..: nd_line - */ -#define NODE_FL_NEWLINE (((VALUE)1)<<7) - -#define NODE_TYPESHIFT 8 -#define NODE_TYPEMASK (((VALUE)0x7f)<flags & NODE_TYPEMASK)>>NODE_TYPESHIFT)) -#define nd_set_type(n,t) \ - rb_node_set_type(n, t) -#define nd_init_type(n,t) \ - (n)->flags=(((n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))<flags)>>NODE_LSHIFT) -#define nd_set_line(n,l) \ - (n)->flags=(((n)->flags&~((VALUE)(-1)<nd_loc.beg_pos.column)) -#define nd_set_first_column(n, v) ((n)->nd_loc.beg_pos.column = (v)) -#define nd_first_lineno(n) ((int)((n)->nd_loc.beg_pos.lineno)) -#define nd_set_first_lineno(n, v) ((n)->nd_loc.beg_pos.lineno = (v)) -#define nd_first_loc(n) ((n)->nd_loc.beg_pos) -#define nd_set_first_loc(n, v) (nd_first_loc(n) = (v)) - -#define nd_last_column(n) ((int)((n)->nd_loc.end_pos.column)) -#define nd_set_last_column(n, v) ((n)->nd_loc.end_pos.column = (v)) -#define nd_last_lineno(n) ((int)((n)->nd_loc.end_pos.lineno)) -#define nd_set_last_lineno(n, v) ((n)->nd_loc.end_pos.lineno = (v)) -#define nd_last_loc(n) ((n)->nd_loc.end_pos) -#define nd_set_last_loc(n, v) (nd_last_loc(n) = (v)) -#define nd_node_id(n) ((n)->node_id) -#define nd_set_node_id(n,id) ((n)->node_id = (id)) - -#define nd_head u1.node -#define nd_alen u2.argc -#define nd_next u3.node - -#define nd_cond u1.node -#define nd_body u2.node -#define nd_else u3.node - -#define nd_resq u2.node -#define nd_ensr u3.node - -#define nd_1st u1.node -#define nd_2nd u2.node - -#define nd_stts u1.node - -#define nd_entry u3.id -#define nd_vid u1.id - -#define nd_var u1.node -#define nd_iter u3.node - -#define nd_value u2.node -#define nd_aid u3.id - -#define nd_lit u1.value - -#define nd_recv u1.node -#define nd_mid u2.id -#define nd_args u3.node -#define nd_ainfo u3.args - -#define nd_defn u3.node - -#define nd_cpath u1.node -#define nd_super u3.node - -#define nd_beg u1.node -#define nd_end u2.node -#define nd_state u3.state - -#define nd_nth u2.argc - -#define nd_alias u1.id -#define nd_orig u2.id -#define nd_undef u2.node - -#define nd_brace u2.argc - -#define nd_pconst u1.node -#define nd_pkwargs u2.node -#define nd_pkwrestarg u3.node - -#define nd_apinfo u3.apinfo - -#define nd_fpinfo u3.fpinfo - -// for NODE_SCOPE -#define nd_tbl u1.tbl - -// for NODE_ARGS_AUX -#define nd_pid u1.id -#define nd_plen u2.argc -#define nd_cflag u2.id - -// for ripper -#define nd_cval u3.value -#define nd_rval u2.value -#define nd_tag u1.id - -#define NEW_NODE(t,a0,a1,a2,loc) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2),loc) -#define NEW_NODE_WITH_LOCALS(t,a1,a2,loc) node_newnode_with_locals(p, (t),(VALUE)(a1),(VALUE)(a2),loc) - -#define NEW_DEFN(i,a,d,loc) NEW_NODE(NODE_DEFN,0,i,NEW_SCOPE(a,d,loc),loc) -#define NEW_DEFS(r,i,a,d,loc) NEW_NODE(NODE_DEFS,r,i,NEW_SCOPE(a,d,loc),loc) -#define NEW_SCOPE(a,b,loc) NEW_NODE_WITH_LOCALS(NODE_SCOPE,b,a,loc) -#define NEW_BLOCK(a,loc) NEW_NODE(NODE_BLOCK,a,0,0,loc) -#define NEW_IF(c,t,e,loc) NEW_NODE(NODE_IF,c,t,e,loc) -#define NEW_UNLESS(c,t,e,loc) NEW_NODE(NODE_UNLESS,c,t,e,loc) -#define NEW_CASE(h,b,loc) NEW_NODE(NODE_CASE,h,b,0,loc) -#define NEW_CASE2(b,loc) NEW_NODE(NODE_CASE2,0,b,0,loc) -#define NEW_CASE3(h,b,loc) NEW_NODE(NODE_CASE3,h,b,0,loc) -#define NEW_WHEN(c,t,e,loc) NEW_NODE(NODE_WHEN,c,t,e,loc) -#define NEW_IN(c,t,e,loc) NEW_NODE(NODE_IN,c,t,e,loc) -#define NEW_WHILE(c,b,n,loc) NEW_NODE(NODE_WHILE,c,b,n,loc) -#define NEW_UNTIL(c,b,n,loc) NEW_NODE(NODE_UNTIL,c,b,n,loc) -#define NEW_FOR(i,b,loc) NEW_NODE(NODE_FOR,0,b,i,loc) -#define NEW_FOR_MASGN(v,loc) NEW_NODE(NODE_FOR_MASGN,v,0,0,loc) -#define NEW_ITER(a,b,loc) NEW_NODE(NODE_ITER,0,NEW_SCOPE(a,b,loc),0,loc) -#define NEW_LAMBDA(a,b,loc) NEW_NODE(NODE_LAMBDA,0,NEW_SCOPE(a,b,loc),0,loc) -#define NEW_BREAK(s,loc) NEW_NODE(NODE_BREAK,s,0,0,loc) -#define NEW_NEXT(s,loc) NEW_NODE(NODE_NEXT,s,0,0,loc) -#define NEW_REDO(loc) NEW_NODE(NODE_REDO,0,0,0,loc) -#define NEW_RETRY(loc) NEW_NODE(NODE_RETRY,0,0,0,loc) -#define NEW_BEGIN(b,loc) NEW_NODE(NODE_BEGIN,0,b,0,loc) -#define NEW_RESCUE(b,res,e,loc) NEW_NODE(NODE_RESCUE,b,res,e,loc) -#define NEW_RESBODY(a,ex,n,loc) NEW_NODE(NODE_RESBODY,n,ex,a,loc) -#define NEW_ENSURE(b,en,loc) NEW_NODE(NODE_ENSURE,b,0,en,loc) -#define NEW_RETURN(s,loc) NEW_NODE(NODE_RETURN,s,0,0,loc) -#define NEW_YIELD(a,loc) NEW_NODE(NODE_YIELD,a,0,0,loc) -#define NEW_LIST(a,loc) NEW_NODE(NODE_LIST,a,1,0,loc) -#define NEW_ZLIST(loc) NEW_NODE(NODE_ZLIST,0,0,0,loc) -#define NEW_HASH(a,loc) NEW_NODE(NODE_HASH,a,0,0,loc) -#define NEW_MASGN(l,r,loc) NEW_NODE(NODE_MASGN,l,0,r,loc) -#define NEW_GASGN(v,val,loc) NEW_NODE(NODE_GASGN,v,val,v,loc) -#define NEW_LASGN(v,val,loc) NEW_NODE(NODE_LASGN,v,val,0,loc) -#define NEW_DASGN(v,val,loc) NEW_NODE(NODE_DASGN,v,val,0,loc) -#define NEW_IASGN(v,val,loc) NEW_NODE(NODE_IASGN,v,val,0,loc) -#define NEW_CDECL(v,val,path,loc) NEW_NODE(NODE_CDECL,v,val,path,loc) -#define NEW_CVASGN(v,val,loc) NEW_NODE(NODE_CVASGN,v,val,0,loc) -#define NEW_OP_ASGN1(p,id,a,loc) NEW_NODE(NODE_OP_ASGN1,p,id,a,loc) -#define NEW_OP_ASGN2(r,t,i,o,val,loc) NEW_NODE(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o,t,loc),loc) -#define NEW_OP_ASGN22(i,o,t,loc) NEW_NODE(NODE_OP_ASGN2,i,o,t,loc) -#define NEW_OP_ASGN_OR(i,val,loc) NEW_NODE(NODE_OP_ASGN_OR,i,val,0,loc) -#define NEW_OP_ASGN_AND(i,val,loc) NEW_NODE(NODE_OP_ASGN_AND,i,val,0,loc) -#define NEW_OP_CDECL(v,op,val,loc) NEW_NODE(NODE_OP_CDECL,v,val,op,loc) -#define NEW_GVAR(v,loc) NEW_NODE(NODE_GVAR,v,0,v,loc) -#define NEW_LVAR(v,loc) NEW_NODE(NODE_LVAR,v,0,0,loc) -#define NEW_DVAR(v,loc) NEW_NODE(NODE_DVAR,v,0,0,loc) -#define NEW_IVAR(v,loc) NEW_NODE(NODE_IVAR,v,0,0,loc) -#define NEW_CONST(v,loc) NEW_NODE(NODE_CONST,v,0,0,loc) -#define NEW_CVAR(v,loc) NEW_NODE(NODE_CVAR,v,0,0,loc) -#define NEW_NTH_REF(n,loc) NEW_NODE(NODE_NTH_REF,0,n,0,loc) -#define NEW_BACK_REF(n,loc) NEW_NODE(NODE_BACK_REF,0,n,0,loc) -#define NEW_MATCH(c,loc) NEW_NODE(NODE_MATCH,c,0,0,loc) -#define NEW_MATCH2(n1,n2,loc) NEW_NODE(NODE_MATCH2,n1,n2,0,loc) -#define NEW_MATCH3(r,n2,loc) NEW_NODE(NODE_MATCH3,r,n2,0,loc) -#define NEW_LIT(l,loc) NEW_NODE(NODE_LIT,l,0,0,loc) -#define NEW_STR(s,loc) NEW_NODE(NODE_STR,s,0,0,loc) -#define NEW_DSTR(s,loc) NEW_NODE(NODE_DSTR,s,1,0,loc) -#define NEW_XSTR(s,loc) NEW_NODE(NODE_XSTR,s,0,0,loc) -#define NEW_DXSTR(s,loc) NEW_NODE(NODE_DXSTR,s,0,0,loc) -#define NEW_DSYM(s,loc) NEW_NODE(NODE_DSYM,s,0,0,loc) -#define NEW_EVSTR(n,loc) NEW_NODE(NODE_EVSTR,0,(n),0,loc) -#define NEW_CALL(r,m,a,loc) NEW_NODE(NODE_CALL,r,m,a,loc) -#define NEW_OPCALL(r,m,a,loc) NEW_NODE(NODE_OPCALL,r,m,a,loc) -#define NEW_FCALL(m,a,loc) NEW_NODE(NODE_FCALL,0,m,a,loc) -#define NEW_VCALL(m,loc) NEW_NODE(NODE_VCALL,0,m,0,loc) -#define NEW_SUPER(a,loc) NEW_NODE(NODE_SUPER,0,0,a,loc) -#define NEW_ZSUPER(loc) NEW_NODE(NODE_ZSUPER,0,0,0,loc) -#define NEW_ARGS_AUX(r,b,loc) NEW_NODE(NODE_ARGS_AUX,r,b,0,loc) -#define NEW_OPT_ARG(i,v,loc) NEW_NODE(NODE_OPT_ARG,i,v,0,loc) -#define NEW_KW_ARG(i,v,loc) NEW_NODE(NODE_KW_ARG,i,v,0,loc) -#define NEW_POSTARG(i,v,loc) NEW_NODE(NODE_POSTARG,i,v,0,loc) -#define NEW_ARGSCAT(a,b,loc) NEW_NODE(NODE_ARGSCAT,a,b,0,loc) -#define NEW_ARGSPUSH(a,b,loc) NEW_NODE(NODE_ARGSPUSH,a,b,0,loc) -#define NEW_SPLAT(a,loc) NEW_NODE(NODE_SPLAT,a,0,0,loc) -#define NEW_BLOCK_PASS(b,loc) NEW_NODE(NODE_BLOCK_PASS,0,b,0,loc) -#define NEW_ALIAS(n,o,loc) NEW_NODE(NODE_ALIAS,n,o,0,loc) -#define NEW_VALIAS(n,o,loc) NEW_NODE(NODE_VALIAS,n,o,0,loc) -#define NEW_UNDEF(i,loc) NEW_NODE(NODE_UNDEF,0,i,0,loc) -#define NEW_CLASS(n,b,s,loc) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(0,b,loc),(s),loc) -#define NEW_SCLASS(r,b,loc) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(0,b,loc),0,loc) -#define NEW_MODULE(n,b,loc) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(0,b,loc),0,loc) -#define NEW_COLON2(c,i,loc) NEW_NODE(NODE_COLON2,c,i,0,loc) -#define NEW_COLON3(i,loc) NEW_NODE(NODE_COLON3,0,i,0,loc) -#define NEW_DOT2(b,e,loc) NEW_NODE(NODE_DOT2,b,e,0,loc) -#define NEW_DOT3(b,e,loc) NEW_NODE(NODE_DOT3,b,e,0,loc) -#define NEW_SELF(loc) NEW_NODE(NODE_SELF,0,0,1,loc) -#define NEW_NIL(loc) NEW_NODE(NODE_NIL,0,0,0,loc) -#define NEW_TRUE(loc) NEW_NODE(NODE_TRUE,0,0,0,loc) -#define NEW_FALSE(loc) NEW_NODE(NODE_FALSE,0,0,0,loc) -#define NEW_ERRINFO(loc) NEW_NODE(NODE_ERRINFO,0,0,0,loc) -#define NEW_DEFINED(e,loc) NEW_NODE(NODE_DEFINED,e,0,0,loc) -#define NEW_POSTEXE(b,loc) NEW_NODE(NODE_POSTEXE,0,b,0,loc) -#define NEW_ATTRASGN(r,m,a,loc) NEW_NODE(NODE_ATTRASGN,r,m,a,loc) -#define NEW_ERROR(loc) NEW_NODE(NODE_ERROR,0,0,0,loc) - -#define NODE_SPECIAL_REQUIRED_KEYWORD ((NODE *)-1) -#define NODE_REQUIRED_KEYWORD_P(node) ((node)->nd_value == NODE_SPECIAL_REQUIRED_KEYWORD) -#define NODE_SPECIAL_NO_NAME_REST ((NODE *)-1) -#define NODE_NAMED_REST_P(node) ((node) != NODE_SPECIAL_NO_NAME_REST) -#define NODE_SPECIAL_EXCESSIVE_COMMA ((ID)1) -#define NODE_SPECIAL_NO_REST_KEYWORD ((NODE *)-1) - -VALUE rb_node_case_when_optimizable_literal(const NODE *const node); - -RUBY_SYMBOL_EXPORT_BEGIN - -typedef struct node_buffer_struct node_buffer_t; -/* T_IMEMO/ast */ -typedef struct rb_ast_body_struct { - const NODE *root; - VALUE compile_option; - VALUE script_lines; - // script_lines is either: - // - a Fixnum that represents the line count of the original source, or - // - an Array that contains the lines of the original source -} rb_ast_body_t; -typedef struct rb_ast_struct { - VALUE flags; - node_buffer_t *node_buffer; - rb_ast_body_t body; -} rb_ast_t; -rb_ast_t *rb_ast_new(void); -void rb_ast_mark(rb_ast_t*); -void rb_ast_update_references(rb_ast_t*); -void rb_ast_dispose(rb_ast_t*); -void rb_ast_free(rb_ast_t*); -size_t rb_ast_memsize(const rb_ast_t*); -void rb_ast_add_mark_object(rb_ast_t*, VALUE); -void rb_ast_set_tokens(rb_ast_t*, VALUE); -VALUE rb_ast_tokens(rb_ast_t *ast); -NODE *rb_ast_newnode(rb_ast_t*, enum node_type type); -void rb_ast_delete_node(rb_ast_t*, NODE *n); -rb_ast_id_table_t *rb_ast_new_local_table(rb_ast_t*, int); -rb_ast_id_table_t *rb_ast_resize_latest_local_table(rb_ast_t*, int); - -VALUE rb_parser_new(void); -VALUE rb_parser_end_seen_p(VALUE); -VALUE rb_parser_encoding(VALUE); -VALUE rb_parser_set_yydebug(VALUE, VALUE); -VALUE rb_parser_dump_tree(const NODE *node, int comment); -void rb_parser_set_options(VALUE, int, int, int, int); - -rb_ast_t *rb_parser_compile_string(VALUE, const char*, VALUE, int); -rb_ast_t *rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line); -rb_ast_t *rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line); -rb_ast_t *rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int line); - -void rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2); -const char *ruby_node_name(int node); - -const struct kwtable *rb_reserved_word(const char *, unsigned int); - -struct rb_args_info { - NODE *pre_init; - NODE *post_init; - - int pre_args_num; /* count of mandatory pre-arguments */ - int post_args_num; /* count of mandatory post-arguments */ - - ID first_post_arg; - - ID rest_arg; - ID block_arg; - - NODE *kw_args; - NODE *kw_rest_arg; - - NODE *opt_args; - unsigned int no_kwarg: 1; - unsigned int ruby2_keywords: 1; - unsigned int forwarding: 1; - - VALUE imemo; -}; - -struct rb_ary_pattern_info { - NODE *pre_args; - NODE *rest_arg; - NODE *post_args; -}; - -struct rb_fnd_pattern_info { - NODE *pre_rest_arg; - NODE *args; - NODE *post_rest_arg; -}; - -struct parser_params; -void *rb_parser_malloc(struct parser_params *, size_t); -void *rb_parser_realloc(struct parser_params *, void *, size_t); -void *rb_parser_calloc(struct parser_params *, size_t, size_t); -void rb_parser_free(struct parser_params *, void *); -PRINTF_ARGS(void rb_parser_printf(struct parser_params *parser, const char *fmt, ...), 2, 3); -void rb_ast_node_type_change(NODE *n, enum node_type type); - -RUBY_SYMBOL_EXPORT_END - -static inline VALUE -rb_node_set_type(NODE *n, enum node_type t) -{ -#if RUBY_DEBUG - rb_ast_node_type_change(n, t); -#endif - return nd_init_type(n, t); -} - -static inline bool -nd_type_p(const NODE *n, enum node_type t) -{ - return (enum node_type)nd_type(n) == t; -} -#if defined(__cplusplus) -#if 0 -{ /* satisfy cc-mode */ -#endif -} /* extern "C" { */ -#endif - -#endif /* RUBY_NODE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/opt_sc.inc b/lib/debase/ruby_core_source/ruby-3.3.0-preview1/opt_sc.inc deleted file mode 100644 index 44263d76..00000000 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/opt_sc.inc +++ /dev/null @@ -1,109 +0,0 @@ -/* -*- C -*- */ - -/* This is an auto-generated file and is a part of the programming language - * Ruby. The person who created a program to generate this file (``I'' - * hereafter) would like to refrain from defining licensing of this generated - * source code. - * - * This file consists of many small parts of codes copyrighted by each author, - * not only the ``I'' person. Those original authors agree with some - * open-source license. I believe that the license we agree is the condition - * mentioned in the file COPYING. It states "4. You may modify and include - * the part of the software into any other software ...". But the problem is, - * the license never makes it clear if such modified parts still remain in the - * same license, or not. The fact that we agree with the source code's - * licensing terms does not automatically define that of generated ones. This - * is the reason why this file is under an unclear situation. All what I know - * is that above provision guarantees this file to exist. - * - * Please let me hesitate to declare something about this nuanced contract. I - * am not in the position to take over other authors' license to merge into my - * one. Changing them to (say) GPLv3 is not doable by myself. Perhaps someday - * it might turn out to be okay to say this file is under a license. I wish - * the situation would become more clear in the future. */ - -/*******************************************************************/ -/*******************************************************************/ -/*******************************************************************/ -/** - This file is for threaded code. - - ---- - This file is auto generated by insns2vm.rb - DO NOT TOUCH! - - If you want to fix something, you must edit "tool/ruby_vm/views/opt_sc.inc.erb" - or tool/insns2vm.rb - */ - -#define SC_STATE_SIZE 6 - -#define SCS_XX 1 -#define SCS_AX 2 -#define SCS_BX 3 -#define SCS_AB 4 -#define SCS_BA 5 - -#define SC_ERROR 0xffffffff - -static const VALUE sc_insn_info[][SC_STATE_SIZE] = { -#define NO_SC { SC_ERROR, SC_ERROR, SC_ERROR, SC_ERROR, SC_ERROR, SC_ERROR } - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, NO_SC, - NO_SC, NO_SC, -#undef NO_SC -}; - -static const VALUE sc_insn_next[] = { - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, SCS_XX, - SCS_XX, SCS_XX, -}; - -ASSERT_VM_INSTRUCTION_SIZE(sc_insn_next); diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/revision.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview1/revision.h deleted file mode 100644 index efd99565..00000000 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/revision.h +++ /dev/null @@ -1,5 +0,0 @@ -#define RUBY_REVISION "a1b01e7701" -#define RUBY_FULL_REVISION "a1b01e7701f9fc370f8dff777aad6d39a2c5a3e3" -#define RUBY_RELEASE_YEAR 2023 -#define RUBY_RELEASE_MONTH 5 -#define RUBY_RELEASE_DAY 12 diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/transient_heap.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview1/transient_heap.h deleted file mode 100644 index 4ac52aad..00000000 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/transient_heap.h +++ /dev/null @@ -1,65 +0,0 @@ -#ifndef RUBY_TRANSIENT_HEAP_H -#define RUBY_TRANSIENT_HEAP_H -/********************************************************************** - - transient_heap.h - declarations of transient_heap related APIs. - - Copyright (C) 2018 Koichi Sasada - -**********************************************************************/ - -#include "internal.h" - -#if USE_TRANSIENT_HEAP - -/* public API */ - -/* Allocate req_size bytes from transient_heap. - Allocated memories are free-ed when next GC - if this memory is not marked by `rb_transient_heap_mark()`. - */ -void *rb_transient_heap_alloc(VALUE obj, size_t req_size); - -/* If `obj` uses a memory pointed by `ptr` from transient_heap, - you need to call `rb_transient_heap_mark(obj, ptr)` - to assert liveness of `obj` (and ptr). */ -void rb_transient_heap_mark(VALUE obj, const void *ptr); - -/* used by gc.c */ -void rb_transient_heap_promote(VALUE obj); -void rb_transient_heap_start_marking(int full_marking); -void rb_transient_heap_finish_marking(void); -void rb_transient_heap_update_references(void); - -/* used by ractor.c */ -void rb_transient_heap_evacuate(void); - -/* for debug API */ -void rb_transient_heap_dump(void); -void rb_transient_heap_verify(void); -int rb_transient_heap_managed_ptr_p(const void *ptr); - -/* evacuate functions for each type */ -void rb_ary_transient_heap_evacuate(VALUE ary, int promote); -void rb_obj_transient_heap_evacuate(VALUE obj, int promote); -void rb_hash_transient_heap_evacuate(VALUE hash, int promote); -void rb_struct_transient_heap_evacuate(VALUE st, int promote); - -#else /* USE_TRANSIENT_HEAP */ - -#define rb_transient_heap_alloc(o, s) NULL -#define rb_transient_heap_verify() ((void)0) -#define rb_transient_heap_promote(obj) ((void)0) -#define rb_transient_heap_start_marking(full_marking) ((void)0) -#define rb_transient_heap_update_references() ((void)0) -#define rb_transient_heap_evacuate() ((void)0) -#define rb_transient_heap_finish_marking() ((void)0) -#define rb_transient_heap_mark(obj, ptr) ((void)0) - -#define rb_ary_transient_heap_evacuate(x, y) ((void)0) -#define rb_obj_transient_heap_evacuate(x, y) ((void)0) -#define rb_hash_transient_heap_evacuate(x, y) ((void)0) -#define rb_struct_transient_heap_evacuate(x, y) ((void)0) - -#endif /* USE_TRANSIENT_HEAP */ -#endif diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/addr2line.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/addr2line.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/addr2line.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/addr2line.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/builtin.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/builtin.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/builtin.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/builtin.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/build_assert/build_assert.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/build_assert/build_assert.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/build_assert/build_assert.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/build_assert/build_assert.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/check_type/check_type.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/check_type/check_type.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/check_type/check_type.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/check_type/check_type.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/container_of/container_of.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/container_of/container_of.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/container_of/container_of.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/container_of/container_of.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/list/list.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/list/list.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/list/list.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/list/list.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/str/str.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/str/str.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/ccan/str/str.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/ccan/str/str.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/constant.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/constant.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/constant.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/constant.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/darray.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/darray.h new file mode 100644 index 00000000..8e1e5763 --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/darray.h @@ -0,0 +1,246 @@ +#ifndef RUBY_DARRAY_H +#define RUBY_DARRAY_H + +#include +#include +#include + +#include "internal/bits.h" +#include "internal/gc.h" + +// Type for a dynamic array. Use to declare a dynamic array. +// It is a pointer so it fits in st_table nicely. Designed +// to be fairly type-safe. +// +// NULL is a valid empty dynamic array. +// +// Example: +// rb_darray(char) char_array = NULL; +// rb_darray_append(&char_array, 'e'); +// printf("pushed %c\n", *rb_darray_ref(char_array, 0)); +// rb_darray_free(char_array); +// +#define rb_darray(T) struct { rb_darray_meta_t meta; T data[]; } * + +// Copy an element out of the array. Warning: not bounds checked. +// +// T rb_darray_get(rb_darray(T) ary, size_t idx); +// +#define rb_darray_get(ary, idx) ((ary)->data[(idx)]) + +// Assign to an element. Warning: not bounds checked. +// +// void rb_darray_set(rb_darray(T) ary, size_t idx, T element); +// +#define rb_darray_set(ary, idx, element) ((ary)->data[(idx)] = (element)) + +// Get a pointer to an element. Warning: not bounds checked. +// +// T *rb_darray_ref(rb_darray(T) ary, size_t idx); +// +#define rb_darray_ref(ary, idx) (&((ary)->data[(idx)])) + +/* Copy a new element into the array. ptr_to_ary is evaluated multiple times. + * + * void rb_darray_append(rb_darray(T) *ptr_to_ary, T element); + */ +#define rb_darray_append(ptr_to_ary, element) \ + rb_darray_append_impl(ptr_to_ary, element, rb_xrealloc_mul_add) + +#define rb_darray_append_without_gc(ptr_to_ary, element) \ + rb_darray_append_impl(ptr_to_ary, element, rb_darray_realloc_mul_add_without_gc) + +#define rb_darray_append_impl(ptr_to_ary, element, realloc_func) do { \ + rb_darray_ensure_space((ptr_to_ary), \ + sizeof(**(ptr_to_ary)), \ + sizeof((*(ptr_to_ary))->data[0]), \ + realloc_func); \ + rb_darray_set(*(ptr_to_ary), \ + (*(ptr_to_ary))->meta.size, \ + (element)); \ + (*(ptr_to_ary))->meta.size++; \ +} while (0) + +// Iterate over items of the array in a for loop +// +#define rb_darray_foreach(ary, idx_name, elem_ptr_var) \ + for (size_t idx_name = 0; idx_name < rb_darray_size(ary) && ((elem_ptr_var) = rb_darray_ref(ary, idx_name)); ++idx_name) + +// Iterate over valid indices in the array in a for loop +// +#define rb_darray_for(ary, idx_name) \ + for (size_t idx_name = 0; idx_name < rb_darray_size(ary); ++idx_name) + +/* Make a dynamic array of a certain size. All bytes backing the elements are set to zero. + * Return 1 on success and 0 on failure. + * + * Note that NULL is a valid empty dynamic array. + * + * void rb_darray_make(rb_darray(T) *ptr_to_ary, size_t size); + */ +#define rb_darray_make(ptr_to_ary, size) \ + rb_darray_make_impl((ptr_to_ary), size, sizeof(**(ptr_to_ary)), \ + sizeof((*(ptr_to_ary))->data[0]), rb_xcalloc_mul_add) + +#define rb_darray_make_without_gc(ptr_to_ary, size) \ + rb_darray_make_impl((ptr_to_ary), size, sizeof(**(ptr_to_ary)), \ + sizeof((*(ptr_to_ary))->data[0]), rb_darray_calloc_mul_add_without_gc) + +/* Resize the darray to a new capacity. The new capacity must be greater than + * or equal to the size of the darray. + * + * void rb_darray_resize_capa(rb_darray(T) *ptr_to_ary, size_t capa); + */ +#define rb_darray_resize_capa_without_gc(ptr_to_ary, capa) \ + rb_darray_resize_capa_impl((ptr_to_ary), rb_darray_next_power_of_two(capa), sizeof(**(ptr_to_ary)), \ + sizeof((*(ptr_to_ary))->data[0]), rb_darray_realloc_mul_add_without_gc) + +#define rb_darray_data_ptr(ary) ((ary)->data) + +typedef struct rb_darray_meta { + size_t size; + size_t capa; +} rb_darray_meta_t; + +/* Set the size of the array to zero without freeing the backing memory. + * Allows reusing the same array. */ +static inline void +rb_darray_clear(void *ary) +{ + rb_darray_meta_t *meta = ary; + if (meta) { + meta->size = 0; + } +} + +// Get the size of the dynamic array. +// +static inline size_t +rb_darray_size(const void *ary) +{ + const rb_darray_meta_t *meta = ary; + return meta ? meta->size : 0; +} + +// Get the capacity of the dynamic array. +// +static inline size_t +rb_darray_capa(const void *ary) +{ + const rb_darray_meta_t *meta = ary; + return meta ? meta->capa : 0; +} + +/* Free the dynamic array. */ +static inline void +rb_darray_free(void *ary) +{ + rb_darray_meta_t *meta = ary; + if (meta) ruby_sized_xfree(ary, meta->capa); +} + +static inline void +rb_darray_free_without_gc(void *ary) +{ + free(ary); +} + +/* Internal function. Like rb_xcalloc_mul_add but does not trigger GC and does + * not check for overflow in arithmetic. */ +static inline void * +rb_darray_calloc_mul_add_without_gc(size_t x, size_t y, size_t z) +{ + size_t size = (x * y) + z; + + void *ptr = calloc(1, size); + if (ptr == NULL) rb_bug("rb_darray_calloc_mul_add_without_gc: failed"); + + return ptr; +} + +/* Internal function. Like rb_xrealloc_mul_add but does not trigger GC and does + * not check for overflow in arithmetic. */ +static inline void * +rb_darray_realloc_mul_add_without_gc(const void *orig_ptr, size_t x, size_t y, size_t z) +{ + size_t size = (x * y) + z; + + void *ptr = realloc((void *)orig_ptr, size); + if (ptr == NULL) rb_bug("rb_darray_realloc_mul_add_without_gc: failed"); + + return ptr; +} + +/* Internal function. Returns the next power of two that is greater than or + * equal to n. */ +static inline size_t +rb_darray_next_power_of_two(size_t n) +{ + return (size_t)(1 << (64 - nlz_int64(n))); +} + +/* Internal function. Resizes the capacity of a darray. The new capacity must + * be greater than or equal to the size of the darray. */ +static inline void +rb_darray_resize_capa_impl(void *ptr_to_ary, size_t new_capa, size_t header_size, size_t element_size, + void *(*realloc_mul_add_impl)(const void *, size_t, size_t, size_t)) +{ + rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; + rb_darray_meta_t *meta = *ptr_to_ptr_to_meta; + + rb_darray_meta_t *new_ary = realloc_mul_add_impl(meta, new_capa, element_size, header_size); + + if (meta == NULL) { + /* First allocation. Initialize size. On subsequence allocations + * realloc takes care of carrying over the size. */ + new_ary->size = 0; + } + + assert(new_ary->size <= new_capa); + + new_ary->capa = new_capa; + + // We don't have access to the type of the dynamic array in function context. + // Write out result with memcpy to avoid strict aliasing issue. + memcpy(ptr_to_ary, &new_ary, sizeof(new_ary)); +} + +// Internal function +// Ensure there is space for one more element. +// Note: header_size can be bigger than sizeof(rb_darray_meta_t) when T is __int128_t, for example. +static inline void +rb_darray_ensure_space(void *ptr_to_ary, size_t header_size, size_t element_size, + void *(*realloc_mul_add_impl)(const void *, size_t, size_t, size_t)) +{ + rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; + rb_darray_meta_t *meta = *ptr_to_ptr_to_meta; + size_t current_capa = rb_darray_capa(meta); + if (rb_darray_size(meta) < current_capa) return; + + // Double the capacity + size_t new_capa = current_capa == 0 ? 1 : current_capa * 2; + + rb_darray_resize_capa_impl(ptr_to_ary, new_capa, header_size, element_size, realloc_mul_add_impl); +} + +static inline void +rb_darray_make_impl(void *ptr_to_ary, size_t array_size, size_t header_size, size_t element_size, + void *(*calloc_mul_add_impl)(size_t, size_t, size_t)) +{ + rb_darray_meta_t **ptr_to_ptr_to_meta = ptr_to_ary; + if (array_size == 0) { + *ptr_to_ptr_to_meta = NULL; + return; + } + + rb_darray_meta_t *meta = calloc_mul_add_impl(array_size, element_size, header_size); + + meta->size = array_size; + meta->capa = array_size; + + // We don't have access to the type of the dynamic array in function context. + // Write out result with memcpy to avoid strict aliasing issue. + memcpy(ptr_to_ary, &meta, sizeof(meta)); +} + +#endif /* RUBY_DARRAY_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/debug_counter.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/debug_counter.h similarity index 97% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/debug_counter.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/debug_counter.h index f1208d83..a8b95edd 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/debug_counter.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/debug_counter.h @@ -100,6 +100,13 @@ RB_DEBUG_COUNTER(ccf_opt_block_call) RB_DEBUG_COUNTER(ccf_opt_struct_aref) RB_DEBUG_COUNTER(ccf_opt_struct_aset) RB_DEBUG_COUNTER(ccf_super_method) +RB_DEBUG_COUNTER(ccf_cfunc_other) +RB_DEBUG_COUNTER(ccf_cfunc_only_splat) +RB_DEBUG_COUNTER(ccf_cfunc_only_splat_kw) +RB_DEBUG_COUNTER(ccf_iseq_bmethod) +RB_DEBUG_COUNTER(ccf_noniseq_bmethod) +RB_DEBUG_COUNTER(ccf_opt_send_complex) +RB_DEBUG_COUNTER(ccf_opt_send_simple) /* * control frame push counts. @@ -207,7 +214,6 @@ RB_DEBUG_COUNTER(gc_isptr_maybe) * * [attr] * * _ptr: R?? is not embed. * * _embed: R?? is embed. - * * _transient: R?? uses transient heap. * * type specific attr. * * str_shared: str is shared. * * str_nofree: nofree @@ -233,7 +239,6 @@ RB_DEBUG_COUNTER(obj_promote) RB_DEBUG_COUNTER(obj_wb_unprotect) RB_DEBUG_COUNTER(obj_obj_embed) -RB_DEBUG_COUNTER(obj_obj_transient) RB_DEBUG_COUNTER(obj_obj_ptr) RB_DEBUG_COUNTER(obj_obj_too_complex) @@ -244,7 +249,6 @@ RB_DEBUG_COUNTER(obj_str_nofree) RB_DEBUG_COUNTER(obj_str_fstr) RB_DEBUG_COUNTER(obj_ary_embed) -RB_DEBUG_COUNTER(obj_ary_transient) RB_DEBUG_COUNTER(obj_ary_ptr) RB_DEBUG_COUNTER(obj_ary_extracapa) /* @@ -268,11 +272,9 @@ RB_DEBUG_COUNTER(obj_hash_g8) RB_DEBUG_COUNTER(obj_hash_null) RB_DEBUG_COUNTER(obj_hash_ar) RB_DEBUG_COUNTER(obj_hash_st) -RB_DEBUG_COUNTER(obj_hash_transient) RB_DEBUG_COUNTER(obj_hash_force_convert) RB_DEBUG_COUNTER(obj_struct_embed) -RB_DEBUG_COUNTER(obj_struct_transient) RB_DEBUG_COUNTER(obj_struct_ptr) RB_DEBUG_COUNTER(obj_data_empty) @@ -327,11 +329,6 @@ RB_DEBUG_COUNTER(heap_xmalloc) RB_DEBUG_COUNTER(heap_xrealloc) RB_DEBUG_COUNTER(heap_xfree) -/* transient_heap */ -RB_DEBUG_COUNTER(theap_alloc) -RB_DEBUG_COUNTER(theap_alloc_fail) -RB_DEBUG_COUNTER(theap_evacuate) - // VM sync RB_DEBUG_COUNTER(vm_sync_lock) RB_DEBUG_COUNTER(vm_sync_lock_enter) diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/dln.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/dln.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/dln.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/dln.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/encindex.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/encindex.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/encindex.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/encindex.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/eval_intern.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/eval_intern.h similarity index 98% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/eval_intern.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/eval_intern.h index 6cbaa513..778b63e0 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/eval_intern.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/eval_intern.h @@ -151,6 +151,7 @@ rb_ec_tag_state(const rb_execution_context_t *ec) enum ruby_tag_type state = tag->state; tag->state = TAG_NONE; rb_ec_vm_lock_rec_check(ec, tag->lock_rec); + RBIMPL_ASSUME(state != TAG_NONE); return state; } @@ -158,6 +159,7 @@ NORETURN(static inline void rb_ec_tag_jump(const rb_execution_context_t *ec, enu static inline void rb_ec_tag_jump(const rb_execution_context_t *ec, enum ruby_tag_type st) { + RUBY_ASSERT(st != TAG_NONE); ec->tag->state = st; ruby_longjmp(ec->tag->buf, 1); } @@ -167,7 +169,7 @@ rb_ec_tag_jump(const rb_execution_context_t *ec, enum ruby_tag_type st) [ISO/IEC 9899:1999] 7.13.1.1 */ #define EC_EXEC_TAG() \ - (ruby_setjmp(_tag.buf) ? rb_ec_tag_state(VAR_FROM_MEMORY(_ec)) : (EC_REPUSH_TAG(), 0)) + (UNLIKELY(ruby_setjmp(_tag.buf)) ? rb_ec_tag_state(VAR_FROM_MEMORY(_ec)) : (EC_REPUSH_TAG(), 0)) #define EC_JUMP_TAG(ec, st) rb_ec_tag_jump(ec, st) diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/hrtime.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/hrtime.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/hrtime.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/hrtime.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/id.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/id.h similarity index 91% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/id.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/id.h index a953c7aa..66a6531c 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/id.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/id.h @@ -129,6 +129,8 @@ enum ruby_method_ids { id_core_sprintf, id_debug_created_info, tPRESERVED_ID_END, + + /* LOCAL tokens {{{ */ tTOKEN_LOCAL_BEGIN = tPRESERVED_ID_END-1, tMax, tMin, @@ -200,20 +202,39 @@ enum ruby_method_ids { tNUMPARAM_9, tDefault, tTOKEN_LOCAL_END, + /* LOCAL tokens }}} */ + + /* INSTANCE tokens {{{ */ tTOKEN_INSTANCE_BEGIN = tTOKEN_LOCAL_END-1, tTOKEN_INSTANCE_END, + /* INSTANCE tokens }}} */ + + /* GLOBAL tokens {{{ */ tTOKEN_GLOBAL_BEGIN = tTOKEN_INSTANCE_END-1, tLASTLINE, tBACKREF, tERROR_INFO, tTOKEN_GLOBAL_END, + /* GLOBAL tokens }}} */ + + /* CONST tokens {{{ */ tTOKEN_CONST_BEGIN = tTOKEN_GLOBAL_END-1, tTOKEN_CONST_END, + /* CONST tokens }}} */ + + /* CLASS tokens {{{ */ tTOKEN_CLASS_BEGIN = tTOKEN_CONST_END-1, tTOKEN_CLASS_END, + /* CLASS tokens }}} */ + + /* ATTRSET tokens {{{ */ tTOKEN_ATTRSET_BEGIN = tTOKEN_CLASS_END-1, tTOKEN_ATTRSET_END, + /* ATTRSET tokens }}} */ + tNEXT_ID = tTOKEN_ATTRSET_END, + + /* LOCAL IDs {{{ */ #define DEFINE_LOCALID_FROM_TOKEN(n) id##n = TOKEN2LOCALID(t##n) DEFINE_LOCALID_FROM_TOKEN(Max), DEFINE_LOCALID_FROM_TOKEN(Min), @@ -284,14 +305,37 @@ enum ruby_method_ids { DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_8), DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_9), DEFINE_LOCALID_FROM_TOKEN(Default), +#undef DEFINE_LOCALID_FROM_TOKEN + /* LOCAL IDs }}} */ + + /* INSTANCE IDs {{{ */ #define DEFINE_INSTANCEID_FROM_TOKEN(n) id##n = TOKEN2INSTANCEID(t##n) +#undef DEFINE_INSTANCEID_FROM_TOKEN + /* INSTANCE IDs }}} */ + + /* GLOBAL IDs {{{ */ #define DEFINE_GLOBALID_FROM_TOKEN(n) id##n = TOKEN2GLOBALID(t##n) DEFINE_GLOBALID_FROM_TOKEN(LASTLINE), DEFINE_GLOBALID_FROM_TOKEN(BACKREF), DEFINE_GLOBALID_FROM_TOKEN(ERROR_INFO), +#undef DEFINE_GLOBALID_FROM_TOKEN + /* GLOBAL IDs }}} */ + + /* CONST IDs {{{ */ #define DEFINE_CONSTID_FROM_TOKEN(n) id##n = TOKEN2CONSTID(t##n) +#undef DEFINE_CONSTID_FROM_TOKEN + /* CONST IDs }}} */ + + /* CLASS IDs {{{ */ #define DEFINE_CLASSID_FROM_TOKEN(n) id##n = TOKEN2CLASSID(t##n) +#undef DEFINE_CLASSID_FROM_TOKEN + /* CLASS IDs }}} */ + + /* ATTRSET IDs {{{ */ #define DEFINE_ATTRSETID_FROM_TOKEN(n) id##n = TOKEN2ATTRSETID(t##n) +#undef DEFINE_ATTRSETID_FROM_TOKEN + /* ATTRSET IDs }}} */ + tLAST_OP_ID = tPRESERVED_ID_END-1, idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT }; diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/id_table.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/id_table.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/id_table.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/id_table.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/insns.inc b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/insns.inc similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/insns.inc rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/insns.inc diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/insns_info.inc b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/insns_info.inc similarity index 98% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/insns_info.inc rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/insns_info.inc index 63e7bc03..08b7b5b0 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/insns_info.inc +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/insns_info.inc @@ -443,32 +443,6 @@ insn_op_type(VALUE i, long j) #include "iseq.h" -extern const bool rb_vm_insn_leaf_p[]; - -#ifdef RUBY_VM_INSNS_INFO -const bool rb_vm_insn_leaf_p[] = { - 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, - 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -}; -#endif - -CONSTFUNC(MAYBE_UNUSED(static bool insn_leaf_p(VALUE insn))); - -bool -insn_leaf_p(VALUE insn) -{ - return rb_vm_insn_leaf_p[insn]; -} - // This is used to tell RJIT that this insn would be leaf if CHECK_INTS didn't exist. // It should be used only when RUBY_VM_CHECK_INTS is directly written in insns.def. static bool leafness_of_check_ints = false; @@ -510,7 +484,7 @@ leafness_of_checkmatch(rb_num_t flag) return false; } } -#line 514 "insns_info.inc" +#line 488 "insns_info.inc" #line 10 "tool/ruby_vm/views/_sp_inc_helpers.erb" @@ -540,7 +514,7 @@ sp_inc_of_invokeblock(const struct rb_callinfo *ci) * instructions, except that it does not pop receiver. */ return sp_inc_of_sendish(ci) + 1; } -#line 544 "insns_info.inc" +#line 518 "insns_info.inc" #ifndef RUBY_VM_EXEC_H /* can't #include "vm_exec.h" here... */ @@ -2008,7 +1982,7 @@ attr_leaf_getspecial( return #line 192 "insns.def" (type == 0) ? true : false; -#line 2012 "insns_info.inc" +#line 1986 "insns_info.inc" } /* attr const char* name @ getspecial(key, type)()(val) */ @@ -2164,7 +2138,7 @@ attr_leaf_getinstancevariable( return #line 214 "insns.def" false; -#line 2168 "insns_info.inc" +#line 2142 "insns_info.inc" } /* attr const char* name @ getinstancevariable(id, ic)()(val) */ @@ -2257,7 +2231,7 @@ attr_leaf_setinstancevariable( return #line 225 "insns.def" false; -#line 2261 "insns_info.inc" +#line 2235 "insns_info.inc" } /* attr const char* name @ setinstancevariable(id, ic)(val)() */ @@ -2350,7 +2324,7 @@ attr_leaf_getclassvariable( return #line 237 "insns.def" false; -#line 2354 "insns_info.inc" +#line 2328 "insns_info.inc" } /* attr const char* name @ getclassvariable(id, ic)()(val) */ @@ -2443,7 +2417,7 @@ attr_leaf_setclassvariable( return #line 250 "insns.def" false; -#line 2447 "insns_info.inc" +#line 2421 "insns_info.inc" } /* attr const char* name @ setclassvariable(id, ic)(val)() */ @@ -2527,7 +2501,7 @@ attr_leaf_opt_getconstant_path(MAYBE_UNUSED(IC ic)) return #line 261 "insns.def" false; -#line 2531 "insns_info.inc" +#line 2505 "insns_info.inc" } /* attr const char* name @ opt_getconstant_path(ic)()(val) */ @@ -2593,7 +2567,7 @@ attr_leaf_getconstant(MAYBE_UNUSED(ID id)) return #line 289 "insns.def" false; -#line 2597 "insns_info.inc" +#line 2571 "insns_info.inc" } /* attr const char* name @ getconstant(id)(klass, allow_nil)(val) */ @@ -2659,7 +2633,7 @@ attr_leaf_setconstant(MAYBE_UNUSED(ID id)) return #line 305 "insns.def" false; -#line 2663 "insns_info.inc" +#line 2637 "insns_info.inc" } /* attr const char* name @ setconstant(id)(val, cbase)() */ @@ -2725,7 +2699,7 @@ attr_leaf_getglobal(MAYBE_UNUSED(ID gid)) return #line 318 "insns.def" false; -#line 2729 "insns_info.inc" +#line 2703 "insns_info.inc" } /* attr const char* name @ getglobal(gid)()(val) */ @@ -2791,7 +2765,7 @@ attr_leaf_setglobal(MAYBE_UNUSED(ID gid)) return #line 329 "insns.def" false; -#line 2795 "insns_info.inc" +#line 2769 "insns_info.inc" } /* attr const char* name @ setglobal(gid)(val)() */ @@ -3046,7 +3020,7 @@ attr_leaf_putspecialobject(MAYBE_UNUSED(rb_num_t value_type)) return #line 376 "insns.def" (value_type == VM_SPECIAL_OBJECT_VMCORE); -#line 3050 "insns_info.inc" +#line 3024 "insns_info.inc" } /* attr const char* name @ putspecialobject(value_type)()(val) */ @@ -3175,7 +3149,7 @@ attr_leaf_concatstrings(MAYBE_UNUSED(rb_num_t num)) return #line 402 "insns.def" false; -#line 3179 "insns_info.inc" +#line 3153 "insns_info.inc" } /* attr const char* name @ concatstrings(num)(...)(val) */ @@ -3213,7 +3187,7 @@ attr_sp_inc_concatstrings(MAYBE_UNUSED(rb_num_t num)) return #line 403 "insns.def" 1 - (rb_snum_t)num; -#line 3217 "insns_info.inc" +#line 3191 "insns_info.inc" } /* attr rb_num_t width @ concatstrings(num)(...)(val) */ @@ -3316,7 +3290,7 @@ attr_leaf_toregexp( return #line 429 "insns.def" false; -#line 3320 "insns_info.inc" +#line 3294 "insns_info.inc" } /* attr const char* name @ toregexp(opt, cnt)(...)(val) */ @@ -3369,7 +3343,7 @@ attr_sp_inc_toregexp( return #line 430 "insns.def" 1 - (rb_snum_t)cnt; -#line 3373 "insns_info.inc" +#line 3347 "insns_info.inc" } /* attr rb_num_t width @ toregexp(opt, cnt)(...)(val) */ @@ -3501,7 +3475,7 @@ attr_sp_inc_newarray(MAYBE_UNUSED(rb_num_t num)) return #line 453 "insns.def" 1 - (rb_snum_t)num; -#line 3505 "insns_info.inc" +#line 3479 "insns_info.inc" } /* attr rb_num_t width @ newarray(num)(...)(val) */ @@ -3567,7 +3541,7 @@ attr_sp_inc_newarraykwsplat(MAYBE_UNUSED(rb_num_t num)) return #line 468 "insns.def" 1 - (rb_snum_t)num; -#line 3571 "insns_info.inc" +#line 3545 "insns_info.inc" } /* attr rb_num_t width @ newarraykwsplat(num)(...)(val) */ @@ -3733,7 +3707,7 @@ attr_leaf_expandarray( return #line 514 "insns.def" false; -#line 3737 "insns_info.inc" +#line 3711 "insns_info.inc" } /* attr const char* name @ expandarray(num, flag)(..., ary)(...) */ @@ -3786,7 +3760,7 @@ attr_sp_inc_expandarray( return #line 515 "insns.def" (rb_snum_t)num - 1 + (flag & 1 ? 1 : 0); -#line 3790 "insns_info.inc" +#line 3764 "insns_info.inc" } /* attr rb_num_t width @ expandarray(num, flag)(..., ary)(...) */ @@ -3820,7 +3794,7 @@ attr_leaf_concatarray(void) return #line 526 "insns.def" false; -#line 3824 "insns_info.inc" +#line 3798 "insns_info.inc" } /* attr const char* name @ concatarray()(ary1, ary2)(ary) */ @@ -3886,7 +3860,7 @@ attr_leaf_splatarray(MAYBE_UNUSED(VALUE flag)) return #line 537 "insns.def" false; -#line 3890 "insns_info.inc" +#line 3864 "insns_info.inc" } /* attr const char* name @ splatarray(flag)(ary)(obj) */ @@ -3952,7 +3926,7 @@ attr_leaf_newhash(MAYBE_UNUSED(rb_num_t num)) return #line 548 "insns.def" false; -#line 3956 "insns_info.inc" +#line 3930 "insns_info.inc" } /* attr const char* name @ newhash(num)(...)(val) */ @@ -3990,7 +3964,7 @@ attr_sp_inc_newhash(MAYBE_UNUSED(rb_num_t num)) return #line 549 "insns.def" 1 - (rb_snum_t)num; -#line 3994 "insns_info.inc" +#line 3968 "insns_info.inc" } /* attr rb_num_t width @ newhash(num)(...)(val) */ @@ -4021,7 +3995,7 @@ attr_leaf_newrange(MAYBE_UNUSED(rb_num_t flag)) return #line 569 "insns.def" false; -#line 4025 "insns_info.inc" +#line 3999 "insns_info.inc" } /* attr const char* name @ newrange(flag)(low, high)(val) */ @@ -4248,7 +4222,7 @@ attr_sp_inc_dupn(MAYBE_UNUSED(rb_num_t n)) return #line 605 "insns.def" n; -#line 4252 "insns_info.inc" +#line 4226 "insns_info.inc" } /* attr rb_num_t width @ dupn(n)(...)(...) */ @@ -4377,7 +4351,7 @@ attr_sp_inc_opt_reverse(MAYBE_UNUSED(rb_num_t n)) return #line 629 "insns.def" 0; -#line 4381 "insns_info.inc" +#line 4355 "insns_info.inc" } /* attr rb_num_t width @ opt_reverse(n)(...)(...) */ @@ -4443,7 +4417,7 @@ attr_sp_inc_topn(MAYBE_UNUSED(rb_num_t n)) return #line 659 "insns.def" 1; -#line 4447 "insns_info.inc" +#line 4421 "insns_info.inc" } /* attr rb_num_t width @ topn(n)(...)(val) */ @@ -4509,7 +4483,7 @@ attr_sp_inc_setn(MAYBE_UNUSED(rb_num_t n)) return #line 670 "insns.def" 0; -#line 4513 "insns_info.inc" +#line 4487 "insns_info.inc" } /* attr rb_num_t width @ setn(n)(..., val)(val) */ @@ -4575,7 +4549,7 @@ attr_sp_inc_adjuststack(MAYBE_UNUSED(rb_num_t n)) return #line 681 "insns.def" -(rb_snum_t)n; -#line 4579 "insns_info.inc" +#line 4553 "insns_info.inc" } /* attr rb_num_t width @ adjuststack(n)(...)(...) */ @@ -4618,7 +4592,7 @@ attr_leaf_defined( return #line 696 "insns.def" leafness_of_defined(op_type); -#line 4622 "insns_info.inc" +#line 4596 "insns_info.inc" } /* attr const char* name @ defined(op_type, obj, pushval)(v)(val) */ @@ -4720,7 +4694,7 @@ attr_leaf_definedivar( return #line 710 "insns.def" false; -#line 4724 "insns_info.inc" +#line 4698 "insns_info.inc" } /* attr const char* name @ definedivar(id, ic, pushval)()(val) */ @@ -4810,7 +4784,7 @@ attr_leaf_checkmatch(MAYBE_UNUSED(rb_num_t flag)) return #line 730 "insns.def" leafness_of_checkmatch(flag); -#line 4814 "insns_info.inc" +#line 4788 "insns_info.inc" } /* attr const char* name @ checkmatch(flag)(target, pattern)(result) */ @@ -5307,7 +5281,7 @@ attr_comptime_sp_inc_send( return #line 812 "insns.def" sp_inc_of_sendish(ci); -#line 5311 "insns_info.inc" +#line 5285 "insns_info.inc" } /* attr bool handles_sp @ send(cd, blockiseq)(...)(val) */ @@ -5380,7 +5354,7 @@ attr_sp_inc_send( return #line 811 "insns.def" sp_inc_of_sendish(cd->ci); -#line 5384 "insns_info.inc" +#line 5358 "insns_info.inc" } /* attr rb_num_t width @ send(cd, blockiseq)(...)(val) */ @@ -5407,7 +5381,7 @@ attr_comptime_sp_inc_opt_send_without_block(MAYBE_UNUSED(CALL_INFO ci)) return #line 832 "insns.def" sp_inc_of_sendish(ci); -#line 5411 "insns_info.inc" +#line 5385 "insns_info.inc" } /* attr bool handles_sp @ opt_send_without_block(cd)(...)(val) */ @@ -5417,7 +5391,7 @@ attr_handles_sp_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) return #line 830 "insns.def" true; -#line 5421 "insns_info.inc" +#line 5395 "insns_info.inc" } /* attr bool leaf @ opt_send_without_block(cd)(...)(val) */ @@ -5462,7 +5436,7 @@ attr_sp_inc_opt_send_without_block(MAYBE_UNUSED(CALL_DATA cd)) return #line 831 "insns.def" sp_inc_of_sendish(cd->ci); -#line 5466 "insns_info.inc" +#line 5440 "insns_info.inc" } /* attr rb_num_t width @ opt_send_without_block(cd)(...)(val) */ @@ -5493,7 +5467,7 @@ attr_leaf_objtostring(MAYBE_UNUSED(CALL_DATA cd)) return #line 850 "insns.def" false; -#line 5497 "insns_info.inc" +#line 5471 "insns_info.inc" } /* attr const char* name @ objtostring(cd)(recv)(val) */ @@ -5801,7 +5775,7 @@ attr_comptime_sp_inc_opt_newarray_send( return #line 912 "insns.def" 1 - (rb_snum_t)num; -#line 5805 "insns_info.inc" +#line 5779 "insns_info.inc" } /* attr bool handles_sp @ opt_newarray_send(num, method)(...)(val) */ @@ -5824,7 +5798,7 @@ attr_leaf_opt_newarray_send( return #line 910 "insns.def" false; -#line 5828 "insns_info.inc" +#line 5802 "insns_info.inc" } /* attr const char* name @ opt_newarray_send(num, method)(...)(val) */ @@ -5877,7 +5851,7 @@ attr_sp_inc_opt_newarray_send( return #line 911 "insns.def" 1 - (rb_snum_t)num; -#line 5881 "insns_info.inc" +#line 5855 "insns_info.inc" } /* attr rb_num_t width @ opt_newarray_send(num, method)(...)(val) */ @@ -5910,7 +5884,7 @@ attr_comptime_sp_inc_invokesuper( return #line 936 "insns.def" sp_inc_of_sendish(ci); -#line 5914 "insns_info.inc" +#line 5888 "insns_info.inc" } /* attr bool handles_sp @ invokesuper(cd, blockiseq)(...)(val) */ @@ -5983,7 +5957,7 @@ attr_sp_inc_invokesuper( return #line 935 "insns.def" sp_inc_of_sendish(cd->ci); -#line 5987 "insns_info.inc" +#line 5961 "insns_info.inc" } /* attr rb_num_t width @ invokesuper(cd, blockiseq)(...)(val) */ @@ -6010,7 +5984,7 @@ attr_comptime_sp_inc_invokeblock(MAYBE_UNUSED(CALL_INFO ci)) return #line 956 "insns.def" sp_inc_of_invokeblock(ci); -#line 6014 "insns_info.inc" +#line 5988 "insns_info.inc" } /* attr bool handles_sp @ invokeblock(cd)(...)(val) */ @@ -6020,7 +5994,7 @@ attr_handles_sp_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) return #line 954 "insns.def" true; -#line 6024 "insns_info.inc" +#line 5998 "insns_info.inc" } /* attr bool leaf @ invokeblock(cd)(...)(val) */ @@ -6065,7 +6039,7 @@ attr_sp_inc_invokeblock(MAYBE_UNUSED(CALL_DATA cd)) return #line 955 "insns.def" sp_inc_of_invokeblock(cd->ci); -#line 6069 "insns_info.inc" +#line 6043 "insns_info.inc" } /* attr rb_num_t width @ invokeblock(cd)(...)(val) */ @@ -6089,7 +6063,7 @@ attr_handles_sp_leave(void) return #line 978 "insns.def" true; -#line 6093 "insns_info.inc" +#line 6067 "insns_info.inc" } /* attr bool leaf @ leave()(val)(val) */ @@ -6099,7 +6073,7 @@ attr_leaf_leave(void) return #line 977 "insns.def" false; -#line 6103 "insns_info.inc" +#line 6077 "insns_info.inc" } /* attr const char* name @ leave()(val)(val) */ @@ -6165,7 +6139,7 @@ attr_leaf_throw(MAYBE_UNUSED(rb_num_t throw_state)) return #line 1011 "insns.def" false; -#line 6169 "insns_info.inc" +#line 6143 "insns_info.inc" } /* attr const char* name @ throw(throw_state)(throwobj)(val) */ @@ -6231,7 +6205,7 @@ attr_leaf_jump(MAYBE_UNUSED(OFFSET dst)) return #line 1029 "insns.def" leafness_of_check_ints; -#line 6235 "insns_info.inc" +#line 6209 "insns_info.inc" } /* attr const char* name @ jump(dst)()() */ @@ -6297,7 +6271,7 @@ attr_leaf_branchif(MAYBE_UNUSED(OFFSET dst)) return #line 1042 "insns.def" leafness_of_check_ints; -#line 6301 "insns_info.inc" +#line 6275 "insns_info.inc" } /* attr const char* name @ branchif(dst)(val)() */ @@ -6363,7 +6337,7 @@ attr_leaf_branchunless(MAYBE_UNUSED(OFFSET dst)) return #line 1057 "insns.def" leafness_of_check_ints; -#line 6367 "insns_info.inc" +#line 6341 "insns_info.inc" } /* attr const char* name @ branchunless(dst)(val)() */ @@ -6429,7 +6403,7 @@ attr_leaf_branchnil(MAYBE_UNUSED(OFFSET dst)) return #line 1072 "insns.def" leafness_of_check_ints; -#line 6433 "insns_info.inc" +#line 6407 "insns_info.inc" } /* attr const char* name @ branchnil(dst)(val)() */ @@ -6644,7 +6618,7 @@ attr_sp_inc_opt_case_dispatch( return #line 1100 "insns.def" -1; -#line 6648 "insns_info.inc" +#line 6622 "insns_info.inc" } /* attr rb_num_t width @ opt_case_dispatch(hash, else_offset)(..., key)() */ @@ -6867,7 +6841,7 @@ attr_leaf_opt_div(MAYBE_UNUSED(CALL_DATA cd)) return #line 1161 "insns.def" false; -#line 6871 "insns_info.inc" +#line 6845 "insns_info.inc" } /* attr const char* name @ opt_div(cd)(recv, obj)(val) */ @@ -6933,7 +6907,7 @@ attr_leaf_opt_mod(MAYBE_UNUSED(CALL_DATA cd)) return #line 1177 "insns.def" false; -#line 6937 "insns_info.inc" +#line 6911 "insns_info.inc" } /* attr const char* name @ opt_mod(cd)(recv, obj)(val) */ @@ -7404,7 +7378,7 @@ attr_leaf_opt_ltlt(MAYBE_UNUSED(CALL_DATA cd)) return #line 1279 "insns.def" false; -#line 7408 "insns_info.inc" +#line 7382 "insns_info.inc" } /* attr const char* name @ opt_ltlt(cd)(recv, obj)(val) */ @@ -7596,7 +7570,7 @@ attr_leaf_opt_aref(MAYBE_UNUSED(CALL_DATA cd)) return #line 1326 "insns.def" false; -#line 7600 "insns_info.inc" +#line 7574 "insns_info.inc" } /* attr const char* name @ opt_aref(cd)(recv, obj)(val) */ @@ -7662,7 +7636,7 @@ attr_leaf_opt_aset(MAYBE_UNUSED(CALL_DATA cd)) return #line 1343 "insns.def" false; -#line 7666 "insns_info.inc" +#line 7640 "insns_info.inc" } /* attr const char* name @ opt_aset(cd)(recv, obj, set)(val) */ @@ -7737,7 +7711,7 @@ attr_leaf_opt_aset_with( return #line 1359 "insns.def" false; -#line 7741 "insns_info.inc" +#line 7715 "insns_info.inc" } /* attr const char* name @ opt_aset_with(key, cd)(recv, val)(val) */ @@ -7830,7 +7804,7 @@ attr_leaf_opt_aref_with( return #line 1380 "insns.def" false; -#line 7834 "insns_info.inc" +#line 7808 "insns_info.inc" } /* attr const char* name @ opt_aref_with(key, cd)(recv)(val) */ @@ -8229,7 +8203,7 @@ attr_leaf_opt_regexpmatch2(MAYBE_UNUSED(CALL_DATA cd)) return #line 1466 "insns.def" false; -#line 8233 "insns_info.inc" +#line 8207 "insns_info.inc" } /* attr const char* name @ opt_regexpmatch2(cd)(obj2, obj1)(val) */ @@ -8295,7 +8269,7 @@ attr_leaf_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) return #line 1481 "insns.def" false; -#line 8299 "insns_info.inc" +#line 8273 "insns_info.inc" } /* attr const char* name @ invokebuiltin(bf)(...)(val) */ @@ -8333,7 +8307,7 @@ attr_sp_inc_invokebuiltin(MAYBE_UNUSED(RB_BUILTIN bf)) return #line 1482 "insns.def" 1 - bf->argc; -#line 8337 "insns_info.inc" +#line 8311 "insns_info.inc" } /* attr rb_num_t width @ invokebuiltin(bf)(...)(val) */ @@ -8373,7 +8347,7 @@ attr_leaf_opt_invokebuiltin_delegate( return #line 1493 "insns.def" false; -#line 8377 "insns_info.inc" +#line 8351 "insns_info.inc" } /* attr const char* name @ opt_invokebuiltin_delegate(bf, index)()(val) */ @@ -8466,7 +8440,7 @@ attr_leaf_opt_invokebuiltin_delegate_leave( return #line 1504 "insns.def" false; -#line 8470 "insns_info.inc" +#line 8444 "insns_info.inc" } /* attr const char* name @ opt_invokebuiltin_delegate_leave(bf, index)()(val) */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/array.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/array.h similarity index 89% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/array.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/array.h index 7e55b66a..66017129 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/array.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/array.h @@ -40,8 +40,6 @@ VALUE rb_ary_diff(VALUE ary1, VALUE ary2); static inline VALUE rb_ary_entry_internal(VALUE ary, long offset); static inline bool ARY_PTR_USING_P(VALUE ary); -static inline void RARY_TRANSIENT_SET(VALUE ary); -static inline void RARY_TRANSIENT_UNSET(VALUE ary); VALUE rb_ary_tmp_new_from_values(VALUE, long, const VALUE *); VALUE rb_check_to_array(VALUE ary); @@ -56,7 +54,7 @@ static inline VALUE rb_ary_entry_internal(VALUE ary, long offset) { long len = RARRAY_LEN(ary); - const VALUE *ptr = RARRAY_CONST_PTR_TRANSIENT(ary); + const VALUE *ptr = RARRAY_CONST_PTR(ary); if (len == 0) return Qnil; if (offset < 0) { offset += len; @@ -118,22 +116,6 @@ ARY_SHARED_ROOT_REFCNT(VALUE ary) return RARRAY(ary)->as.heap.aux.capa; } -static inline void -RARY_TRANSIENT_SET(VALUE ary) -{ -#if USE_TRANSIENT_HEAP - FL_SET_RAW(ary, RARRAY_TRANSIENT_FLAG); -#endif -} - -static inline void -RARY_TRANSIENT_UNSET(VALUE ary) -{ -#if USE_TRANSIENT_HEAP - FL_UNSET_RAW(ary, RARRAY_TRANSIENT_FLAG); -#endif -} - #undef rb_ary_new_from_args #if RBIMPL_HAS_WARNING("-Wgnu-zero-variadic-macro-arguments") # /* Skip it; clang -pedantic doesn't like the following */ @@ -156,7 +138,7 @@ RARRAY_AREF(VALUE ary, long i) { RBIMPL_ASSERT_TYPE(ary, RUBY_T_ARRAY); - return RARRAY_CONST_PTR_TRANSIENT(ary)[i]; + return RARRAY_CONST_PTR(ary)[i]; } #endif /* INTERNAL_ARRAY_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/basic_operators.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/basic_operators.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/basic_operators.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/basic_operators.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/bignum.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/bignum.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/bignum.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/bignum.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/bits.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/bits.h similarity index 99% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/bits.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/bits.h index 6248e4cf..538e6c11 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/bits.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/bits.h @@ -118,12 +118,16 @@ MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX) #endif -#ifdef MUL_OVERFLOW_P +#if defined(MUL_OVERFLOW_P) && defined(USE___BUILTIN_MUL_OVERFLOW_LONG_LONG) # define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_P(a, b) +#else +# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX) +#endif + +#ifdef MUL_OVERFLOW_P # define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_P(a, b) # define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_P(a, b) #else -# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX) # define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX) # define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX) #endif diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/class.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/class.h similarity index 97% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/class.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/class.h index b33c807e..b9ff53a6 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/class.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/class.h @@ -17,6 +17,9 @@ #include "ruby/intern.h" /* for rb_alloc_func_t */ #include "ruby/ruby.h" /* for struct RBasic */ #include "shape.h" +#include "ruby_assert.h" +#include "vm_core.h" +#include "method.h" /* for rb_cref_t */ #ifdef RCLASS_SUPER # undef RCLASS_SUPER @@ -32,6 +35,7 @@ typedef struct rb_subclass_entry rb_subclass_entry_t; struct rb_cvar_class_tbl_entry { uint32_t index; rb_serial_t global_cvar_state; + const rb_cref_t * cref; VALUE class_value; }; @@ -115,6 +119,7 @@ VALUE rb_module_s_alloc(VALUE klass); void rb_module_set_initialized(VALUE module); void rb_module_check_initializable(VALUE module); VALUE rb_make_metaclass(VALUE, VALUE); +VALUE rb_iclass_alloc(VALUE klass); VALUE rb_include_class_new(VALUE, VALUE); void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE); void rb_class_detach_subclasses(VALUE); @@ -143,7 +148,7 @@ static inline rb_alloc_func_t RCLASS_ALLOCATOR(VALUE klass) { if (FL_TEST_RAW(klass, FL_SINGLETON)) { - return NULL; + return 0; } return RCLASS_EXT(klass)->as.class.allocator; } @@ -201,7 +206,7 @@ RCLASS_SET_SUPER(VALUE klass, VALUE super) static inline void RCLASS_SET_CLASSPATH(VALUE klass, VALUE classpath, bool permanent) { - assert(BUILTIN_TYPE(klass) == T_CLASS || BUILTIN_TYPE(klass) == T_MODULE); + assert(BUILTIN_TYPE(klass) == T_CLASS || BUILTIN_TYPE(klass) == T_MODULE || klass == rb_mRubyVMFrozenCore); assert(classpath == 0 || BUILTIN_TYPE(classpath) == T_STRING); RB_OBJ_WRITE(klass, &(RCLASS_EXT(klass)->classpath), classpath); diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/cmdlineopt.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/cmdlineopt.h similarity index 94% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/cmdlineopt.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/cmdlineopt.h index 483a5d4f..3b678b1e 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/cmdlineopt.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/cmdlineopt.h @@ -23,11 +23,13 @@ typedef struct ruby_cmdline_options { ruby_features_t features; ruby_features_t warn; unsigned int dump; + long backtrace_length_limit; #if USE_RJIT struct rb_rjit_options rjit; #endif - int sflag, xflag; + signed int sflag: 2; + unsigned int xflag: 1; unsigned int warning: 1; unsigned int verbose: 1; unsigned int do_loop: 1; diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compar.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/compar.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compar.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/compar.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compile.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/compile.h similarity index 97% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compile.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/compile.h index eebb7605..2ece5396 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compile.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/compile.h @@ -17,7 +17,6 @@ struct rb_iseq_struct; /* in vm_core.h */ /* compile.c */ int rb_dvar_defined(ID, const struct rb_iseq_struct *); int rb_local_defined(ID, const struct rb_iseq_struct *); -bool rb_insns_leaf_p(int i); int rb_insn_len(VALUE insn); const char *rb_insns_name(int i); VALUE rb_insns_name_array(void); diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compilers.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/compilers.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/compilers.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/compilers.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/complex.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/complex.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/complex.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/complex.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/cont.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/cont.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/cont.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/cont.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/dir.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/dir.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/dir.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/dir.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enc.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/enc.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enc.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/enc.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/encoding.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/encoding.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/encoding.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/encoding.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enum.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/enum.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enum.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/enum.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enumerator.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/enumerator.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/enumerator.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/enumerator.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/error.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/error.h similarity index 93% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/error.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/error.h index 11601858..5fee4689 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/error.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/error.h @@ -29,15 +29,37 @@ #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 -# define rb_sys_fail_path(path) rb_sys_fail_path_in(RUBY_FUNCTION_NAME_STRING, path) # define rb_syserr_fail_path(err, path) rb_syserr_fail_path_in(RUBY_FUNCTION_NAME_STRING, (err), (path)) # define rb_syserr_new_path(err, path) rb_syserr_new_path_in(RUBY_FUNCTION_NAME_STRING, (err), (path)) #else -# define rb_sys_fail_path(path) rb_sys_fail_str(path) # define rb_syserr_fail_path(err, path) rb_syserr_fail_str((err), (path)) # define rb_syserr_new_path(err, path) rb_syserr_new_str((err), (path)) #endif +#define rb_sys_fail(mesg) \ +do { \ + int errno_to_fail = errno; \ + rb_syserr_fail(errno_to_fail, (mesg)); \ +} while (0) + +#define rb_sys_fail_str(mesg) \ +do { \ + int errno_to_fail = errno; \ + rb_syserr_fail_str(errno_to_fail, (mesg)); \ +} while (0) + +#define rb_sys_fail_path(path) \ +do { \ + int errno_to_fail = errno; \ + rb_syserr_fail_path(errno_to_fail, (path)); \ +} while (0) + +#define rb_sys_fail_sprintf(...) \ +do { \ + int errno_to_fail = errno; \ + rb_syserr_fail_str(errno_to_fail, rb_sprintf("" __VA_ARGS__)); \ +} while (0) + /* error.c */ extern long rb_backtrace_length_limit; extern VALUE rb_eEAGAIN; diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/eval.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/eval.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/eval.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/eval.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/file.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/file.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/file.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/file.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/fixnum.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/fixnum.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/fixnum.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/fixnum.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/gc.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/gc.h similarity index 92% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/gc.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/gc.h index d19b09f6..f8f88a41 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/gc.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/gc.h @@ -189,6 +189,17 @@ struct rb_objspace; /* in vm_core.h */ # define SIZE_POOL_COUNT 5 #endif +/* Used in places that could malloc during, which can cause the GC to run. We + * need to temporarily disable the GC to allow the malloc to happen. + * Allocating memory during GC is a bad idea, so use this only when absolutely + * necessary. */ +#define DURING_GC_COULD_MALLOC_REGION_START() \ + assert(rb_during_gc()); \ + VALUE _already_disabled = rb_gc_disable_no_rest() + +#define DURING_GC_COULD_MALLOC_REGION_END() \ + if (_already_disabled == Qfalse) rb_gc_enable() + typedef struct ractor_newobj_size_pool_cache { struct RVALUE *freelist; struct heap_page *using_page; @@ -204,6 +215,7 @@ extern VALUE *ruby_initial_gc_stress_ptr; extern int ruby_disable_gc; RUBY_ATTR_MALLOC void *ruby_mimmalloc(size_t size); void ruby_mimfree(void *ptr); +void rb_gc_prepare_heap(void); void rb_objspace_set_event_hook(const rb_event_flag_t event); VALUE rb_objspace_gc_enable(struct rb_objspace *); VALUE rb_objspace_gc_disable(struct rb_objspace *); @@ -234,6 +246,9 @@ VALUE rb_define_finalizer_no_check(VALUE obj, VALUE block); void rb_gc_mark_and_move(VALUE *ptr); +void rb_gc_mark_weak(VALUE *ptr); +void rb_gc_remove_weak(VALUE parent_obj, VALUE *ptr); + #define rb_gc_mark_and_move_ptr(ptr) do { \ VALUE _obj = (VALUE)*(ptr); \ rb_gc_mark_and_move(&_obj); \ @@ -271,6 +286,7 @@ void rb_gc_verify_internal_consistency(void); size_t rb_obj_gc_flags(VALUE, ID[], size_t); void rb_gc_mark_values(long n, const VALUE *values); void rb_gc_mark_vm_stack_values(long n, const VALUE *values); +void rb_gc_update_values(long n, VALUE *values); void *ruby_sized_xrealloc(void *ptr, size_t new_size, size_t old_size) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2)); void *ruby_sized_xrealloc2(void *ptr, size_t new_count, size_t element_size, size_t old_count) RUBY_ATTR_RETURNS_NONNULL RUBY_ATTR_ALLOC_SIZE((2, 3)); void ruby_sized_xfree(void *x, size_t size); @@ -302,6 +318,12 @@ ruby_sized_xfree_inlined(void *ptr, size_t size) # define SIZED_REALLOC_N(x, y, z, w) REALLOC_N(x, y, z) +static inline void * +ruby_sized_realloc_n(void *ptr, size_t new_count, size_t element_size, size_t old_count) +{ + return ruby_xrealloc2(ptr, new_count, element_size); +} + #else static inline void * @@ -325,6 +347,12 @@ ruby_sized_xfree_inlined(void *ptr, size_t size) # define SIZED_REALLOC_N(v, T, m, n) \ ((v) = (T *)ruby_sized_xrealloc2((void *)(v), (m), sizeof(T), (n))) +static inline void * +ruby_sized_realloc_n(void *ptr, size_t new_count, size_t element_size, size_t old_count) +{ + return ruby_sized_xrealloc2(ptr, new_count, element_size, old_count); +} + #endif /* HAVE_MALLOC_USABLE_SIZE */ #define ruby_sized_xrealloc ruby_sized_xrealloc_inlined diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/hash.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/hash.h similarity index 85% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/hash.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/hash.h index 275c5167..d1848e54 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/hash.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/hash.h @@ -28,10 +28,6 @@ enum ruby_rhash_flags { RHASH_AR_TABLE_BOUND_MASK = (FL_USER8|FL_USER9|FL_USER10|FL_USER11), /* FL 8..11 */ RHASH_AR_TABLE_BOUND_SHIFT = (FL_USHIFT+8), -#if USE_TRANSIENT_HEAP - RHASH_TRANSIENT_FLAG = FL_USER12, /* FL 12 */ -#endif - // we can not put it in "enum" because it can exceed "int" range. #define RHASH_LEV_MASK (FL_USER13 | FL_USER14 | FL_USER15 | /* FL 13..19 */ \ FL_USER16 | FL_USER17 | FL_USER18 | FL_USER19) @@ -40,17 +36,23 @@ enum ruby_rhash_flags { RHASH_LEV_MAX = 127, /* 7 bits */ }; -struct RHash { - struct RBasic basic; - union { - st_table *st; - struct ar_table_struct *ar; /* possibly 0 */ - } as; - const VALUE ifnone; +typedef struct ar_table_pair_struct { + VALUE key; + VALUE val; +} ar_table_pair; + +typedef struct ar_table_struct { union { ar_hint_t ary[RHASH_AR_TABLE_MAX_SIZE]; VALUE word; } ar_hint; + /* 64bit CPU: 8B * 2 * 8 = 128B */ + ar_table_pair pairs[RHASH_AR_TABLE_MAX_SIZE]; +} ar_table; + +struct RHash { + struct RBasic basic; + const VALUE ifnone; }; #define RHASH(obj) ((struct RHash *)(obj)) @@ -96,9 +98,6 @@ static inline struct ar_table_struct *RHASH_AR_TABLE(VALUE h); static inline st_table *RHASH_ST_TABLE(VALUE h); static inline size_t RHASH_ST_SIZE(VALUE h); static inline void RHASH_ST_CLEAR(VALUE h); -static inline bool RHASH_TRANSIENT_P(VALUE h); -static inline void RHASH_SET_TRANSIENT_FLAG(VALUE h); -static inline void RHASH_UNSET_TRANSIENT_FLAG(VALUE h); RUBY_SYMBOL_EXPORT_BEGIN /* hash.c (export) */ @@ -125,16 +124,18 @@ RHASH_AR_TABLE_P(VALUE h) return ! FL_TEST_RAW(h, RHASH_ST_TABLE_FLAG); } +RBIMPL_ATTR_RETURNS_NONNULL() static inline struct ar_table_struct * RHASH_AR_TABLE(VALUE h) { - return RHASH(h)->as.ar; + return (struct ar_table_struct *)((uintptr_t)h + sizeof(struct RHash)); } +RBIMPL_ATTR_RETURNS_NONNULL() static inline st_table * RHASH_ST_TABLE(VALUE h) { - return RHASH(h)->as.st; + return (st_table *)((uintptr_t)h + sizeof(struct RHash)); } static inline VALUE @@ -175,8 +176,7 @@ RHASH_ST_SIZE(VALUE h) static inline void RHASH_ST_CLEAR(VALUE h) { - RHASH(h)->as.st = NULL; - FL_UNSET_RAW(h, RHASH_ST_TABLE_FLAG); + memset(RHASH_ST_TABLE(h), 0, sizeof(st_table)); } static inline unsigned @@ -187,30 +187,4 @@ RHASH_AR_TABLE_SIZE_RAW(VALUE h) return (unsigned)ret; } -static inline bool -RHASH_TRANSIENT_P(VALUE h) -{ -#if USE_TRANSIENT_HEAP - return FL_TEST_RAW(h, RHASH_TRANSIENT_FLAG); -#else - return false; -#endif -} - -static inline void -RHASH_SET_TRANSIENT_FLAG(VALUE h) -{ -#if USE_TRANSIENT_HEAP - FL_SET_RAW(h, RHASH_TRANSIENT_FLAG); -#endif -} - -static inline void -RHASH_UNSET_TRANSIENT_FLAG(VALUE h) -{ -#if USE_TRANSIENT_HEAP - FL_UNSET_RAW(h, RHASH_TRANSIENT_FLAG); -#endif -} - #endif /* INTERNAL_HASH_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/imemo.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/imemo.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/imemo.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/imemo.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/inits.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/inits.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/inits.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/inits.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/io.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/io.h new file mode 100644 index 00000000..f16d9efc --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/io.h @@ -0,0 +1,137 @@ +#ifndef INTERNAL_IO_H /*-*-C-*-vi:se ft=c:*/ +#define INTERNAL_IO_H +/** + * @author Ruby developers + * @copyright This file is a part of the programming language Ruby. + * Permission is hereby granted, to either redistribute and/or + * modify this file, provided that the conditions mentioned in the + * file COPYING are met. Consult the file for details. + * @brief Internal header for IO. + */ +#include "ruby/ruby.h" /* for VALUE */ + +#define HAVE_RB_IO_T +struct rb_io; + +#include "ruby/io.h" /* for rb_io_t */ + +/** Ruby's IO, metadata and buffers. */ +struct rb_io { + + /** The IO's Ruby level counterpart. */ + VALUE self; + + /** stdio ptr for read/write, if available. */ + FILE *stdio_file; + + /** file descriptor. */ + int fd; + + /** mode flags: FMODE_XXXs */ + int mode; + + /** child's pid (for pipes) */ + rb_pid_t pid; + + /** number of lines read */ + int lineno; + + /** pathname for file */ + VALUE pathv; + + /** finalize proc */ + void (*finalize)(struct rb_io*,int); + + /** Write buffer. */ + rb_io_buffer_t wbuf; + + /** + * (Byte) read buffer. Note also that there is a field called + * ::rb_io_t::cbuf, which also concerns read IO. + */ + rb_io_buffer_t rbuf; + + /** + * Duplex IO object, if set. + * + * @see rb_io_set_write_io() + */ + VALUE tied_io_for_writing; + + struct rb_io_encoding encs; /**< Decomposed encoding flags. */ + + /** Encoding converter used when reading from this IO. */ + rb_econv_t *readconv; + + /** + * rb_io_ungetc() destination. This buffer is read before checking + * ::rb_io_t::rbuf + */ + rb_io_buffer_t cbuf; + + /** Encoding converter used when writing to this IO. */ + rb_econv_t *writeconv; + + /** + * This is, when set, an instance of ::rb_cString which holds the "common" + * encoding. Write conversion can convert strings twice... In case + * conversion from encoding X to encoding Y does not exist, Ruby finds an + * encoding Z that bridges the two, so that X to Z to Y conversion happens. + */ + VALUE writeconv_asciicompat; + + /** Whether ::rb_io_t::writeconv is already set up. */ + int writeconv_initialized; + + /** + * Value of ::rb_io_t::rb_io_enc_t::ecflags stored right before + * initialising ::rb_io_t::writeconv. + */ + int writeconv_pre_ecflags; + + /** + * Value of ::rb_io_t::rb_io_enc_t::ecopts stored right before initialising + * ::rb_io_t::writeconv. + */ + VALUE writeconv_pre_ecopts; + + /** + * This is a Ruby level mutex. It avoids multiple threads to write to an + * IO at once; helps for instance rb_io_puts() to ensure newlines right + * next to its arguments. + * + * This of course doesn't help inter-process IO interleaves, though. + */ + VALUE write_lock; + + /** + * The timeout associated with this IO when performing blocking operations. + */ + VALUE timeout; +}; + +/* io.c */ +void ruby_set_inplace_mode(const char *); +void rb_stdio_set_default_encoding(void); +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); +#ifdef rb_io_fptr_finalize +# undef rb_io_fptr_finalize +#endif +#define rb_io_fptr_finalize rb_io_fptr_finalize_internal +VALUE rb_io_popen(VALUE pname, VALUE pmode, VALUE env, VALUE opt); + +VALUE rb_io_prep_stdin(void); +VALUE rb_io_prep_stdout(void); +VALUE rb_io_prep_stderr(void); + +RUBY_SYMBOL_EXPORT_BEGIN +/* io.c (export) */ +void rb_maygvl_fd_fix_cloexec(int fd); +int rb_gc_for_fd(int err); +void rb_write_error_str(VALUE mesg); +RUBY_SYMBOL_EXPORT_END + +#endif /* INTERNAL_IO_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/load.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/load.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/load.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/load.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/loadpath.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/loadpath.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/loadpath.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/loadpath.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/math.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/math.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/math.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/math.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/missing.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/missing.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/missing.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/missing.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/numeric.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/numeric.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/numeric.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/numeric.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/object.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/object.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/object.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/object.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/parse.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/parse.h new file mode 100644 index 00000000..ce99556e --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/parse.h @@ -0,0 +1,133 @@ +#ifndef INTERNAL_PARSE_H /*-*-C-*-vi:se ft=c:*/ +#define INTERNAL_PARSE_H +/** + * @author Ruby developers + * @copyright This file is a part of the programming language Ruby. + * Permission is hereby granted, to either redistribute and/or + * modify this file, provided that the conditions mentioned in the + * file COPYING are met. Consult the file for details. + * @brief Internal header for the parser. + */ +#include +#include "rubyparser.h" +#include "internal/static_assert.h" + +#ifdef UNIVERSAL_PARSER +#define rb_encoding void +#endif + +struct rb_iseq_struct; /* in vm_core.h */ + +#define STRTERM_HEREDOC IMEMO_FL_USER0 + +/* structs for managing terminator of string literal and heredocment */ +typedef struct rb_strterm_literal_struct { + union { + VALUE dummy; + long nest; + } u0; + union { + VALUE dummy; + long func; /* STR_FUNC_* (e.g., STR_FUNC_ESCAPE and STR_FUNC_EXPAND) */ + } u1; + union { + VALUE dummy; + long paren; /* '(' of `%q(...)` */ + } u2; + union { + VALUE dummy; + long term; /* ')' of `%q(...)` */ + } u3; +} rb_strterm_literal_t; + +#define HERETERM_LENGTH_BITS ((SIZEOF_VALUE - 1) * CHAR_BIT - 1) + +typedef struct rb_strterm_heredoc_struct { + VALUE lastline; /* the string of line that contains `<<"END"` */ + long offset; /* the column of END in `<<"END"` */ + int sourceline; /* lineno of the line that contains `<<"END"` */ + unsigned length /* the length of END in `<<"END"` */ +#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT + : HERETERM_LENGTH_BITS +# define HERETERM_LENGTH_MAX ((1U << HERETERM_LENGTH_BITS) - 1) +#else +# define HERETERM_LENGTH_MAX UINT_MAX +#endif + ; +#if HERETERM_LENGTH_BITS < SIZEOF_INT * CHAR_BIT + unsigned quote: 1; + unsigned func: 8; +#else + uint8_t quote; + uint8_t func; +#endif +} rb_strterm_heredoc_t; +STATIC_ASSERT(rb_strterm_heredoc_t, sizeof(rb_strterm_heredoc_t) <= 4 * SIZEOF_VALUE); + +typedef struct rb_strterm_struct { + VALUE flags; + union { + rb_strterm_literal_t literal; + rb_strterm_heredoc_t heredoc; + } u; +} rb_strterm_t; + +/* parse.y */ +void rb_ruby_parser_mark(void *ptr); +size_t rb_ruby_parser_memsize(const void *ptr); + +void rb_ruby_parser_set_options(rb_parser_t *p, int print, int loop, int chomp, int split); +rb_parser_t *rb_ruby_parser_set_context(rb_parser_t *p, const struct rb_iseq_struct *base, int main); +void rb_ruby_parser_set_script_lines(rb_parser_t *p, VALUE lines_array); +void rb_ruby_parser_error_tolerant(rb_parser_t *p); +rb_ast_t* rb_ruby_parser_compile_file_path(rb_parser_t *p, VALUE fname, VALUE file, int start); +void rb_ruby_parser_keep_tokens(rb_parser_t *p); +rb_ast_t* rb_ruby_parser_compile_generic(rb_parser_t *p, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int start); +rb_ast_t* rb_ruby_parser_compile_string_path(rb_parser_t *p, VALUE f, VALUE s, int line); + +RUBY_SYMBOL_EXPORT_BEGIN + +VALUE rb_ruby_parser_encoding(rb_parser_t *p); +int rb_ruby_parser_end_seen_p(rb_parser_t *p); +int rb_ruby_parser_set_yydebug(rb_parser_t *p, int flag); + +RUBY_SYMBOL_EXPORT_END + +int rb_reg_named_capture_assign_iter_impl(struct parser_params *p, const char *s, long len, rb_encoding *enc, NODE **succ_block, const rb_code_location_t *loc); + +#ifdef RIPPER +void ripper_parser_mark(void *ptr); +void ripper_parser_free(void *ptr); +size_t ripper_parser_memsize(const void *ptr); +void ripper_error(struct parser_params *p); +VALUE ripper_value(struct parser_params *p); +int rb_ruby_parser_get_yydebug(rb_parser_t *p); +void rb_ruby_parser_set_value(rb_parser_t *p, VALUE value); +int rb_ruby_parser_error_p(rb_parser_t *p); +VALUE rb_ruby_parser_debug_output(rb_parser_t *p); +void rb_ruby_parser_set_debug_output(rb_parser_t *p, VALUE output); +VALUE rb_ruby_parser_parsing_thread(rb_parser_t *p); +void rb_ruby_parser_set_parsing_thread(rb_parser_t *p, VALUE parsing_thread); +void rb_ruby_parser_ripper_initialize(rb_parser_t *p, VALUE (*gets)(struct parser_params*,VALUE), VALUE input, VALUE sourcefile_string, const char *sourcefile, int sourceline); +VALUE rb_ruby_parser_result(rb_parser_t *p); +rb_encoding *rb_ruby_parser_enc(rb_parser_t *p); +VALUE rb_ruby_parser_ruby_sourcefile_string(rb_parser_t *p); +int rb_ruby_parser_ruby_sourceline(rb_parser_t *p); +int rb_ruby_parser_lex_state(rb_parser_t *p); +void rb_ruby_ripper_parse0(rb_parser_t *p); +int rb_ruby_ripper_dedent_string(rb_parser_t *p, VALUE string, int width); +VALUE rb_ruby_ripper_lex_get_str(rb_parser_t *p, VALUE s); +int rb_ruby_ripper_initialized_p(rb_parser_t *p); +void rb_ruby_ripper_parser_initialize(rb_parser_t *p); +long rb_ruby_ripper_column(rb_parser_t *p); +long rb_ruby_ripper_token_len(rb_parser_t *p); +VALUE rb_ruby_ripper_lex_lastline(rb_parser_t *p); +VALUE rb_ruby_ripper_lex_state_name(struct parser_params *p, int state); +struct parser_params *rb_ruby_ripper_parser_allocate(void); +#endif + +#ifdef UNIVERSAL_PARSER +#undef rb_encoding +#endif + +#endif /* INTERNAL_PARSE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/proc.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/proc.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/proc.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/proc.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/process.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/process.h similarity index 92% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/process.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/process.h index b9c52aeb..fd4994cb 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/process.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/process.h @@ -22,7 +22,6 @@ #include "ruby/ruby.h" /* for VALUE */ #include "internal/compilers.h" /* for __has_warning */ #include "internal/imemo.h" /* for RB_IMEMO_TMPBUF_PTR */ -#include "internal/warnings.h" /* for COMPILER_WARNING_PUSH */ #define RB_MAX_GROUPS (65536) @@ -122,17 +121,4 @@ ARGVSTR2ARGC(VALUE argv_str) return i - 1; } -#ifdef HAVE_WORKING_FORK -COMPILER_WARNING_PUSH -#if __has_warning("-Wdeprecated-declarations") || RBIMPL_COMPILER_IS(GCC) -COMPILER_WARNING_IGNORED(-Wdeprecated-declarations) -#endif -static inline rb_pid_t -rb_fork(void) -{ - return fork(); -} -COMPILER_WARNING_POP -#endif - #endif /* INTERNAL_PROCESS_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/ractor.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/ractor.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/ractor.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/ractor.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/random.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/random.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/random.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/random.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/range.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/range.h similarity index 93% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/range.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/range.h index 8daba0ec..2394937b 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/range.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/range.h @@ -24,13 +24,13 @@ RANGE_BEG(VALUE r) static inline VALUE RANGE_END(VALUE r) { - return RSTRUCT(r)->as.ary[1]; + return RSTRUCT_GET(r, 1); } static inline VALUE RANGE_EXCL(VALUE r) { - return RSTRUCT(r)->as.ary[2]; + return RSTRUCT_GET(r, 2); } VALUE diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/rational.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/rational.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/rational.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/rational.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/re.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/re.h similarity index 96% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/re.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/re.h index 7b2505b9..3e201146 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/re.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/re.h @@ -22,7 +22,7 @@ VALUE rb_reg_equal(VALUE re1, VALUE re2); void rb_backref_set_string(VALUE string, long pos, long len); void rb_match_unbusy(VALUE); int rb_match_count(VALUE match); -int rb_match_nth_defined(int nth, VALUE match); VALUE rb_reg_new_ary(VALUE ary, int options); +VALUE rb_reg_last_defined(VALUE match); #endif /* INTERNAL_RE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/ruby_parser.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/ruby_parser.h new file mode 100644 index 00000000..fc231777 --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/ruby_parser.h @@ -0,0 +1,69 @@ +#ifndef INTERNAL_RUBY_PARSE_H +#define INTERNAL_RUBY_PARSE_H + +#include "internal.h" +#include "internal/imemo.h" +#include "rubyparser.h" +#include "vm.h" + +RUBY_SYMBOL_EXPORT_BEGIN +#ifdef UNIVERSAL_PARSER +void rb_parser_config_initialize(rb_parser_config_t *config); +#endif +VALUE rb_parser_set_context(VALUE, const struct rb_iseq_struct *, int); +RUBY_SYMBOL_EXPORT_END + +VALUE rb_parser_new(void); +VALUE rb_parser_end_seen_p(VALUE); +VALUE rb_parser_encoding(VALUE); +VALUE rb_parser_set_yydebug(VALUE, VALUE); +void rb_parser_set_options(VALUE, int, int, int, int); +void *rb_parser_load_file(VALUE parser, VALUE name); +void rb_parser_set_script_lines(VALUE vparser, VALUE lines_array); +void rb_parser_error_tolerant(VALUE vparser); +void rb_parser_keep_tokens(VALUE vparser); + +rb_ast_t *rb_parser_compile_string(VALUE, const char*, VALUE, int); +rb_ast_t *rb_parser_compile_string_path(VALUE vparser, VALUE fname, VALUE src, int line); +rb_ast_t *rb_parser_compile_file_path(VALUE vparser, VALUE fname, VALUE input, int line); +rb_ast_t *rb_parser_compile_generic(VALUE vparser, VALUE (*lex_gets)(VALUE, int), VALUE fname, VALUE input, int line); + +enum lex_state_bits { + EXPR_BEG_bit, /* ignore newline, +/- is a sign. */ + EXPR_END_bit, /* newline significant, +/- is an operator. */ + EXPR_ENDARG_bit, /* ditto, and unbound braces. */ + EXPR_ENDFN_bit, /* ditto, and unbound braces. */ + EXPR_ARG_bit, /* newline significant, +/- is an operator. */ + EXPR_CMDARG_bit, /* newline significant, +/- is an operator. */ + EXPR_MID_bit, /* newline significant, +/- is an operator. */ + EXPR_FNAME_bit, /* ignore newline, no reserved words. */ + EXPR_DOT_bit, /* right after `.', `&.' or `::', no reserved words. */ + EXPR_CLASS_bit, /* immediate after `class', no here document. */ + EXPR_LABEL_bit, /* flag bit, label is allowed. */ + EXPR_LABELED_bit, /* flag bit, just after a label. */ + EXPR_FITEM_bit, /* symbol literal as FNAME. */ + EXPR_MAX_STATE +}; +/* examine combinations */ +enum lex_state_e { +#define DEF_EXPR(n) EXPR_##n = (1 << EXPR_##n##_bit) + DEF_EXPR(BEG), + DEF_EXPR(END), + DEF_EXPR(ENDARG), + DEF_EXPR(ENDFN), + DEF_EXPR(ARG), + DEF_EXPR(CMDARG), + DEF_EXPR(MID), + DEF_EXPR(FNAME), + DEF_EXPR(DOT), + DEF_EXPR(CLASS), + DEF_EXPR(LABEL), + DEF_EXPR(LABELED), + DEF_EXPR(FITEM), + EXPR_VALUE = EXPR_BEG, + EXPR_BEG_ANY = (EXPR_BEG | EXPR_MID | EXPR_CLASS), + EXPR_ARG_ANY = (EXPR_ARG | EXPR_CMDARG), + EXPR_END_ANY = (EXPR_END | EXPR_ENDARG | EXPR_ENDFN), + EXPR_NONE = 0 +}; +#endif /* INTERNAL_RUBY_PARSE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/sanitizers.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/sanitizers.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/sanitizers.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/sanitizers.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/serial.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/serial.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/serial.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/serial.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/signal.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/signal.h similarity index 90% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/signal.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/signal.h index 86fb54e9..660cd95f 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/signal.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/signal.h @@ -13,6 +13,10 @@ extern int ruby_enable_coredump; int rb_get_next_signal(void); +#ifdef POSIX_SIGNAL +void (*ruby_posix_signal(int, void (*)(int)))(int); +#endif + RUBY_SYMBOL_EXPORT_BEGIN /* signal.c (export) */ int rb_grantpt(int fd); diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/static_assert.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/static_assert.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/static_assert.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/static_assert.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/string.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/string.h similarity index 93% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/string.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/string.h index 5f59d962..abb0a536 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/string.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/string.h @@ -119,6 +119,21 @@ is_broken_string(VALUE str) return rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN; } +static inline bool +at_char_boundary(const char *s, const char *p, const char *e, rb_encoding *enc) +{ + return rb_enc_left_char_head(s, p, e, enc) == p; +} + +static inline bool +at_char_right_boundary(const char *s, const char *p, const char *e, rb_encoding *enc) +{ + RUBY_ASSERT(s <= p); + RUBY_ASSERT(p <= e); + + return rb_enc_right_char_head(s, p, e, enc) == p; +} + /* expect tail call optimization */ // YJIT needs this function to never allocate and never raise static inline VALUE diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/struct.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/struct.h similarity index 78% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/struct.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/struct.h index 5b00e522..6da5bad1 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/struct.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/struct.h @@ -12,10 +12,9 @@ #include "ruby/ruby.h" /* for struct RBasic */ enum { - RSTRUCT_EMBED_LEN_MAX = RVALUE_EMBED_LEN_MAX, - RSTRUCT_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER1), + RSTRUCT_EMBED_LEN_MASK = RUBY_FL_USER7 | RUBY_FL_USER6 | RUBY_FL_USER5 | RUBY_FL_USER4 | + RUBY_FL_USER3 | RUBY_FL_USER2 | RUBY_FL_USER1, RSTRUCT_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+1), - RSTRUCT_TRANSIENT_FLAG = FL_USER3, }; struct RStruct { @@ -25,7 +24,12 @@ struct RStruct { long len; const VALUE *ptr; } heap; - const VALUE ary[RSTRUCT_EMBED_LEN_MAX]; + /* This is a length 1 array because: + * 1. GCC has a bug that does not optimize C flexible array members + * (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102452) + * 2. Zero length arrays are not supported by all compilers + */ + const VALUE ary[1]; } as; }; @@ -56,9 +60,6 @@ VALUE rb_struct_init_copy(VALUE copy, VALUE s); VALUE rb_struct_lookup(VALUE s, VALUE idx); VALUE rb_struct_s_keyword_init(VALUE klass); static inline const VALUE *rb_struct_const_heap_ptr(VALUE st); -static inline bool RSTRUCT_TRANSIENT_P(VALUE st); -static inline void RSTRUCT_TRANSIENT_SET(VALUE st); -static inline void RSTRUCT_TRANSIENT_UNSET(VALUE st); static inline long RSTRUCT_EMBED_LEN(VALUE st); static inline long RSTRUCT_LEN(VALUE st); static inline int RSTRUCT_LENINT(VALUE st); @@ -66,32 +67,6 @@ static inline const VALUE *RSTRUCT_CONST_PTR(VALUE st); static inline void RSTRUCT_SET(VALUE st, long k, VALUE v); static inline VALUE RSTRUCT_GET(VALUE st, long k); -static inline bool -RSTRUCT_TRANSIENT_P(VALUE st) -{ -#if USE_TRANSIENT_HEAP - return FL_TEST_RAW(st, RSTRUCT_TRANSIENT_FLAG); -#else - return false; -#endif -} - -static inline void -RSTRUCT_TRANSIENT_SET(VALUE st) -{ -#if USE_TRANSIENT_HEAP - FL_SET_RAW(st, RSTRUCT_TRANSIENT_FLAG); -#endif -} - -static inline void -RSTRUCT_TRANSIENT_UNSET(VALUE st) -{ -#if USE_TRANSIENT_HEAP - FL_UNSET_RAW(st, RSTRUCT_TRANSIENT_FLAG); -#endif -} - static inline long RSTRUCT_EMBED_LEN(VALUE st) { @@ -145,7 +120,7 @@ RSTRUCT_GET(VALUE st, long k) static inline const VALUE * rb_struct_const_heap_ptr(VALUE st) { - /* TODO: check embed on debug mode */ + assert(!FL_TEST_RAW(st, RSTRUCT_EMBED_LEN_MASK)); return RSTRUCT(st)->as.heap.ptr; } diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/symbol.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/symbol.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/symbol.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/symbol.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/thread.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/thread.h similarity index 83% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/thread.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/thread.h index 7bb4b77a..c41a16c1 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/thread.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/thread.h @@ -10,6 +10,7 @@ */ #include "ruby/ruby.h" /* for VALUE */ #include "ruby/intern.h" /* for rb_blocking_function_t */ +#include "ccan/list/list.h" /* for list in rb_io_close_wait_list */ struct rb_thread_struct; /* in vm_core.h */ @@ -29,6 +30,10 @@ struct rb_thread_struct; /* in vm_core.h */ #define COVERAGE_TARGET_ONESHOT_LINES 8 #define COVERAGE_TARGET_EVAL 16 +#define RUBY_FATAL_THREAD_KILLED INT2FIX(0) +#define RUBY_FATAL_THREAD_TERMINATED INT2FIX(1) +#define RUBY_FATAL_FIBER_KILLED RB_INT2FIX(2) + VALUE rb_obj_is_mutex(VALUE obj); VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg); void rb_thread_execute_interrupts(VALUE th); @@ -48,6 +53,14 @@ VALUE rb_exec_recursive_outer_mid(VALUE (*f)(VALUE g, VALUE h, int r), VALUE g, int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout); +struct rb_io_close_wait_list { + struct ccan_list_head pending_fd_users; + VALUE closing_thread; + VALUE wakeup_mutex; +}; +int rb_notify_fd_close(int fd, struct rb_io_close_wait_list *busy); +void rb_notify_fd_close_wait(struct rb_io_close_wait_list *busy); + RUBY_SYMBOL_EXPORT_BEGIN /* Temporary. This API will be removed (renamed). */ VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd); diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/time.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/time.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/time.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/time.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/transcode.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/transcode.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/transcode.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/transcode.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/util.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/util.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/util.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/util.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/variable.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/variable.h similarity index 78% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/variable.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/variable.h index 4436cd78..c467489b 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/variable.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/variable.h @@ -15,10 +15,6 @@ #include "ruby/ruby.h" /* for VALUE */ #include "shape.h" /* for rb_shape_t */ -/* global variable */ - -#define ROBJECT_TRANSIENT_FLAG FL_USER2 - /* variable.c */ void rb_gc_mark_global_tbl(void); void rb_gc_update_global_tbl(void); @@ -32,9 +28,22 @@ rb_gvar_getter_t *rb_gvar_getter_function_of(ID); rb_gvar_setter_t *rb_gvar_setter_function_of(ID); void rb_gvar_readonly_setter(VALUE v, ID id, VALUE *_); void rb_gvar_ractor_local(const char *name); -static inline bool ROBJ_TRANSIENT_P(VALUE obj); -static inline void ROBJ_TRANSIENT_SET(VALUE obj); -static inline void ROBJ_TRANSIENT_UNSET(VALUE obj); + +/** + * Sets the name of a module. + * + * Non-permanently named classes can have a temporary name assigned (or + * cleared). In that case the name will be used for `#inspect` and `#to_s`, and + * nested classes/modules will be named with the temporary name as a prefix. + * + * After the module is assigned to a constant, the temporary name will be + * discarded, and the name will be computed based on the nesting. + * + * @param[in] mod An instance of ::rb_cModule. + * @param[in] name An instance of ::rb_cString. + * @retval mod + */ +VALUE rb_mod_set_temporary_name(VALUE, VALUE); struct gen_ivtbl; int rb_gen_ivtbl_get(VALUE obj, ID id, struct gen_ivtbl **ivtbl); @@ -59,30 +68,4 @@ void rb_ensure_iv_list_size(VALUE obj, uint32_t len, uint32_t newsize); struct gen_ivtbl *rb_ensure_generic_iv_list_size(VALUE obj, rb_shape_t *shape, uint32_t newsize); attr_index_t rb_obj_ivar_set(VALUE obj, ID id, VALUE val); -static inline bool -ROBJ_TRANSIENT_P(VALUE obj) -{ -#if USE_TRANSIENT_HEAP - return FL_TEST_RAW(obj, ROBJECT_TRANSIENT_FLAG); -#else - return false; -#endif -} - -static inline void -ROBJ_TRANSIENT_SET(VALUE obj) -{ -#if USE_TRANSIENT_HEAP - FL_SET_RAW(obj, ROBJECT_TRANSIENT_FLAG); -#endif -} - -static inline void -ROBJ_TRANSIENT_UNSET(VALUE obj) -{ -#if USE_TRANSIENT_HEAP - FL_UNSET_RAW(obj, ROBJECT_TRANSIENT_FLAG); -#endif -} - #endif /* INTERNAL_VARIABLE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/vm.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/vm.h similarity index 98% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/vm.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/vm.h index 79430279..a89af3d9 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/vm.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/vm.h @@ -76,6 +76,11 @@ VALUE rb_lambda_call(VALUE obj, ID mid, int argc, const VALUE *argv, VALUE data2); void rb_check_stack_overflow(void); +#if USE_YJIT +/* vm_exec.c */ +extern uint64_t rb_vm_insns_count; +#endif + /* vm_insnhelper.c */ VALUE rb_equal_opt(VALUE obj1, VALUE obj2); VALUE rb_eql_opt(VALUE obj1, VALUE obj2); diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/warnings.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/warnings.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/internal/warnings.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/internal/warnings.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/iseq.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/iseq.h similarity index 98% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/iseq.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/iseq.h index b12228ee..1ad07e90 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/iseq.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/iseq.h @@ -83,9 +83,10 @@ ISEQ_ORIGINAL_ISEQ_ALLOC(const rb_iseq_t *iseq, long size) RUBY_EVENT_CALL | \ RUBY_EVENT_RETURN| \ RUBY_EVENT_C_CALL| \ - RUBY_EVENT_C_RETURN| \ - RUBY_EVENT_B_CALL| \ - RUBY_EVENT_B_RETURN| \ + RUBY_EVENT_C_RETURN | \ + RUBY_EVENT_B_CALL | \ + RUBY_EVENT_B_RETURN | \ + RUBY_EVENT_RESCUE | \ RUBY_EVENT_COVERAGE_LINE| \ RUBY_EVENT_COVERAGE_BRANCH) @@ -226,7 +227,6 @@ struct rb_compile_option_struct { unsigned int specialized_instruction: 1; unsigned int operands_unification: 1; unsigned int instructions_unification: 1; - unsigned int stack_caching: 1; unsigned int frozen_string_literal: 1; unsigned int debug_frozen_string_literal: 1; unsigned int coverage_enabled: 1; diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/known_errors.inc b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/known_errors.inc similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/known_errors.inc rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/known_errors.inc diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/method.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/method.h similarity index 99% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/method.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/method.h index d33ab505..6b60a49a 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/method.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/method.h @@ -249,6 +249,6 @@ void rb_scope_visibility_set(rb_method_visibility_t); VALUE rb_unnamed_parameters(int arity); void rb_clear_method_cache(VALUE klass_or_module, ID mid); -void rb_clear_method_cache_all(void); +void rb_clear_all_refinement_method_cache(void); #endif /* RUBY_METHOD_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/node.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/node.h new file mode 100644 index 00000000..1f365960 --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/node.h @@ -0,0 +1,125 @@ +#ifndef RUBY_NODE_H +#define RUBY_NODE_H 1 +/********************************************************************** + + node.h - + + $Author$ + created at: Fri May 28 15:14:02 JST 1993 + + Copyright (C) 1993-2007 Yukihiro Matsumoto + +**********************************************************************/ + +#include +#include "rubyparser.h" +#include "ruby/backward/2/attributes.h" + +typedef void (*bug_report_func)(const char *fmt, ...); + +typedef struct node_buffer_elem_struct { + struct node_buffer_elem_struct *next; + long len; + NODE buf[FLEX_ARY_LEN]; +} node_buffer_elem_t; + +typedef struct { + long idx, len; + node_buffer_elem_t *head; + node_buffer_elem_t *last; +} node_buffer_list_t; + +struct node_buffer_struct { + node_buffer_list_t unmarkable; + node_buffer_list_t markable; + struct rb_ast_local_table_link *local_tables; + VALUE mark_hash; + // - id (sequence number) + // - token_type + // - text of token + // - location info + // Array, whose entry is array + VALUE tokens; +#ifdef UNIVERSAL_PARSER + rb_parser_config_t *config; +#endif +}; + +RUBY_SYMBOL_EXPORT_BEGIN + +#ifdef UNIVERSAL_PARSER +rb_ast_t *rb_ast_new(rb_parser_config_t *config); +#else +rb_ast_t *rb_ast_new(); +#endif +size_t rb_ast_memsize(const rb_ast_t*); +void rb_ast_dispose(rb_ast_t*); +VALUE rb_ast_tokens(rb_ast_t *ast); +#if RUBY_DEBUG +void rb_ast_node_type_change(NODE *n, enum node_type type); +#endif +const char *ruby_node_name(int node); +void rb_node_init(NODE *n, enum node_type type, VALUE a0, VALUE a1, VALUE a2); + +void rb_ast_mark(rb_ast_t*); +void rb_ast_update_references(rb_ast_t*); +void rb_ast_free(rb_ast_t*); +void rb_ast_add_mark_object(rb_ast_t*, VALUE); +void rb_ast_set_tokens(rb_ast_t*, VALUE); +NODE *rb_ast_newnode(rb_ast_t*, enum node_type type); +void rb_ast_delete_node(rb_ast_t*, NODE *n); +rb_ast_id_table_t *rb_ast_new_local_table(rb_ast_t*, int); +rb_ast_id_table_t *rb_ast_resize_latest_local_table(rb_ast_t*, int); + +VALUE rb_parser_dump_tree(const NODE *node, int comment); + +const struct kwtable *rb_reserved_word(const char *, unsigned int); + +struct parser_params; +void *rb_parser_malloc(struct parser_params *, size_t); +void *rb_parser_realloc(struct parser_params *, void *, size_t); +void *rb_parser_calloc(struct parser_params *, size_t, size_t); +void rb_parser_free(struct parser_params *, void *); +PRINTF_ARGS(void rb_parser_printf(struct parser_params *parser, const char *fmt, ...), 2, 3); +VALUE rb_node_set_type(NODE *n, enum node_type t); + +RUBY_SYMBOL_EXPORT_END + +#define NODE_LSHIFT (NODE_TYPESHIFT+7) +#define NODE_LMASK (((SIGNED_VALUE)1<<(sizeof(VALUE)*CHAR_BIT-NODE_LSHIFT))-1) + +#define nd_line(n) (int)(((SIGNED_VALUE)(n)->flags)>>NODE_LSHIFT) +#define nd_set_line(n,l) \ + (n)->flags=(((n)->flags&~((VALUE)(-1)<nd_value == NODE_SPECIAL_REQUIRED_KEYWORD) +#define NODE_SPECIAL_NO_NAME_REST ((NODE *)-1) +#define NODE_NAMED_REST_P(node) ((node) != NODE_SPECIAL_NO_NAME_REST) +#define NODE_SPECIAL_EXCESSIVE_COMMA ((ID)1) +#define NODE_SPECIAL_NO_REST_KEYWORD ((NODE *)-1) + +#define nd_first_column(n) ((int)((n)->nd_loc.beg_pos.column)) +#define nd_set_first_column(n, v) ((n)->nd_loc.beg_pos.column = (v)) +#define nd_first_lineno(n) ((int)((n)->nd_loc.beg_pos.lineno)) +#define nd_set_first_lineno(n, v) ((n)->nd_loc.beg_pos.lineno = (v)) +#define nd_first_loc(n) ((n)->nd_loc.beg_pos) +#define nd_set_first_loc(n, v) (nd_first_loc(n) = (v)) + +#define nd_last_column(n) ((int)((n)->nd_loc.end_pos.column)) +#define nd_set_last_column(n, v) ((n)->nd_loc.end_pos.column = (v)) +#define nd_last_lineno(n) ((int)((n)->nd_loc.end_pos.lineno)) +#define nd_set_last_lineno(n, v) ((n)->nd_loc.end_pos.lineno = (v)) +#define nd_last_loc(n) ((n)->nd_loc.end_pos) +#define nd_set_last_loc(n, v) (nd_last_loc(n) = (v)) +#define nd_node_id(n) ((n)->node_id) +#define nd_set_node_id(n,id) ((n)->node_id = (id)) + +static inline bool +nd_type_p(const NODE *n, enum node_type t) +{ + return (enum node_type)nd_type(n) == t; +} + +#endif /* RUBY_NODE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/node_name.inc b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/node_name.inc similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/node_name.inc rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/node_name.inc diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/optinsn.inc b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/optinsn.inc similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/optinsn.inc rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/optinsn.inc diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/optunifs.inc b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/optunifs.inc similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/optunifs.inc rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/optunifs.inc diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/parse.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parse.h similarity index 98% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/parse.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/parse.h index 1ff9aa80..ea391833 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/parse.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parse.h @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 3.8.2. */ +/* A Bison parser, made by Lrama 0.5.6. */ /* Bison interface for Yacc-like parsers in C @@ -35,8 +35,8 @@ especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ -#ifndef YY_YY__Y_TAB_H_INCLUDED -# define YY_YY__Y_TAB_H_INCLUDED +#ifndef YY_YY_PARSE_H_INCLUDED +# define YY_YY_PARSE_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -190,6 +190,7 @@ extern int yydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { +#line 1507 "parse.y" VALUE val; NODE *node; @@ -200,6 +201,7 @@ union YYSTYPE struct rb_strterm_struct *strterm; struct lex_context ctxt; +#line 205 "parse.h" }; typedef union YYSTYPE YYSTYPE; @@ -227,4 +229,4 @@ struct YYLTYPE int yyparse (struct parser_params *p); -#endif /* !YY_YY__Y_TAB_H_INCLUDED */ +#endif /* !YY_YY_PARSE_H_INCLUDED */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_bits.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_bits.h new file mode 100644 index 00000000..ca753528 --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_bits.h @@ -0,0 +1,564 @@ +#ifndef INTERNAL_BITS2_H /*-*-C-*-vi:se ft=c:*/ +#define INTERNAL_BITS2_H +/** + * @author Ruby developers + * @copyright This file is a part of the programming language Ruby. + * Permission is hereby granted, to either redistribute and/or + * modify this file, provided that the conditions mentioned in the + * file COPYING are met. Consult the file for details. + * @brief Internal header for bitwise integer algorithms. + * @see Henry S. Warren Jr., "Hacker's Delight" (2nd ed.), 2013. + * @see SEI CERT C Coding Standard INT32-C. "Ensure that operations on + * signed integers do not result in overflow" + * @see https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html + * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateleft + * @see https://clang.llvm.org/docs/LanguageExtensions.html#builtin-rotateright + * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/byteswap-uint64-byteswap-ulong-byteswap-ushort + * @see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/rotl-rotl64-rotr-rotr64 + * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64 + * @see https://docs.microsoft.com/en-us/cpp/intrinsics/bitscanreverse-bitscanreverse64 + * @see https://docs.microsoft.com/en-us/cpp/intrinsics/lzcnt16-lzcnt-lzcnt64 + * @see https://docs.microsoft.com/en-us/cpp/intrinsics/popcnt16-popcnt-popcnt64 + * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_lzcnt_u32 + * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_tzcnt_u32 + * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotl64 + * @see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_rotr64 + * @see https://stackoverflow.com/a/776523 + */ +#include "ruby/internal/config.h" +#include /* for CHAR_BITS */ +#include /* for uintptr_t */ +#include "internal/compilers.h" /* for MSC_VERSION_SINCE */ + +#if MSC_VERSION_SINCE(1310) +# include /* for _byteswap_uint64 */ +#endif + +#if defined(HAVE_X86INTRIN_H) +# include /* for _lzcnt_u64 */ +#elif MSC_VERSION_SINCE(1310) +# include /* for the following intrinsics */ +#endif + +#if defined(_MSC_VER) && defined(__AVX__) +# pragma intrinsic(__popcnt) +# pragma intrinsic(__popcnt64) +#endif + +#if defined(_MSC_VER) && defined(__AVX2__) +# pragma intrinsic(__lzcnt) +# pragma intrinsic(__lzcnt64) +#endif + +#if MSC_VERSION_SINCE(1310) +# pragma intrinsic(_rotl) +# pragma intrinsic(_rotr) +# ifdef _WIN64 +# pragma intrinsic(_rotl64) +# pragma intrinsic(_rotr64) +# endif +#endif + +#if MSC_VERSION_SINCE(1400) +# pragma intrinsic(_BitScanForward) +# pragma intrinsic(_BitScanReverse) +# ifdef _WIN64 +# pragma intrinsic(_BitScanForward64) +# pragma intrinsic(_BitScanReverse64) +# endif +#endif + +#include "parser_value.h" /* for VALUE */ +#include "internal/static_assert.h" /* for STATIC_ASSERT */ + +/* The most significant bit of the lower part of half-long integer. + * If sizeof(long) == 4, this is 0x8000. + * If sizeof(long) == 8, this is 0x80000000. + */ +#define HALF_LONG_MSB ((SIGNED_VALUE)1<<((SIZEOF_LONG*CHAR_BIT-1)/2)) + +#define SIGNED_INTEGER_TYPE_P(T) (0 > ((T)0)-1) + +#define SIGNED_INTEGER_MIN(T) \ + ((sizeof(T) == sizeof(int8_t)) ? ((T)INT8_MIN) : \ + ((sizeof(T) == sizeof(int16_t)) ? ((T)INT16_MIN) : \ + ((sizeof(T) == sizeof(int32_t)) ? ((T)INT32_MIN) : \ + ((sizeof(T) == sizeof(int64_t)) ? ((T)INT64_MIN) : \ + 0)))) + +#define SIGNED_INTEGER_MAX(T) ((T)(SIGNED_INTEGER_MIN(T) ^ ((T)~(T)0))) + +#define UNSIGNED_INTEGER_MAX(T) ((T)~(T)0) + +#if __has_builtin(__builtin_mul_overflow_p) +# define MUL_OVERFLOW_P(a, b) \ + __builtin_mul_overflow_p((a), (b), (__typeof__(a * b))0) +#elif __has_builtin(__builtin_mul_overflow) +# define MUL_OVERFLOW_P(a, b) \ + __extension__ ({ __typeof__(a) c; __builtin_mul_overflow((a), (b), &c); }) +#endif + +#define MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, min, max) ( \ + (a) == 0 ? 0 : \ + (a) == -1 ? (b) < -(max) : \ + (a) > 0 ? \ + ((b) > 0 ? (max) / (a) < (b) : (min) / (a) > (b)) : \ + ((b) > 0 ? (min) / (a) < (b) : (max) / (a) > (b))) + +#if __has_builtin(__builtin_mul_overflow_p) +/* __builtin_mul_overflow_p can take bitfield */ +/* and GCC permits bitfields for integers other than int */ +# define MUL_OVERFLOW_FIXNUM_P(a, b) \ + __extension__ ({ \ + struct { long fixnum : sizeof(long) * CHAR_BIT - 1; } c = { 0 }; \ + __builtin_mul_overflow_p((a), (b), c.fixnum); \ + }) +#else +# define MUL_OVERFLOW_FIXNUM_P(a, b) \ + MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, FIXNUM_MIN, FIXNUM_MAX) +#endif + +#ifdef MUL_OVERFLOW_P +# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_P(a, b) +# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_P(a, b) +# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_P(a, b) +#else +# define MUL_OVERFLOW_LONG_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LLONG_MIN, LLONG_MAX) +# define MUL_OVERFLOW_LONG_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, LONG_MIN, LONG_MAX) +# define MUL_OVERFLOW_INT_P(a, b) MUL_OVERFLOW_SIGNED_INTEGER_P(a, b, INT_MIN, INT_MAX) +#endif + +#ifdef HAVE_UINT128_T +# define bit_length(x) \ + (unsigned int) \ + (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ + sizeof(x) <= sizeof(int64_t) ? 64 - nlz_int64((uint64_t)(x)) : \ + 128 - nlz_int128((uint128_t)(x))) +#else +# define bit_length(x) \ + (unsigned int) \ + (sizeof(x) <= sizeof(int32_t) ? 32 - nlz_int32((uint32_t)(x)) : \ + 64 - nlz_int64((uint64_t)(x))) +#endif + +#ifndef swap16 +# define swap16 ruby_swap16 +#endif + +#ifndef swap32 +# define swap32 ruby_swap32 +#endif + +#ifndef swap64 +# define swap64 ruby_swap64 +#endif + +static inline uint16_t ruby_swap16(uint16_t); +static inline uint32_t ruby_swap32(uint32_t); +static inline uint64_t ruby_swap64(uint64_t); +static inline unsigned nlz_int(unsigned x); +static inline unsigned nlz_long(unsigned long x); +static inline unsigned nlz_long_long(unsigned long long x); +static inline unsigned nlz_intptr(uintptr_t x); +static inline unsigned nlz_int32(uint32_t x); +static inline unsigned nlz_int64(uint64_t x); +#ifdef HAVE_UINT128_T +static inline unsigned nlz_int128(uint128_t x); +#endif +static inline unsigned rb_popcount32(uint32_t x); +static inline unsigned rb_popcount64(uint64_t x); +static inline unsigned rb_popcount_intptr(uintptr_t x); +static inline int ntz_int32(uint32_t x); +static inline int ntz_int64(uint64_t x); +static inline int ntz_intptr(uintptr_t x); +static inline VALUE RUBY_BIT_ROTL(VALUE, int); +static inline VALUE RUBY_BIT_ROTR(VALUE, int); + +static inline uint16_t +ruby_swap16(uint16_t x) +{ +#if __has_builtin(__builtin_bswap16) + return __builtin_bswap16(x); + +#elif MSC_VERSION_SINCE(1310) + return _byteswap_ushort(x); + +#else + return (x << 8) | (x >> 8); + +#endif +} + +static inline uint32_t +ruby_swap32(uint32_t x) +{ +#if __has_builtin(__builtin_bswap32) + return __builtin_bswap32(x); + +#elif MSC_VERSION_SINCE(1310) + return _byteswap_ulong(x); + +#else + x = ((x & 0x0000FFFF) << 16) | ((x & 0xFFFF0000) >> 16); + x = ((x & 0x00FF00FF) << 8) | ((x & 0xFF00FF00) >> 8); + return x; + +#endif +} + +static inline uint64_t +ruby_swap64(uint64_t x) +{ +#if __has_builtin(__builtin_bswap64) + return __builtin_bswap64(x); + +#elif MSC_VERSION_SINCE(1310) + return _byteswap_uint64(x); + +#else + x = ((x & 0x00000000FFFFFFFFULL) << 32) | ((x & 0xFFFFFFFF00000000ULL) >> 32); + x = ((x & 0x0000FFFF0000FFFFULL) << 16) | ((x & 0xFFFF0000FFFF0000ULL) >> 16); + x = ((x & 0x00FF00FF00FF00FFULL) << 8) | ((x & 0xFF00FF00FF00FF00ULL) >> 8); + return x; + +#endif +} + +static inline unsigned int +nlz_int32(uint32_t x) +{ +#if defined(_MSC_VER) && defined(__AVX2__) + /* Note: It seems there is no such thing like __LZCNT__ predefined in MSVC. + * AMD CPUs have had this instruction for decades (since K10) but for + * Intel, Haswell is the oldest one. We need to use __AVX2__ for maximum + * safety. */ + return (unsigned int)__lzcnt(x); + +#elif defined(__x86_64__) && defined(__LZCNT__) + return (unsigned int)_lzcnt_u32(x); + +#elif MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ + unsigned long r; + return _BitScanReverse(&r, x) ? (31 - (int)r) : 32; + +#elif __has_builtin(__builtin_clz) + STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); + return x ? (unsigned int)__builtin_clz(x) : 32; + +#else + uint32_t y; + unsigned n = 32; + y = x >> 16; if (y) {n -= 16; x = y;} + y = x >> 8; if (y) {n -= 8; x = y;} + y = x >> 4; if (y) {n -= 4; x = y;} + y = x >> 2; if (y) {n -= 2; x = y;} + y = x >> 1; if (y) {return n - 2;} + return (unsigned int)(n - x); +#endif +} + +static inline unsigned int +nlz_int64(uint64_t x) +{ +#if defined(_MSC_VER) && defined(__AVX2__) + return (unsigned int)__lzcnt64(x); + +#elif defined(__x86_64__) && defined(__LZCNT__) + return (unsigned int)_lzcnt_u64(x); + +#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) /* &&! defined(__AVX2__) */ + unsigned long r; + return _BitScanReverse64(&r, x) ? (63u - (unsigned int)r) : 64; + +#elif __has_builtin(__builtin_clzl) + if (x == 0) { + return 64; + } + else if (sizeof(long) * CHAR_BIT == 64) { + return (unsigned int)__builtin_clzl((unsigned long)x); + } + else if (sizeof(long long) * CHAR_BIT == 64) { + return (unsigned int)__builtin_clzll((unsigned long long)x); + } + else { + /* :FIXME: Is there a way to make this branch a compile-time error? */ + UNREACHABLE_RETURN(~0); + } + +#else + uint64_t y; + unsigned int n = 64; + y = x >> 32; if (y) {n -= 32; x = y;} + y = x >> 16; if (y) {n -= 16; x = y;} + y = x >> 8; if (y) {n -= 8; x = y;} + y = x >> 4; if (y) {n -= 4; x = y;} + y = x >> 2; if (y) {n -= 2; x = y;} + y = x >> 1; if (y) {return n - 2;} + return (unsigned int)(n - x); + +#endif +} + +#ifdef HAVE_UINT128_T +static inline unsigned int +nlz_int128(uint128_t x) +{ + uint64_t y = (uint64_t)(x >> 64); + + if (x == 0) { + return 128; + } + else if (y == 0) { + return (unsigned int)nlz_int64(x) + 64; + } + else { + return (unsigned int)nlz_int64(y); + } +} +#endif + +static inline unsigned int +nlz_int(unsigned int x) +{ + if (sizeof(unsigned int) * CHAR_BIT == 32) { + return nlz_int32((uint32_t)x); + } + else if (sizeof(unsigned int) * CHAR_BIT == 64) { + return nlz_int64((uint64_t)x); + } + else { + UNREACHABLE_RETURN(~0); + } +} + +static inline unsigned int +nlz_long(unsigned long x) +{ + if (sizeof(unsigned long) * CHAR_BIT == 32) { + return nlz_int32((uint32_t)x); + } + else if (sizeof(unsigned long) * CHAR_BIT == 64) { + return nlz_int64((uint64_t)x); + } + else { + UNREACHABLE_RETURN(~0); + } +} + +static inline unsigned int +nlz_long_long(unsigned long long x) +{ + if (sizeof(unsigned long long) * CHAR_BIT == 64) { + return nlz_int64((uint64_t)x); + } +#ifdef HAVE_UINT128_T + else if (sizeof(unsigned long long) * CHAR_BIT == 128) { + return nlz_int128((uint128_t)x); + } +#endif + else { + UNREACHABLE_RETURN(~0); + } +} + +static inline unsigned int +nlz_intptr(uintptr_t x) +{ + if (sizeof(uintptr_t) == sizeof(unsigned int)) { + return nlz_int((unsigned int)x); + } + if (sizeof(uintptr_t) == sizeof(unsigned long)) { + return nlz_long((unsigned long)x); + } + if (sizeof(uintptr_t) == sizeof(unsigned long long)) { + return nlz_long_long((unsigned long long)x); + } + else { + UNREACHABLE_RETURN(~0); + } +} + +static inline unsigned int +rb_popcount32(uint32_t x) +{ +#if defined(_MSC_VER) && defined(__AVX__) + /* Note: CPUs since Nehalem and Barcelona have had this instruction so SSE + * 4.2 should suffice, but it seems there is no such thing like __SSE_4_2__ + * predefined macro in MSVC. They do have __AVX__ so use it instead. */ + return (unsigned int)__popcnt(x); + +#elif __has_builtin(__builtin_popcount) + STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT >= 32); + return (unsigned int)__builtin_popcount(x); + +#else + x = (x & 0x55555555) + (x >> 1 & 0x55555555); + x = (x & 0x33333333) + (x >> 2 & 0x33333333); + x = (x & 0x0f0f0f0f) + (x >> 4 & 0x0f0f0f0f); + x = (x & 0x001f001f) + (x >> 8 & 0x001f001f); + x = (x & 0x0000003f) + (x >>16 & 0x0000003f); + return (unsigned int)x; + +#endif +} + +static inline unsigned int +rb_popcount64(uint64_t x) +{ +#if defined(_MSC_VER) && defined(__AVX__) + return (unsigned int)__popcnt64(x); + +#elif __has_builtin(__builtin_popcount) + if (sizeof(long) * CHAR_BIT == 64) { + return (unsigned int)__builtin_popcountl((unsigned long)x); + } + else if (sizeof(long long) * CHAR_BIT == 64) { + return (unsigned int)__builtin_popcountll((unsigned long long)x); + } + else { + /* :FIXME: Is there a way to make this branch a compile-time error? */ + UNREACHABLE_RETURN(~0); + } + +#else + x = (x & 0x5555555555555555) + (x >> 1 & 0x5555555555555555); + x = (x & 0x3333333333333333) + (x >> 2 & 0x3333333333333333); + x = (x & 0x0707070707070707) + (x >> 4 & 0x0707070707070707); + x = (x & 0x001f001f001f001f) + (x >> 8 & 0x001f001f001f001f); + x = (x & 0x0000003f0000003f) + (x >>16 & 0x0000003f0000003f); + x = (x & 0x000000000000007f) + (x >>32 & 0x000000000000007f); + return (unsigned int)x; + +#endif +} + +static inline unsigned int +rb_popcount_intptr(uintptr_t x) +{ + if (sizeof(uintptr_t) * CHAR_BIT == 64) { + return rb_popcount64((uint64_t)x); + } + else if (sizeof(uintptr_t) * CHAR_BIT == 32) { + return rb_popcount32((uint32_t)x); + } + else { + UNREACHABLE_RETURN(~0); + } +} + +static inline int +ntz_int32(uint32_t x) +{ +#if defined(__x86_64__) && defined(__BMI__) + return (unsigned)_tzcnt_u32(x); + +#elif MSC_VERSION_SINCE(1400) + /* :FIXME: Is there any way to issue TZCNT instead of BSF, apart from using + * assembly? Because issuing LZCNT seems possible (see nlz.h). */ + unsigned long r; + return _BitScanForward(&r, x) ? (int)r : 32; + +#elif __has_builtin(__builtin_ctz) + STATIC_ASSERT(sizeof_int, sizeof(int) * CHAR_BIT == 32); + return x ? (unsigned)__builtin_ctz(x) : 32; + +#else + return rb_popcount32((~x) & (x-1)); + +#endif +} + +static inline int +ntz_int64(uint64_t x) +{ +#if defined(__x86_64__) && defined(__BMI__) + return (unsigned)_tzcnt_u64(x); + +#elif defined(_WIN64) && MSC_VERSION_SINCE(1400) + unsigned long r; + return _BitScanForward64(&r, x) ? (int)r : 64; + +#elif __has_builtin(__builtin_ctzl) + if (x == 0) { + return 64; + } + else if (sizeof(long) * CHAR_BIT == 64) { + return (unsigned)__builtin_ctzl((unsigned long)x); + } + else if (sizeof(long long) * CHAR_BIT == 64) { + return (unsigned)__builtin_ctzll((unsigned long long)x); + } + else { + /* :FIXME: Is there a way to make this branch a compile-time error? */ + UNREACHABLE_RETURN(~0); + } + +#else + return rb_popcount64((~x) & (x-1)); + +#endif +} + +static inline int +ntz_intptr(uintptr_t x) +{ + if (sizeof(uintptr_t) * CHAR_BIT == 64) { + return ntz_int64((uint64_t)x); + } + else if (sizeof(uintptr_t) * CHAR_BIT == 32) { + return ntz_int32((uint32_t)x); + } + else { + UNREACHABLE_RETURN(~0); + } +} + +static inline VALUE +RUBY_BIT_ROTL(VALUE v, int n) +{ +#if __has_builtin(__builtin_rotateleft32) && (SIZEOF_VALUE * CHAR_BIT == 32) + return __builtin_rotateleft32(v, n); + +#elif __has_builtin(__builtin_rotateleft64) && (SIZEOF_VALUE * CHAR_BIT == 64) + return __builtin_rotateleft64(v, n); + +#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) + return _rotl(v, n); + +#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) + return _rotl64(v, n); + +#elif defined(_lrotl) && (SIZEOF_VALUE == SIZEOF_LONG) + return _lrotl(v, n); + +#else + const int m = (sizeof(VALUE) * CHAR_BIT) - 1; + return (v << (n & m)) | (v >> (-n & m)); +#endif +} + +static inline VALUE +RUBY_BIT_ROTR(VALUE v, int n) +{ +#if __has_builtin(__builtin_rotateright32) && (SIZEOF_VALUE * CHAR_BIT == 32) + return __builtin_rotateright32(v, n); + +#elif __has_builtin(__builtin_rotateright64) && (SIZEOF_VALUE * CHAR_BIT == 64) + return __builtin_rotateright64(v, n); + +#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 32) + return _rotr(v, n); + +#elif MSC_VERSION_SINCE(1310) && (SIZEOF_VALUE * CHAR_BIT == 64) + return _rotr64(v, n); + +#elif defined(_lrotr) && (SIZEOF_VALUE == SIZEOF_LONG) + return _lrotr(v, n); + +#else + const int m = (sizeof(VALUE) * CHAR_BIT) - 1; + return (v << (-n & m)) | (v >> (n & m)); +#endif +} + +#endif /* INTERNAL_BITS2_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_node.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_node.h new file mode 100644 index 00000000..886f9af7 --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_node.h @@ -0,0 +1,133 @@ +#ifndef RUBY_PARSER_NODE_H +#define RUBY_PARSER_NODE_H 1 +/* + * This is a header file used by only "parse.y" + */ +#include "rubyparser.h" +#include "internal/compilers.h" + +#if defined(__cplusplus) +extern "C" { +#if 0 +} /* satisfy cc-mode */ +#endif +#endif + +static inline rb_code_location_t +code_loc_gen(const rb_code_location_t *loc1, const rb_code_location_t *loc2) +{ + rb_code_location_t loc; + loc.beg_pos = loc1->beg_pos; + loc.end_pos = loc2->end_pos; + return loc; +} + +#define RNODE(obj) ((struct RNode *)(obj)) + + +#define NEW_NODE(t,a0,a1,a2,loc) rb_node_newnode((t),(VALUE)(a0),(VALUE)(a1),(VALUE)(a2),loc) +#define NEW_NODE_WITH_LOCALS(t,a1,a2,loc) node_newnode_with_locals(p, (t),(VALUE)(a1),(VALUE)(a2),loc) + +#define NEW_DEFN(i,a,d,loc) NEW_NODE(NODE_DEFN,0,i,NEW_SCOPE(a,d,loc),loc) +#define NEW_DEFS(r,i,a,d,loc) NEW_NODE(NODE_DEFS,r,i,NEW_SCOPE(a,d,loc),loc) +#define NEW_SCOPE(a,b,loc) NEW_NODE_WITH_LOCALS(NODE_SCOPE,b,a,loc) +#define NEW_BLOCK(a,loc) NEW_NODE(NODE_BLOCK,a,0,0,loc) +#define NEW_IF(c,t,e,loc) NEW_NODE(NODE_IF,c,t,e,loc) +#define NEW_UNLESS(c,t,e,loc) NEW_NODE(NODE_UNLESS,c,t,e,loc) +#define NEW_CASE(h,b,loc) NEW_NODE(NODE_CASE,h,b,0,loc) +#define NEW_CASE2(b,loc) NEW_NODE(NODE_CASE2,0,b,0,loc) +#define NEW_CASE3(h,b,loc) NEW_NODE(NODE_CASE3,h,b,0,loc) +#define NEW_WHEN(c,t,e,loc) NEW_NODE(NODE_WHEN,c,t,e,loc) +#define NEW_IN(c,t,e,loc) NEW_NODE(NODE_IN,c,t,e,loc) +#define NEW_WHILE(c,b,n,loc) NEW_NODE(NODE_WHILE,c,b,n,loc) +#define NEW_UNTIL(c,b,n,loc) NEW_NODE(NODE_UNTIL,c,b,n,loc) +#define NEW_FOR(i,b,loc) NEW_NODE(NODE_FOR,0,b,i,loc) +#define NEW_FOR_MASGN(v,loc) NEW_NODE(NODE_FOR_MASGN,v,0,0,loc) +#define NEW_ITER(a,b,loc) NEW_NODE(NODE_ITER,0,NEW_SCOPE(a,b,loc),0,loc) +#define NEW_LAMBDA(a,b,loc) NEW_NODE(NODE_LAMBDA,0,NEW_SCOPE(a,b,loc),0,loc) +#define NEW_BREAK(s,loc) NEW_NODE(NODE_BREAK,s,0,0,loc) +#define NEW_NEXT(s,loc) NEW_NODE(NODE_NEXT,s,0,0,loc) +#define NEW_REDO(loc) NEW_NODE(NODE_REDO,0,0,0,loc) +#define NEW_RETRY(loc) NEW_NODE(NODE_RETRY,0,0,0,loc) +#define NEW_BEGIN(b,loc) NEW_NODE(NODE_BEGIN,0,b,0,loc) +#define NEW_RESCUE(b,res,e,loc) NEW_NODE(NODE_RESCUE,b,res,e,loc) +#define NEW_RESBODY(a,ex,n,loc) NEW_NODE(NODE_RESBODY,n,ex,a,loc) +#define NEW_ENSURE(b,en,loc) NEW_NODE(NODE_ENSURE,b,0,en,loc) +#define NEW_RETURN(s,loc) NEW_NODE(NODE_RETURN,s,0,0,loc) +#define NEW_YIELD(a,loc) NEW_NODE(NODE_YIELD,a,0,0,loc) +#define NEW_LIST(a,loc) NEW_NODE(NODE_LIST,a,1,0,loc) +#define NEW_ZLIST(loc) NEW_NODE(NODE_ZLIST,0,0,0,loc) +#define NEW_HASH(a,loc) NEW_NODE(NODE_HASH,a,0,0,loc) +#define NEW_MASGN(l,r,loc) NEW_NODE(NODE_MASGN,l,0,r,loc) +#define NEW_GASGN(v,val,loc) NEW_NODE(NODE_GASGN,v,val,0,loc) +#define NEW_LASGN(v,val,loc) NEW_NODE(NODE_LASGN,v,val,0,loc) +#define NEW_DASGN(v,val,loc) NEW_NODE(NODE_DASGN,v,val,0,loc) +#define NEW_IASGN(v,val,loc) NEW_NODE(NODE_IASGN,v,val,0,loc) +#define NEW_CDECL(v,val,path,loc) NEW_NODE(NODE_CDECL,v,val,path,loc) +#define NEW_CVASGN(v,val,loc) NEW_NODE(NODE_CVASGN,v,val,0,loc) +#define NEW_OP_ASGN1(p,id,a,loc) NEW_NODE(NODE_OP_ASGN1,p,id,a,loc) +#define NEW_OP_ASGN2(r,t,i,o,val,loc) NEW_NODE(NODE_OP_ASGN2,r,val,NEW_OP_ASGN22(i,o,t,loc),loc) +#define NEW_OP_ASGN22(i,o,t,loc) NEW_NODE(NODE_OP_ASGN2,i,o,t,loc) +#define NEW_OP_ASGN_OR(i,val,loc) NEW_NODE(NODE_OP_ASGN_OR,i,val,0,loc) +#define NEW_OP_ASGN_AND(i,val,loc) NEW_NODE(NODE_OP_ASGN_AND,i,val,0,loc) +#define NEW_OP_CDECL(v,op,val,loc) NEW_NODE(NODE_OP_CDECL,v,val,op,loc) +#define NEW_GVAR(v,loc) NEW_NODE(NODE_GVAR,v,0,0,loc) +#define NEW_LVAR(v,loc) NEW_NODE(NODE_LVAR,v,0,0,loc) +#define NEW_DVAR(v,loc) NEW_NODE(NODE_DVAR,v,0,0,loc) +#define NEW_IVAR(v,loc) NEW_NODE(NODE_IVAR,v,0,0,loc) +#define NEW_CONST(v,loc) NEW_NODE(NODE_CONST,v,0,0,loc) +#define NEW_CVAR(v,loc) NEW_NODE(NODE_CVAR,v,0,0,loc) +#define NEW_NTH_REF(n,loc) NEW_NODE(NODE_NTH_REF,0,n,0,loc) +#define NEW_BACK_REF(n,loc) NEW_NODE(NODE_BACK_REF,0,n,0,loc) +#define NEW_MATCH(c,loc) NEW_NODE(NODE_MATCH,c,0,0,loc) +#define NEW_MATCH2(n1,n2,loc) NEW_NODE(NODE_MATCH2,n1,n2,0,loc) +#define NEW_MATCH3(r,n2,loc) NEW_NODE(NODE_MATCH3,r,n2,0,loc) +#define NEW_LIT(l,loc) NEW_NODE(NODE_LIT,l,0,0,loc) +#define NEW_STR(s,loc) NEW_NODE(NODE_STR,s,0,0,loc) +#define NEW_DSTR(s,loc) NEW_NODE(NODE_DSTR,s,1,0,loc) +#define NEW_XSTR(s,loc) NEW_NODE(NODE_XSTR,s,0,0,loc) +#define NEW_DXSTR(s,loc) NEW_NODE(NODE_DXSTR,s,0,0,loc) +#define NEW_DSYM(s,loc) NEW_NODE(NODE_DSYM,s,0,0,loc) +#define NEW_EVSTR(n,loc) NEW_NODE(NODE_EVSTR,0,(n),0,loc) +#define NEW_CALL(r,m,a,loc) NEW_NODE(NODE_CALL,r,m,a,loc) +#define NEW_OPCALL(r,m,a,loc) NEW_NODE(NODE_OPCALL,r,m,a,loc) +#define NEW_FCALL(m,a,loc) NEW_NODE(NODE_FCALL,0,m,a,loc) +#define NEW_VCALL(m,loc) NEW_NODE(NODE_VCALL,0,m,0,loc) +#define NEW_SUPER(a,loc) NEW_NODE(NODE_SUPER,0,0,a,loc) +#define NEW_ZSUPER(loc) NEW_NODE(NODE_ZSUPER,0,0,0,loc) +#define NEW_ARGS_AUX(r,b,loc) NEW_NODE(NODE_ARGS_AUX,r,b,0,loc) +#define NEW_OPT_ARG(i,v,loc) NEW_NODE(NODE_OPT_ARG,i,v,0,loc) +#define NEW_KW_ARG(v,loc) NEW_NODE(NODE_KW_ARG,0,v,0,loc) +#define NEW_POSTARG(i,v,loc) NEW_NODE(NODE_POSTARG,i,v,0,loc) +#define NEW_ARGSCAT(a,b,loc) NEW_NODE(NODE_ARGSCAT,a,b,0,loc) +#define NEW_ARGSPUSH(a,b,loc) NEW_NODE(NODE_ARGSPUSH,a,b,0,loc) +#define NEW_SPLAT(a,loc) NEW_NODE(NODE_SPLAT,a,0,0,loc) +#define NEW_BLOCK_PASS(b,loc) NEW_NODE(NODE_BLOCK_PASS,0,b,0,loc) +#define NEW_ALIAS(n,o,loc) NEW_NODE(NODE_ALIAS,n,o,0,loc) +#define NEW_VALIAS(n,o,loc) NEW_NODE(NODE_VALIAS,n,o,0,loc) +#define NEW_UNDEF(i,loc) NEW_NODE(NODE_UNDEF,0,i,0,loc) +#define NEW_CLASS(n,b,s,loc) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(0,b,loc),(s),loc) +#define NEW_SCLASS(r,b,loc) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(0,b,loc),0,loc) +#define NEW_MODULE(n,b,loc) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(0,b,loc),0,loc) +#define NEW_COLON2(c,i,loc) NEW_NODE(NODE_COLON2,c,i,0,loc) +#define NEW_COLON3(i,loc) NEW_NODE(NODE_COLON3,0,i,0,loc) +#define NEW_DOT2(b,e,loc) NEW_NODE(NODE_DOT2,b,e,0,loc) +#define NEW_DOT3(b,e,loc) NEW_NODE(NODE_DOT3,b,e,0,loc) +#define NEW_SELF(loc) NEW_NODE(NODE_SELF,0,0,1,loc) +#define NEW_NIL(loc) NEW_NODE(NODE_NIL,0,0,0,loc) +#define NEW_TRUE(loc) NEW_NODE(NODE_TRUE,0,0,0,loc) +#define NEW_FALSE(loc) NEW_NODE(NODE_FALSE,0,0,0,loc) +#define NEW_ERRINFO(loc) NEW_NODE(NODE_ERRINFO,0,0,0,loc) +#define NEW_DEFINED(e,loc) NEW_NODE(NODE_DEFINED,e,0,0,loc) +#define NEW_POSTEXE(b,loc) NEW_NODE(NODE_POSTEXE,0,b,0,loc) +#define NEW_ATTRASGN(r,m,a,loc) NEW_NODE(NODE_ATTRASGN,r,m,a,loc) +#define NEW_ERROR(loc) NEW_NODE(NODE_ERROR,0,0,0,loc) + +#if defined(__cplusplus) +#if 0 +{ /* satisfy cc-mode */ +#endif +} /* extern "C" { */ +#endif + +#endif /* RUBY_PARSER_NODE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_st.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_st.h new file mode 100644 index 00000000..877b1e90 --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_st.h @@ -0,0 +1,162 @@ +/* This is a public domain general purpose hash table package + originally written by Peter Moore @ UCB. + + The hash table data structures were redesigned and the package was + rewritten by Vladimir Makarov . */ + +#ifndef RUBY_ST2_H +#define RUBY_ST2_H 1 + +#if defined(__cplusplus) +extern "C" { +#if 0 +} /* satisfy cc-mode */ +#endif +#endif + +#include +#include +#include "ruby/config.h" +#include "ruby/backward/2/long_long.h" +#include "ruby/defines.h" + +RUBY_SYMBOL_EXPORT_BEGIN + +#if SIZEOF_LONG == SIZEOF_VOIDP +typedef unsigned long parser_st_data_t; +#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP +typedef unsigned LONG_LONG parser_st_data_t; +#else +# error ---->> parser_st.c requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<---- +#endif +#define ST2_DATA_T_DEFINED + +#ifndef CHAR_BIT +# ifdef HAVE_LIMITS_H +# include +# else +# define CHAR_BIT 8 +# endif +#endif +#ifndef _ +# define _(args) args +#endif +#ifndef ANYARGS +# ifdef __cplusplus +# define ANYARGS ... +# else +# define ANYARGS +# endif +#endif + +typedef struct parser_st_table parser_st_table; + +typedef parser_st_data_t parser_st_index_t; + +/* Maximal value of unsigned integer type parser_st_index_t. */ +#define MAX_ST2_INDEX_VAL (~(parser_st_index_t) 0) + +typedef int parser_st_compare_func(parser_st_data_t, parser_st_data_t); +typedef parser_st_index_t parser_st_hash_func(parser_st_data_t); + +typedef char st_check_for_sizeof_parser_st_index_t[SIZEOF_VOIDP == (int)sizeof(parser_st_index_t) ? 1 : -1]; +#define SIZEOF_ST_INDEX_T SIZEOF_VOIDP + +struct parser_st_hash_type { + int (*compare)(parser_st_data_t, parser_st_data_t); /* parser_st_compare_func* */ + parser_st_index_t (*hash)(parser_st_data_t); /* parser_st_hash_func* */ +}; + +#define ST_INDEX_BITS (SIZEOF_ST_INDEX_T * CHAR_BIT) + +#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR) && defined(HAVE_BUILTIN___BUILTIN_TYPES_COMPATIBLE_P) +# define ST2_DATA_COMPATIBLE_P(type) \ + __builtin_choose_expr(__builtin_types_compatible_p(type, parser_st_data_t), 1, 0) +#else +# define ST2_DATA_COMPATIBLE_P(type) 0 +#endif + +typedef struct parser_st_table_entry parser_st_table_entry; + +struct parser_st_table_entry; /* defined in parser_st.c */ + +struct parser_st_table { + /* Cached features of the table -- see st.c for more details. */ + unsigned char entry_power, bin_power, size_ind; + /* How many times the table was rebuilt. */ + unsigned int rebuilds_num; + const struct parser_st_hash_type *type; + /* Number of entries currently in the table. */ + parser_st_index_t num_entries; + /* Array of bins used for access by keys. */ + parser_st_index_t *bins; + /* Start and bound index of entries in array entries. + entries_starts and entries_bound are in interval + [0,allocated_entries]. */ + parser_st_index_t entries_start, entries_bound; + /* Array of size 2^entry_power. */ + parser_st_table_entry *entries; +}; + +#define parser_st_is_member(table,key) rb_parser_st_lookup((table),(key),(parser_st_data_t *)0) + +enum parser_st_retval {ST2_CONTINUE, ST2_STOP, ST2_DELETE, ST2_CHECK, ST2_REPLACE}; + +size_t rb_parser_st_table_size(const struct parser_st_table *tbl); +parser_st_table *rb_parser_st_init_table(const struct parser_st_hash_type *); +parser_st_table *rb_parser_st_init_table_with_size(const struct parser_st_hash_type *, parser_st_index_t); +parser_st_table *rb_parser_st_init_existing_table_with_size(parser_st_table *, const struct parser_st_hash_type *, parser_st_index_t); +parser_st_table *rb_parser_st_init_numtable(void); +parser_st_table *rb_parser_st_init_numtable_with_size(parser_st_index_t); +parser_st_table *rb_parser_st_init_strtable(void); +parser_st_table *rb_parser_st_init_strtable_with_size(parser_st_index_t); +parser_st_table *rb_parser_st_init_strcasetable(void); +parser_st_table *rb_parser_st_init_strcasetable_with_size(parser_st_index_t); +int rb_parser_st_delete(parser_st_table *, parser_st_data_t *, parser_st_data_t *); /* returns 0:notfound 1:deleted */ +int rb_parser_st_delete_safe(parser_st_table *, parser_st_data_t *, parser_st_data_t *, parser_st_data_t); +int rb_parser_st_shift(parser_st_table *, parser_st_data_t *, parser_st_data_t *); /* returns 0:notfound 1:deleted */ +int rb_parser_st_insert(parser_st_table *, parser_st_data_t, parser_st_data_t); +int rb_parser_st_insert2(parser_st_table *, parser_st_data_t, parser_st_data_t, parser_st_data_t (*)(parser_st_data_t)); +int rb_parser_st_lookup(parser_st_table *, parser_st_data_t, parser_st_data_t *); +int rb_parser_st_get_key(parser_st_table *, parser_st_data_t, parser_st_data_t *); +typedef int parser_st_update_callback_func(parser_st_data_t *key, parser_st_data_t *value, parser_st_data_t arg, int existing); +/* *key may be altered, but must equal to the old key, i.e., the + * results of hash() are same and compare() returns 0, otherwise the + * behavior is undefined */ +int rb_parser_st_update(parser_st_table *table, parser_st_data_t key, parser_st_update_callback_func *func, parser_st_data_t arg); +typedef int parser_st_foreach_callback_func(parser_st_data_t, parser_st_data_t, parser_st_data_t); +typedef int parser_st_foreach_check_callback_func(parser_st_data_t, parser_st_data_t, parser_st_data_t, int); +int rb_parser_st_foreach_with_replace(parser_st_table *tab, parser_st_foreach_check_callback_func *func, parser_st_update_callback_func *replace, parser_st_data_t arg); +int rb_parser_st_foreach(parser_st_table *, parser_st_foreach_callback_func *, parser_st_data_t); +int rb_parser_st_foreach_check(parser_st_table *, parser_st_foreach_check_callback_func *, parser_st_data_t, parser_st_data_t); +parser_st_index_t rb_parser_st_keys(parser_st_table *table, parser_st_data_t *keys, parser_st_index_t size); +parser_st_index_t rb_parser_st_keys_check(parser_st_table *table, parser_st_data_t *keys, parser_st_index_t size, parser_st_data_t never); +parser_st_index_t rb_parser_st_values(parser_st_table *table, parser_st_data_t *values, parser_st_index_t size); +parser_st_index_t rb_parser_st_values_check(parser_st_table *table, parser_st_data_t *values, parser_st_index_t size, parser_st_data_t never); +void rb_parser_st_add_direct(parser_st_table *, parser_st_data_t, parser_st_data_t); +void rb_parser_st_free_table(parser_st_table *); +void rb_parser_st_cleanup_safe(parser_st_table *, parser_st_data_t); +void rb_parser_st_clear(parser_st_table *); +parser_st_table *rb_parser_st_replace(parser_st_table *, parser_st_table *); +parser_st_table *rb_parser_st_copy(parser_st_table *); +CONSTFUNC(int rb_parser_st_numcmp(parser_st_data_t, parser_st_data_t)); +CONSTFUNC(parser_st_index_t rb_parser_st_numhash(parser_st_data_t)); +PUREFUNC(int rb_parser_st_locale_insensitive_strcasecmp(const char *s1, const char *s2)); +PUREFUNC(int rb_parser_st_locale_insensitive_strncasecmp(const char *s1, const char *s2, size_t n)); +PUREFUNC(size_t rb_parser_st_memsize(const parser_st_table *)); +PUREFUNC(parser_st_index_t rb_parser_st_hash(const void *ptr, size_t len, parser_st_index_t h)); +CONSTFUNC(parser_st_index_t rb_parser_st_hash_uint32(parser_st_index_t h, uint32_t i)); +CONSTFUNC(parser_st_index_t rb_parser_st_hash_uint(parser_st_index_t h, parser_st_index_t i)); +CONSTFUNC(parser_st_index_t rb_parser_st_hash_end(parser_st_index_t h)); +CONSTFUNC(parser_st_index_t rb_parser_st_hash_start(parser_st_index_t h)); + +RUBY_SYMBOL_EXPORT_END + +#if defined(__cplusplus) +#if 0 +{ /* satisfy cc-mode */ +#endif +} /* extern "C" { */ +#endif + +#endif /* RUBY_ST2_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_value.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_value.h new file mode 100644 index 00000000..4fe444e8 --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/parser_value.h @@ -0,0 +1,106 @@ +#ifndef EXTERNAL_VALUE_H +#define EXTERNAL_VALUE_H + +#include "ruby/config.h" + +#if defined(__DOXYGEN__) + +/** + * Type that represents a Ruby object. It is an unsigned integer of some kind, + * depending on platforms. + * + * ```CXX + * VALUE value = rb_eval_string("ARGF.readlines.map.with_index"); + * ``` + * + * @warning ::VALUE is not a pointer. + * @warning ::VALUE can be wider than `long`. + */ +typedef uintptr_t VALUE; + +/** + * Type that represents a Ruby identifier such as a variable name. + * + * ```CXX + * ID method = rb_intern("method"); + * VALUE result = rb_funcall(obj, method, 0); + * ``` + * + * @note ::rb_cSymbol is a Ruby-level data type for the same thing. + */ +typedef uintptr_t ID; + +/** + * A signed integer type that has the same width with ::VALUE. + * + * @internal + * + * @shyouhei wonders: is it guaranteed that `uintptr_t` and `intptr_t` are the + * same width? As far as I read ISO/IEC 9899:2018 section 7.20.1.4 paragraph 1 + * no such description is given... or defined elsewhere? + */ +typedef intptr_t SIGNED_VALUE; + +/** + * Identical to `sizeof(VALUE)`, except it is a macro that can also be used + * inside of preprocessor directives such as `#if`. Handy on occasions. + */ +#define SIZEOF_VALUE SIZEOF_UINTPTR_T + +/** + * @private + * + * A compile-time constant of type ::VALUE whose value is 0. + */ +#define RBIMPL_VALUE_NULL UINTPTR_C(0) + +/** + * @private + * + * A compile-time constant of type ::VALUE whose value is 1. + */ +#define RBIMPL_VALUE_ONE UINTPTR_C(1) + +/** + * @private + * + * Maximum possible value that a ::VALUE can take. + */ +#define RBIMPL_VALUE_FULL UINTPTR_MAX + +#elif defined HAVE_UINTPTR_T && 0 +typedef uintptr_t VALUE; +typedef uintptr_t ID; +# define SIGNED_VALUE intptr_t +# define SIZEOF_VALUE SIZEOF_UINTPTR_T +# undef PRI_VALUE_PREFIX +# define RBIMPL_VALUE_NULL UINTPTR_C(0) +# define RBIMPL_VALUE_ONE UINTPTR_C(1) +# define RBIMPL_VALUE_FULL UINTPTR_MAX + +#elif SIZEOF_LONG == SIZEOF_VOIDP +typedef unsigned long VALUE; +typedef unsigned long ID; +# define SIGNED_VALUE long +# define SIZEOF_VALUE SIZEOF_LONG +# define PRI_VALUE_PREFIX "l" +# define RBIMPL_VALUE_NULL 0UL +# define RBIMPL_VALUE_ONE 1UL +# define RBIMPL_VALUE_FULL ULONG_MAX + +#elif SIZEOF_LONG_LONG == SIZEOF_VOIDP +typedef unsigned LONG_LONG VALUE; +typedef unsigned LONG_LONG ID; +# define SIGNED_VALUE LONG_LONG +# define LONG_LONG_VALUE 1 +# define SIZEOF_VALUE SIZEOF_LONG_LONG +# define PRI_VALUE_PREFIX PRI_LL_PREFIX +# define RBIMPL_VALUE_NULL 0ULL +# define RBIMPL_VALUE_ONE 1ULL +# define RBIMPL_VALUE_FULL ULLONG_MAX + +#else +# error ---->> ruby requires sizeof(void*) == sizeof(long) or sizeof(LONG_LONG) to be compiled. <<---- +#endif + +#endif /* EXTERNAL_VALUE_H */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/probes_helper.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/probes_helper.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/probes_helper.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/probes_helper.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ractor_core.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/ractor_core.h similarity index 99% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/ractor_core.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/ractor_core.h index 1fd8da0d..38aded15 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ractor_core.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/ractor_core.h @@ -310,11 +310,11 @@ static inline void rb_ractor_set_current_ec_(rb_ractor_t *cr, rb_execution_context_t *ec, const char *file, int line) { #ifdef RB_THREAD_LOCAL_SPECIFIER - #ifdef __APPLE__ +# ifdef __APPLE__ rb_current_ec_set(ec); - #else +# else ruby_current_ec = ec; - #endif +# endif #else native_tls_set(ruby_current_ec_key, ec); #endif diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/regenc.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/regenc.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/regenc.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/regenc.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/regint.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/regint.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/regint.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/regint.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/regparse.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/regparse.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/regparse.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/regparse.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/revision.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/revision.h new file mode 100644 index 00000000..b7955659 --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/revision.h @@ -0,0 +1,5 @@ +#define RUBY_REVISION "e50fcca9a7" +#define RUBY_FULL_REVISION "e50fcca9a79d8e25b33ad3611df6bf4627faafbf" +#define RUBY_RELEASE_YEAR 2023 +#define RUBY_RELEASE_MONTH 9 +#define RUBY_RELEASE_DAY 14 diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/rjit.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/rjit.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/rjit.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/rjit.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/rjit_c.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/rjit_c.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/rjit_c.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/rjit_c.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ruby_assert.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/ruby_assert.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/ruby_assert.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/ruby_assert.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/ruby_atomic.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/ruby_atomic.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/ruby_atomic.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/ruby_atomic.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview2/rubyparser.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/rubyparser.h new file mode 100644 index 00000000..e95b71f0 --- /dev/null +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/rubyparser.h @@ -0,0 +1,628 @@ +#ifndef RUBY_RUBYPARSER_H +#define RUBY_RUBYPARSER_H 1 +/* + * This is a header file for librubyparser interface + */ + +#include /* for va_list */ + +#ifdef UNIVERSAL_PARSER + +#define rb_encoding void +#define OnigCodePoint unsigned int +#include "parser_st.h" +#ifndef RUBY_RUBY_H +#include "parser_value.h" +#endif + +#else + +#include "ruby/encoding.h" + +#endif + +/* + * AST Node + */ +enum node_type { + NODE_SCOPE, + NODE_BLOCK, + NODE_IF, + NODE_UNLESS, + NODE_CASE, + NODE_CASE2, + NODE_CASE3, + NODE_WHEN, + NODE_IN, + NODE_WHILE, + NODE_UNTIL, + NODE_ITER, + NODE_FOR, + NODE_FOR_MASGN, + NODE_BREAK, + NODE_NEXT, + NODE_REDO, + NODE_RETRY, + NODE_BEGIN, + NODE_RESCUE, + NODE_RESBODY, + NODE_ENSURE, + NODE_AND, + NODE_OR, + NODE_MASGN, + NODE_LASGN, + NODE_DASGN, + NODE_GASGN, + NODE_IASGN, + NODE_CDECL, + NODE_CVASGN, + NODE_OP_ASGN1, + NODE_OP_ASGN2, + NODE_OP_ASGN_AND, + NODE_OP_ASGN_OR, + NODE_OP_CDECL, + NODE_CALL, + NODE_OPCALL, + NODE_FCALL, + NODE_VCALL, + NODE_QCALL, + NODE_SUPER, + NODE_ZSUPER, + NODE_LIST, + NODE_ZLIST, + NODE_VALUES, + NODE_HASH, + NODE_RETURN, + NODE_YIELD, + NODE_LVAR, + NODE_DVAR, + NODE_GVAR, + NODE_IVAR, + NODE_CONST, + NODE_CVAR, + NODE_NTH_REF, + NODE_BACK_REF, + NODE_MATCH, + NODE_MATCH2, + NODE_MATCH3, + NODE_LIT, + NODE_STR, + NODE_DSTR, + NODE_XSTR, + NODE_DXSTR, + NODE_EVSTR, + NODE_DREGX, + NODE_ONCE, + NODE_ARGS, + NODE_ARGS_AUX, + NODE_OPT_ARG, + NODE_KW_ARG, + NODE_POSTARG, + NODE_ARGSCAT, + NODE_ARGSPUSH, + NODE_SPLAT, + NODE_BLOCK_PASS, + NODE_DEFN, + NODE_DEFS, + NODE_ALIAS, + NODE_VALIAS, + NODE_UNDEF, + NODE_CLASS, + NODE_MODULE, + NODE_SCLASS, + NODE_COLON2, + NODE_COLON3, + NODE_DOT2, + NODE_DOT3, + NODE_FLIP2, + NODE_FLIP3, + NODE_SELF, + NODE_NIL, + NODE_TRUE, + NODE_FALSE, + NODE_ERRINFO, + NODE_DEFINED, + NODE_POSTEXE, + NODE_DSYM, + NODE_ATTRASGN, + NODE_LAMBDA, + NODE_ARYPTN, + NODE_HSHPTN, + NODE_FNDPTN, + NODE_ERROR, + NODE_LAST +}; + + +#define nd_head u1.node +#define nd_alen u2.argc +#define nd_next u3.node + +#define nd_cond u1.node +#define nd_body u2.node +#define nd_else u3.node + +#define nd_resq u2.node +#define nd_ensr u3.node + +#define nd_1st u1.node +#define nd_2nd u2.node + +#define nd_stts u1.node + +#define nd_vid u1.id + +#define nd_var u1.node +#define nd_iter u3.node + +#define nd_value u2.node +#define nd_aid u3.id + +#define nd_lit u1.value + +#define nd_recv u1.node +#define nd_mid u2.id +#define nd_args u3.node +#define nd_ainfo u3.args + +#define nd_defn u3.node + +#define nd_cpath u1.node +#define nd_super u3.node + +#define nd_beg u1.node +#define nd_end u2.node +#define nd_state u3.state + +#define nd_nth u2.argc + +#define nd_alias u1.id +#define nd_orig u2.id +#define nd_undef u2.node + +#define nd_brace u2.argc + +#define nd_pconst u1.node +#define nd_pkwargs u2.node +#define nd_pkwrestarg u3.node + +#define nd_apinfo u3.apinfo + +#define nd_fpinfo u3.fpinfo + +// for NODE_SCOPE +#define nd_tbl u1.tbl + +// for NODE_ARGS_AUX +#define nd_pid u1.id +#define nd_plen u2.argc +#define nd_cflag u2.id + +// for ripper +#define nd_cval u3.value +#define nd_rval u2.value +#define nd_tag u1.id + +#ifndef FLEX_ARY_LEN +/* From internal/compilers.h */ +/* A macro for defining a flexible array, like: VALUE ary[FLEX_ARY_LEN]; */ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define FLEX_ARY_LEN /* VALUE ary[]; */ +#elif defined(__GNUC__) && !defined(__STRICT_ANSI__) +# define FLEX_ARY_LEN 0 /* VALUE ary[0]; */ +#else +# define FLEX_ARY_LEN 1 /* VALUE ary[1]; */ +#endif +#endif + +typedef struct rb_ast_id_table { + int size; + ID ids[FLEX_ARY_LEN]; +} rb_ast_id_table_t; + +typedef struct rb_code_position_struct { + int lineno; + int column; +} rb_code_position_t; + +typedef struct rb_code_location_struct { + rb_code_position_t beg_pos; + rb_code_position_t end_pos; +} rb_code_location_t; + +typedef struct RNode { + VALUE flags; + union { + struct RNode *node; + ID id; + VALUE value; + rb_ast_id_table_t *tbl; + } u1; + union { + struct RNode *node; + ID id; + long argc; + VALUE value; + } u2; + union { + struct RNode *node; + ID id; + long state; + struct rb_args_info *args; + struct rb_ary_pattern_info *apinfo; + struct rb_fnd_pattern_info *fpinfo; + VALUE value; + } u3; + rb_code_location_t nd_loc; + int node_id; +} NODE; + +/* FL : 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: FINALIZE, 8: UNUSED, 9: UNUSED, 10: EXIVAR, 11: FREEZE */ +/* NODE_FL: 0..4: T_TYPES, 5: KEEP_WB, 6: PROMOTED, 7: NODE_FL_NEWLINE, + * 8..14: nd_type, + * 15..: nd_line + */ +#define NODE_FL_NEWLINE (((VALUE)1)<<7) + +#define NODE_TYPESHIFT 8 +#define NODE_TYPEMASK (((VALUE)0x7f)<flags & NODE_TYPEMASK)>>NODE_TYPESHIFT)) +#define nd_set_type(n,t) \ + rb_node_set_type(n, t) +#define nd_init_type(n,t) \ + (n)->flags=(((n)->flags&~NODE_TYPEMASK)|((((unsigned long)(t))< 0); } -# line 96 "vm.inc" +# line 95 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -102,7 +101,6 @@ INSN_ENTRY(getlocal) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -120,11 +118,11 @@ INSN_ENTRY(setlocal) lindex_t idx = (lindex_t)GET_OPERAND(1); rb_num_t level = (rb_num_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _setlocal(idx, level) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); @@ -138,14 +136,13 @@ INSN_ENTRY(setlocal) RB_DEBUG_COUNTER_INC(lvar_set); (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); } -# line 142 "vm.inc" +# line 140 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -163,11 +160,11 @@ INSN_ENTRY(getblockparam) lindex_t idx = (lindex_t)GET_OPERAND(1); rb_num_t level = (rb_num_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _getblockparam(idx, level) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); @@ -191,7 +188,7 @@ INSN_ENTRY(getblockparam) (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); } } -# line 195 "vm.inc" +# line 192 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -201,7 +198,6 @@ INSN_ENTRY(getblockparam) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -219,11 +215,11 @@ INSN_ENTRY(setblockparam) lindex_t idx = (lindex_t)GET_OPERAND(1); rb_num_t level = (rb_num_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _setblockparam(idx, level) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); @@ -242,14 +238,13 @@ INSN_ENTRY(setblockparam) VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); } -# line 246 "vm.inc" +# line 242 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -267,11 +262,11 @@ INSN_ENTRY(getblockparamproxy) lindex_t idx = (lindex_t)GET_OPERAND(1); rb_num_t level = (rb_num_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _getblockparamproxy(idx, level) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); @@ -316,7 +311,7 @@ INSN_ENTRY(getblockparamproxy) (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); } } -# line 320 "vm.inc" +# line 315 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -326,7 +321,6 @@ INSN_ENTRY(getblockparamproxy) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -344,11 +338,11 @@ INSN_ENTRY(getspecial) rb_num_t key = (rb_num_t)GET_OPERAND(1); rb_num_t type = (rb_num_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _getspecial(key, type) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); @@ -360,7 +354,7 @@ INSN_ENTRY(getspecial) { val = vm_getspecial(ec, GET_LEP(), key, type); } -# line 364 "vm.inc" +# line 358 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -370,7 +364,6 @@ INSN_ENTRY(getspecial) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -387,11 +380,11 @@ INSN_ENTRY(setspecial) /* ### Declare and assign variables. ### */ rb_num_t key = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _setspecial(key) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE obj = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); @@ -402,14 +395,13 @@ INSN_ENTRY(setspecial) { lep_svar_set(ec, GET_LEP(), key, obj); } -# line 406 "vm.inc" +# line 399 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -427,11 +419,11 @@ INSN_ENTRY(getinstancevariable) ID id = (ID)GET_OPERAND(1); IVC ic = (IVC)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _getinstancevariable(id, ic) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); @@ -443,7 +435,7 @@ INSN_ENTRY(getinstancevariable) { val = vm_getinstancevariable(GET_ISEQ(), GET_SELF(), id, ic); } -# line 447 "vm.inc" +# line 439 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -453,7 +445,6 @@ INSN_ENTRY(getinstancevariable) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -471,11 +462,11 @@ INSN_ENTRY(setinstancevariable) ID id = (ID)GET_OPERAND(1); IVC ic = (IVC)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _setinstancevariable(id, ic) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); @@ -487,14 +478,13 @@ INSN_ENTRY(setinstancevariable) { vm_setinstancevariable(GET_ISEQ(), GET_SELF(), id, val, ic); } -# line 491 "vm.inc" +# line 482 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -512,11 +502,11 @@ INSN_ENTRY(getclassvariable) ID id = (ID)GET_OPERAND(1); ICVARC ic = (ICVARC)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _getclassvariable(id, ic) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); @@ -529,7 +519,7 @@ INSN_ENTRY(getclassvariable) rb_control_frame_t *cfp = GET_CFP(); val = vm_getclassvariable(GET_ISEQ(), cfp, id, ic); } -# line 533 "vm.inc" +# line 523 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -539,7 +529,6 @@ INSN_ENTRY(getclassvariable) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -557,11 +546,11 @@ INSN_ENTRY(setclassvariable) ID id = (ID)GET_OPERAND(1); ICVARC ic = (ICVARC)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _setclassvariable(id, ic) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); @@ -574,14 +563,13 @@ INSN_ENTRY(setclassvariable) vm_ensure_not_refinement_module(GET_SELF()); vm_setclassvariable(GET_ISEQ(), GET_CFP(), id, val, ic); } -# line 578 "vm.inc" +# line 567 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -598,11 +586,11 @@ INSN_ENTRY(opt_getconstant_path) /* ### Declare and assign variables. ### */ IC ic = (IC)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_getconstant_path(ic) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, ic); @@ -626,7 +614,7 @@ INSN_ENTRY(opt_getconstant_path) vm_ic_update(GET_ISEQ(), ic, val, GET_EP(), GET_PC() - 2); } } -# line 630 "vm.inc" +# line 618 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -636,7 +624,6 @@ INSN_ENTRY(opt_getconstant_path) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -653,13 +640,13 @@ INSN_ENTRY(getconstant) /* ### Declare and assign variables. ### */ ID id = (ID)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _getconstant(id) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE klass = TOPN(1); VALUE allow_nil = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); @@ -670,7 +657,7 @@ INSN_ENTRY(getconstant) { val = vm_get_ev_const(ec, klass, id, allow_nil == Qtrue, 0); } -# line 674 "vm.inc" +# line 661 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -680,7 +667,6 @@ INSN_ENTRY(getconstant) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -697,12 +683,12 @@ INSN_ENTRY(setconstant) /* ### Declare and assign variables. ### */ ID id = (ID)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _setconstant(id) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(1); VALUE cbase = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); @@ -715,14 +701,13 @@ INSN_ENTRY(setconstant) vm_ensure_not_refinement_module(GET_SELF()); rb_const_set(cbase, id, val); } -# line 719 "vm.inc" +# line 705 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -739,11 +724,11 @@ INSN_ENTRY(getglobal) /* ### Declare and assign variables. ### */ ID gid = (ID)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _getglobal(gid) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, gid); @@ -754,7 +739,7 @@ INSN_ENTRY(getglobal) { val = rb_gvar_get(gid); } -# line 758 "vm.inc" +# line 743 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -764,7 +749,6 @@ INSN_ENTRY(getglobal) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -781,11 +765,11 @@ INSN_ENTRY(setglobal) /* ### Declare and assign variables. ### */ ID gid = (ID)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _setglobal(gid) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, gid); @@ -796,14 +780,13 @@ INSN_ENTRY(setglobal) { rb_gvar_set(gid, val); } -# line 800 "vm.inc" +# line 784 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -819,11 +802,11 @@ INSN_ENTRY(putnil) /* ### Declare and assign variables. ### */ # define INSN_ATTR(x) attr_ ## x ## _putnil() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -833,7 +816,7 @@ INSN_ENTRY(putnil) { val = Qnil; } -# line 837 "vm.inc" +# line 820 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -843,7 +826,6 @@ INSN_ENTRY(putnil) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -859,11 +841,11 @@ INSN_ENTRY(putself) /* ### Declare and assign variables. ### */ # define INSN_ATTR(x) attr_ ## x ## _putself() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -873,7 +855,7 @@ INSN_ENTRY(putself) { val = GET_SELF(); } -# line 877 "vm.inc" +# line 859 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -883,7 +865,6 @@ INSN_ENTRY(putself) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -900,10 +881,10 @@ INSN_ENTRY(putobject) /* ### Declare and assign variables. ### */ VALUE val = (VALUE)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _putobject(val) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, val); @@ -913,7 +894,6 @@ INSN_ENTRY(putobject) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -930,11 +910,11 @@ INSN_ENTRY(putspecialobject) /* ### Declare and assign variables. ### */ rb_num_t value_type = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _putspecialobject(value_type) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, value_type); @@ -948,7 +928,7 @@ INSN_ENTRY(putspecialobject) type = (enum vm_special_object_type)value_type; val = vm_get_special_object(GET_EP(), type); } -# line 952 "vm.inc" +# line 932 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -958,7 +938,6 @@ INSN_ENTRY(putspecialobject) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -975,11 +954,11 @@ INSN_ENTRY(putstring) /* ### Declare and assign variables. ### */ VALUE str = (VALUE)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _putstring(str) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); @@ -990,7 +969,7 @@ INSN_ENTRY(putstring) { val = rb_ec_str_resurrect(ec, str); } -# line 994 "vm.inc" +# line 973 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1000,7 +979,6 @@ INSN_ENTRY(putstring) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1017,11 +995,11 @@ INSN_ENTRY(concatstrings) /* ### Declare and assign variables. ### */ rb_num_t num = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _concatstrings(num) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); @@ -1032,7 +1010,7 @@ INSN_ENTRY(concatstrings) { val = rb_str_concat_literals(num, STACK_ADDR_FROM_TOP(num)); } -# line 1036 "vm.inc" +# line 1014 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1042,7 +1020,6 @@ INSN_ENTRY(concatstrings) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1058,12 +1035,12 @@ INSN_ENTRY(anytostring) /* ### Declare and assign variables. ### */ # define INSN_ATTR(x) attr_ ## x ## _anytostring() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(1); VALUE str = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -1073,7 +1050,7 @@ INSN_ENTRY(anytostring) { val = rb_obj_as_string_result(str, val); } -# line 1077 "vm.inc" +# line 1054 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1083,7 +1060,6 @@ INSN_ENTRY(anytostring) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1101,11 +1077,11 @@ INSN_ENTRY(toregexp) rb_num_t opt = (rb_num_t)GET_OPERAND(1); rb_num_t cnt = (rb_num_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _toregexp(opt, cnt) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, opt); @@ -1119,7 +1095,7 @@ INSN_ENTRY(toregexp) val = rb_reg_new_ary(ary, (int)opt); rb_ary_clear(ary); } -# line 1123 "vm.inc" +# line 1099 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1129,7 +1105,6 @@ INSN_ENTRY(toregexp) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1145,12 +1120,12 @@ INSN_ENTRY(intern) /* ### Declare and assign variables. ### */ # define INSN_ATTR(x) attr_ ## x ## _intern() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE str = TOPN(0); VALUE sym; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -1160,7 +1135,7 @@ INSN_ENTRY(intern) { sym = rb_str_intern(str); } -# line 1164 "vm.inc" +# line 1139 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1170,7 +1145,6 @@ INSN_ENTRY(intern) TOPN(0) = sym; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1187,11 +1161,11 @@ INSN_ENTRY(newarray) /* ### Declare and assign variables. ### */ rb_num_t num = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _newarray(num) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); @@ -1202,7 +1176,7 @@ INSN_ENTRY(newarray) { val = rb_ec_ary_new_from_values(ec, num, STACK_ADDR_FROM_TOP(num)); } -# line 1206 "vm.inc" +# line 1180 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1212,7 +1186,6 @@ INSN_ENTRY(newarray) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1229,11 +1202,11 @@ INSN_ENTRY(newarraykwsplat) /* ### Declare and assign variables. ### */ rb_num_t num = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _newarraykwsplat(num) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); @@ -1249,7 +1222,7 @@ INSN_ENTRY(newarraykwsplat) val = rb_ary_new4(num, STACK_ADDR_FROM_TOP(num)); } } -# line 1253 "vm.inc" +# line 1226 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1259,7 +1232,6 @@ INSN_ENTRY(newarraykwsplat) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1276,11 +1248,11 @@ INSN_ENTRY(duparray) /* ### Declare and assign variables. ### */ VALUE ary = (VALUE)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _duparray(ary) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, ary); @@ -1292,7 +1264,7 @@ INSN_ENTRY(duparray) RUBY_DTRACE_CREATE_HOOK(ARRAY, RARRAY_LEN(ary)); val = rb_ary_resurrect(ary); } -# line 1296 "vm.inc" +# line 1268 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1302,7 +1274,6 @@ INSN_ENTRY(duparray) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1319,11 +1290,11 @@ INSN_ENTRY(duphash) /* ### Declare and assign variables. ### */ VALUE hash = (VALUE)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _duphash(hash) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, hash); @@ -1335,7 +1306,7 @@ INSN_ENTRY(duphash) RUBY_DTRACE_CREATE_HOOK(HASH, RHASH_SIZE(hash) << 1); val = rb_hash_resurrect(hash); } -# line 1339 "vm.inc" +# line 1310 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1345,7 +1316,6 @@ INSN_ENTRY(duphash) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1363,11 +1333,11 @@ INSN_ENTRY(expandarray) rb_num_t num = (rb_num_t)GET_OPERAND(1); rb_num_t flag = (rb_num_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _expandarray(num, flag) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE ary = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 1, flag); @@ -1378,13 +1348,12 @@ INSN_ENTRY(expandarray) { vm_expandarray(GET_SP(), ary, num, (int)flag); } -# line 1382 "vm.inc" +# line 1352 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1400,13 +1369,13 @@ INSN_ENTRY(concatarray) /* ### Declare and assign variables. ### */ # define INSN_ATTR(x) attr_ ## x ## _concatarray() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE ary1 = TOPN(1); VALUE ary2 = TOPN(0); VALUE ary; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -1416,7 +1385,7 @@ INSN_ENTRY(concatarray) { ary = vm_concat_array(ary1, ary2); } -# line 1420 "vm.inc" +# line 1389 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1426,7 +1395,6 @@ INSN_ENTRY(concatarray) TOPN(0) = ary; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1443,12 +1411,12 @@ INSN_ENTRY(splatarray) /* ### Declare and assign variables. ### */ VALUE flag = (VALUE)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _splatarray(flag) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE ary = TOPN(0); VALUE obj; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, flag); @@ -1459,7 +1427,7 @@ INSN_ENTRY(splatarray) { obj = vm_splat_array(flag, ary); } -# line 1463 "vm.inc" +# line 1431 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1469,7 +1437,6 @@ INSN_ENTRY(splatarray) TOPN(0) = obj; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1486,11 +1453,11 @@ INSN_ENTRY(newhash) /* ### Declare and assign variables. ### */ rb_num_t num = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _newhash(num) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); @@ -1509,7 +1476,7 @@ INSN_ENTRY(newhash) val = rb_hash_new(); } } -# line 1513 "vm.inc" +# line 1480 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1519,7 +1486,6 @@ INSN_ENTRY(newhash) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1536,13 +1502,13 @@ INSN_ENTRY(newrange) /* ### Declare and assign variables. ### */ rb_num_t flag = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _newrange(flag) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE low = TOPN(1); VALUE high = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, flag); @@ -1553,7 +1519,7 @@ INSN_ENTRY(newrange) { val = rb_range_new(low, high, (int)flag); } -# line 1557 "vm.inc" +# line 1523 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1563,7 +1529,6 @@ INSN_ENTRY(newrange) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1579,11 +1544,11 @@ INSN_ENTRY(pop) /* ### Declare and assign variables. ### */ # define INSN_ATTR(x) attr_ ## x ## _pop() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -1594,14 +1559,13 @@ INSN_ENTRY(pop) (void)val; /* none */ } -# line 1598 "vm.inc" +# line 1563 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1617,13 +1581,13 @@ INSN_ENTRY(dup) /* ### Declare and assign variables. ### */ # define INSN_ATTR(x) attr_ ## x ## _dup() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); VALUE val1; VALUE val2; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -1633,7 +1597,7 @@ INSN_ENTRY(dup) { val1 = val2 = val; } -# line 1637 "vm.inc" +# line 1601 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1646,7 +1610,6 @@ INSN_ENTRY(dup) TOPN(1) = val1; VM_ASSERT(!RB_TYPE_P(TOPN(1), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(1), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1663,10 +1626,10 @@ INSN_ENTRY(dupn) /* ### Declare and assign variables. ### */ rb_num_t n = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _dupn(n) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, n); @@ -1679,13 +1642,12 @@ INSN_ENTRY(dupn) MEMCPY(dst, src, VALUE, n); } -# line 1683 "vm.inc" +# line 1646 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1701,12 +1663,12 @@ INSN_ENTRY(swap) /* ### Declare and assign variables. ### */ # define INSN_ATTR(x) attr_ ## x ## _swap() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(1); VALUE obj = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); COLLECT_USAGE_INSN(INSN_ATTR(bin)); /* ### Instruction trailers. ### */ @@ -1718,7 +1680,6 @@ INSN_ENTRY(swap) TOPN(1) = obj; VM_ASSERT(!RB_TYPE_P(TOPN(1), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(1), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1735,10 +1696,10 @@ INSN_ENTRY(opt_reverse) /* ### Declare and assign variables. ### */ rb_num_t n = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_reverse(n) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, n); @@ -1756,13 +1717,12 @@ INSN_ENTRY(opt_reverse) TOPN(i) = v0; } } -# line 1760 "vm.inc" +# line 1721 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1779,11 +1739,11 @@ INSN_ENTRY(topn) /* ### Declare and assign variables. ### */ rb_num_t n = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _topn(n) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, n); @@ -1794,7 +1754,7 @@ INSN_ENTRY(topn) { val = TOPN(n); } -# line 1798 "vm.inc" +# line 1758 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1804,7 +1764,6 @@ INSN_ENTRY(topn) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1821,11 +1780,11 @@ INSN_ENTRY(setn) /* ### Declare and assign variables. ### */ rb_num_t n = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _setn(n) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, n); @@ -1836,7 +1795,7 @@ INSN_ENTRY(setn) { TOPN(n) = val; } -# line 1840 "vm.inc" +# line 1799 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1846,7 +1805,6 @@ INSN_ENTRY(setn) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1863,17 +1821,16 @@ INSN_ENTRY(adjuststack) /* ### Declare and assign variables. ### */ rb_num_t n = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _adjuststack(n) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, n); /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1892,12 +1849,12 @@ INSN_ENTRY(defined) VALUE obj = (VALUE)GET_OPERAND(2); VALUE pushval = (VALUE)GET_OPERAND(3); # define INSN_ATTR(x) attr_ ## x ## _defined(op_type, obj, pushval) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE v = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, op_type); @@ -1913,7 +1870,7 @@ INSN_ENTRY(defined) val = pushval; } } -# line 1917 "vm.inc" +# line 1874 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1923,7 +1880,6 @@ INSN_ENTRY(defined) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1942,11 +1898,11 @@ INSN_ENTRY(definedivar) IVC ic = (IVC)GET_OPERAND(2); VALUE pushval = (VALUE)GET_OPERAND(3); # define INSN_ATTR(x) attr_ ## x ## _definedivar(id, ic, pushval) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, id); @@ -1962,7 +1918,7 @@ INSN_ENTRY(definedivar) val = pushval; } } -# line 1966 "vm.inc" +# line 1922 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -1972,7 +1928,6 @@ INSN_ENTRY(definedivar) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -1989,13 +1944,13 @@ INSN_ENTRY(checkmatch) /* ### Declare and assign variables. ### */ rb_num_t flag = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _checkmatch(flag) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE target = TOPN(1); VALUE pattern = TOPN(0); VALUE result; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, flag); @@ -2006,7 +1961,7 @@ INSN_ENTRY(checkmatch) { result = vm_check_match(ec, target, pattern, flag); } -# line 2010 "vm.inc" +# line 1965 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -2016,7 +1971,6 @@ INSN_ENTRY(checkmatch) TOPN(0) = result; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2034,11 +1988,11 @@ INSN_ENTRY(checkkeyword) lindex_t kw_bits_index = (lindex_t)GET_OPERAND(1); lindex_t keyword_index = (lindex_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _checkkeyword(kw_bits_index, keyword_index) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE ret; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, kw_bits_index); @@ -2050,7 +2004,7 @@ INSN_ENTRY(checkkeyword) { ret = vm_check_keyword(kw_bits_index, keyword_index, GET_EP()); } -# line 2054 "vm.inc" +# line 2008 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -2060,7 +2014,6 @@ INSN_ENTRY(checkkeyword) TOPN(0) = ret; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2077,12 +2030,12 @@ INSN_ENTRY(checktype) /* ### Declare and assign variables. ### */ rb_num_t type = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _checktype(type) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); VALUE ret; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, type); @@ -2093,7 +2046,7 @@ INSN_ENTRY(checktype) { ret = RBOOL(TYPE(val) == (int)type); } -# line 2097 "vm.inc" +# line 2050 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -2103,7 +2056,6 @@ INSN_ENTRY(checktype) TOPN(0) = ret; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2122,13 +2074,13 @@ INSN_ENTRY(defineclass) ISEQ class_iseq = (ISEQ)GET_OPERAND(2); rb_num_t flags = (rb_num_t)GET_OPERAND(3); # define INSN_ATTR(x) attr_ ## x ## _defineclass(id, class_iseq, flags) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE cbase = TOPN(1); VALUE super = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); POPN(INSN_ATTR(popn)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -2154,14 +2106,13 @@ INSN_ENTRY(defineclass) RESTORE_REGS(); NEXT_INSN(); } -# line 2158 "vm.inc" +# line 2110 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); PUSH(val); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2179,10 +2130,10 @@ INSN_ENTRY(definemethod) ID id = (ID)GET_OPERAND(1); ISEQ iseq = (ISEQ)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _definemethod(id, iseq) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); POPN(INSN_ATTR(popn)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -2195,13 +2146,12 @@ INSN_ENTRY(definemethod) { vm_define_method(ec, Qnil, id, (VALUE)iseq, FALSE); } -# line 2199 "vm.inc" +# line 2150 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2219,11 +2169,11 @@ INSN_ENTRY(definesmethod) ID id = (ID)GET_OPERAND(1); ISEQ iseq = (ISEQ)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _definesmethod(id, iseq) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE obj = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); POPN(INSN_ATTR(popn)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -2236,13 +2186,12 @@ INSN_ENTRY(definesmethod) { vm_define_method(ec, obj, id, (VALUE)iseq, TRUE); } -# line 2240 "vm.inc" +# line 2190 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2260,11 +2209,11 @@ INSN_ENTRY(send) CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); ISEQ blockiseq = (ISEQ)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _send(cd, blockiseq) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); POPN(INSN_ATTR(popn)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -2284,14 +2233,13 @@ INSN_ENTRY(send) NEXT_INSN(); } } -# line 2288 "vm.inc" +# line 2237 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); PUSH(val); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2308,11 +2256,11 @@ INSN_ENTRY(opt_send_without_block) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_send_without_block(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); POPN(INSN_ATTR(popn)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -2331,14 +2279,13 @@ INSN_ENTRY(opt_send_without_block) NEXT_INSN(); } } -# line 2335 "vm.inc" +# line 2283 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); PUSH(val); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2355,12 +2302,12 @@ INSN_ENTRY(objtostring) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _objtostring(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -2375,7 +2322,7 @@ INSN_ENTRY(objtostring) CALL_SIMPLE_METHOD(); } } -# line 2379 "vm.inc" +# line 2326 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -2385,7 +2332,6 @@ INSN_ENTRY(objtostring) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2403,11 +2349,11 @@ INSN_ENTRY(opt_str_freeze) VALUE str = (VALUE)GET_OPERAND(1); CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _opt_str_freeze(str, cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); @@ -2424,7 +2370,7 @@ INSN_ENTRY(opt_str_freeze) CALL_SIMPLE_METHOD(); } } -# line 2428 "vm.inc" +# line 2374 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -2434,7 +2380,6 @@ INSN_ENTRY(opt_str_freeze) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2451,12 +2396,12 @@ INSN_ENTRY(opt_nil_p) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_nil_p(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -2471,7 +2416,7 @@ INSN_ENTRY(opt_nil_p) CALL_SIMPLE_METHOD(); } } -# line 2475 "vm.inc" +# line 2420 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -2481,7 +2426,6 @@ INSN_ENTRY(opt_nil_p) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2499,11 +2443,11 @@ INSN_ENTRY(opt_str_uminus) VALUE str = (VALUE)GET_OPERAND(1); CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _opt_str_uminus(str, cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, str); @@ -2520,7 +2464,7 @@ INSN_ENTRY(opt_str_uminus) CALL_SIMPLE_METHOD(); } } -# line 2524 "vm.inc" +# line 2468 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -2530,7 +2474,6 @@ INSN_ENTRY(opt_str_uminus) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2548,11 +2491,11 @@ INSN_ENTRY(opt_newarray_send) rb_num_t num = (rb_num_t)GET_OPERAND(1); ID method = (ID)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _opt_newarray_send(num, method) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, num); @@ -2576,7 +2519,7 @@ INSN_ENTRY(opt_newarray_send) rb_bug("unreachable"); } } -# line 2580 "vm.inc" +# line 2523 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -2586,7 +2529,6 @@ INSN_ENTRY(opt_newarray_send) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2604,11 +2546,11 @@ INSN_ENTRY(invokesuper) CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); ISEQ blockiseq = (ISEQ)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _invokesuper(cd, blockiseq) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); POPN(INSN_ATTR(popn)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -2628,14 +2570,13 @@ INSN_ENTRY(invokesuper) NEXT_INSN(); } } -# line 2632 "vm.inc" +# line 2574 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); PUSH(val); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2652,11 +2593,11 @@ INSN_ENTRY(invokeblock) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _invokeblock(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); POPN(INSN_ATTR(popn)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -2675,14 +2616,13 @@ INSN_ENTRY(invokeblock) NEXT_INSN(); } } -# line 2679 "vm.inc" +# line 2620 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); PUSH(val); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2698,11 +2638,11 @@ INSN_ENTRY(leave) /* ### Declare and assign variables. ### */ # define INSN_ATTR(x) attr_ ## x ## _leave() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); POPN(INSN_ATTR(popn)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -2730,14 +2670,13 @@ INSN_ENTRY(leave) RESTORE_REGS(); } } -# line 2734 "vm.inc" +# line 2674 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); PUSH(val); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2754,12 +2693,12 @@ INSN_ENTRY(throw) /* ### Declare and assign variables. ### */ rb_num_t throw_state = (rb_num_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _throw(throw_state) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE throwobj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, throw_state); @@ -2772,7 +2711,7 @@ INSN_ENTRY(throw) THROW_EXCEPTION(val); /* unreachable */ } -# line 2776 "vm.inc" +# line 2715 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -2782,7 +2721,6 @@ INSN_ENTRY(throw) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2799,10 +2737,10 @@ INSN_ENTRY(jump) /* ### Declare and assign variables. ### */ OFFSET dst = (OFFSET)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _jump(dst) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); @@ -2814,14 +2752,13 @@ INSN_ENTRY(jump) RUBY_VM_CHECK_INTS(ec); JUMP(dst); } -# line 2818 "vm.inc" +# line 2756 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2838,11 +2775,11 @@ INSN_ENTRY(branchif) /* ### Declare and assign variables. ### */ OFFSET dst = (OFFSET)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _branchif(dst) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); @@ -2856,14 +2793,13 @@ INSN_ENTRY(branchif) JUMP(dst); } } -# line 2860 "vm.inc" +# line 2797 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2880,11 +2816,11 @@ INSN_ENTRY(branchunless) /* ### Declare and assign variables. ### */ OFFSET dst = (OFFSET)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _branchunless(dst) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); @@ -2898,14 +2834,13 @@ INSN_ENTRY(branchunless) JUMP(dst); } } -# line 2902 "vm.inc" +# line 2838 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2922,11 +2857,11 @@ INSN_ENTRY(branchnil) /* ### Declare and assign variables. ### */ OFFSET dst = (OFFSET)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _branchnil(dst) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, dst); @@ -2940,14 +2875,13 @@ INSN_ENTRY(branchnil) JUMP(dst); } } -# line 2944 "vm.inc" +# line 2879 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -2965,11 +2899,11 @@ INSN_ENTRY(once) ISEQ iseq = (ISEQ)GET_OPERAND(1); ISE ise = (ISE)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _once(iseq, ise) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); POPN(INSN_ATTR(popn)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); @@ -2982,14 +2916,13 @@ INSN_ENTRY(once) { val = vm_once_dispatch(ec, iseq, ise); } -# line 2986 "vm.inc" +# line 2920 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); PUSH(val); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3007,11 +2940,11 @@ INSN_ENTRY(opt_case_dispatch) CDHASH hash = (CDHASH)GET_OPERAND(1); OFFSET else_offset = (OFFSET)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _opt_case_dispatch(hash, else_offset) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE key = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, hash); @@ -3027,14 +2960,13 @@ INSN_ENTRY(opt_case_dispatch) JUMP(dst); } } -# line 3031 "vm.inc" +# line 2964 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3051,13 +2983,13 @@ INSN_ENTRY(opt_plus) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_plus(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3072,7 +3004,7 @@ INSN_ENTRY(opt_plus) CALL_SIMPLE_METHOD(); } } -# line 3076 "vm.inc" +# line 3008 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3082,7 +3014,6 @@ INSN_ENTRY(opt_plus) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3099,13 +3030,13 @@ INSN_ENTRY(opt_minus) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_minus(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3120,7 +3051,7 @@ INSN_ENTRY(opt_minus) CALL_SIMPLE_METHOD(); } } -# line 3124 "vm.inc" +# line 3055 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3130,7 +3061,6 @@ INSN_ENTRY(opt_minus) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3147,13 +3077,13 @@ INSN_ENTRY(opt_mult) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_mult(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3168,7 +3098,7 @@ INSN_ENTRY(opt_mult) CALL_SIMPLE_METHOD(); } } -# line 3172 "vm.inc" +# line 3102 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3178,7 +3108,6 @@ INSN_ENTRY(opt_mult) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3195,13 +3124,13 @@ INSN_ENTRY(opt_div) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_div(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3216,7 +3145,7 @@ INSN_ENTRY(opt_div) CALL_SIMPLE_METHOD(); } } -# line 3220 "vm.inc" +# line 3149 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3226,7 +3155,6 @@ INSN_ENTRY(opt_div) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3243,13 +3171,13 @@ INSN_ENTRY(opt_mod) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_mod(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3264,7 +3192,7 @@ INSN_ENTRY(opt_mod) CALL_SIMPLE_METHOD(); } } -# line 3268 "vm.inc" +# line 3196 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3274,7 +3202,6 @@ INSN_ENTRY(opt_mod) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3291,13 +3218,13 @@ INSN_ENTRY(opt_eq) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_eq(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3312,7 +3239,7 @@ INSN_ENTRY(opt_eq) CALL_SIMPLE_METHOD(); } } -# line 3316 "vm.inc" +# line 3243 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3322,7 +3249,6 @@ INSN_ENTRY(opt_eq) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3340,13 +3266,13 @@ INSN_ENTRY(opt_neq) CALL_DATA cd_eq = (CALL_DATA)GET_OPERAND(1); CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _opt_neq(cd_eq, cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd_eq); @@ -3362,7 +3288,7 @@ INSN_ENTRY(opt_neq) CALL_SIMPLE_METHOD(); } } -# line 3366 "vm.inc" +# line 3292 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3372,7 +3298,6 @@ INSN_ENTRY(opt_neq) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3389,13 +3314,13 @@ INSN_ENTRY(opt_lt) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_lt(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3410,7 +3335,7 @@ INSN_ENTRY(opt_lt) CALL_SIMPLE_METHOD(); } } -# line 3414 "vm.inc" +# line 3339 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3420,7 +3345,6 @@ INSN_ENTRY(opt_lt) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3437,13 +3361,13 @@ INSN_ENTRY(opt_le) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_le(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3458,7 +3382,7 @@ INSN_ENTRY(opt_le) CALL_SIMPLE_METHOD(); } } -# line 3462 "vm.inc" +# line 3386 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3468,7 +3392,6 @@ INSN_ENTRY(opt_le) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3485,13 +3408,13 @@ INSN_ENTRY(opt_gt) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_gt(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3506,7 +3429,7 @@ INSN_ENTRY(opt_gt) CALL_SIMPLE_METHOD(); } } -# line 3510 "vm.inc" +# line 3433 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3516,7 +3439,6 @@ INSN_ENTRY(opt_gt) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3533,13 +3455,13 @@ INSN_ENTRY(opt_ge) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_ge(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3554,7 +3476,7 @@ INSN_ENTRY(opt_ge) CALL_SIMPLE_METHOD(); } } -# line 3558 "vm.inc" +# line 3480 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3564,7 +3486,6 @@ INSN_ENTRY(opt_ge) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3581,13 +3502,13 @@ INSN_ENTRY(opt_ltlt) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_ltlt(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3602,7 +3523,7 @@ INSN_ENTRY(opt_ltlt) CALL_SIMPLE_METHOD(); } } -# line 3606 "vm.inc" +# line 3527 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3612,7 +3533,6 @@ INSN_ENTRY(opt_ltlt) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3629,13 +3549,13 @@ INSN_ENTRY(opt_and) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_and(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3650,7 +3570,7 @@ INSN_ENTRY(opt_and) CALL_SIMPLE_METHOD(); } } -# line 3654 "vm.inc" +# line 3574 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3660,7 +3580,6 @@ INSN_ENTRY(opt_and) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3677,13 +3596,13 @@ INSN_ENTRY(opt_or) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_or(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3698,7 +3617,7 @@ INSN_ENTRY(opt_or) CALL_SIMPLE_METHOD(); } } -# line 3702 "vm.inc" +# line 3621 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3708,7 +3627,6 @@ INSN_ENTRY(opt_or) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3725,13 +3643,13 @@ INSN_ENTRY(opt_aref) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_aref(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE obj = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3746,7 +3664,7 @@ INSN_ENTRY(opt_aref) CALL_SIMPLE_METHOD(); } } -# line 3750 "vm.inc" +# line 3668 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3756,7 +3674,6 @@ INSN_ENTRY(opt_aref) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3773,14 +3690,14 @@ INSN_ENTRY(opt_aset) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_aset(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(2); VALUE obj = TOPN(1); VALUE set = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3795,7 +3712,7 @@ INSN_ENTRY(opt_aset) CALL_SIMPLE_METHOD(); } } -# line 3799 "vm.inc" +# line 3716 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3805,7 +3722,6 @@ INSN_ENTRY(opt_aset) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3823,12 +3739,12 @@ INSN_ENTRY(opt_aset_with) VALUE key = (VALUE)GET_OPERAND(1); CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _opt_aset_with(key, cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(1); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); @@ -3849,7 +3765,7 @@ INSN_ENTRY(opt_aset_with) CALL_SIMPLE_METHOD(); } } -# line 3853 "vm.inc" +# line 3769 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3859,7 +3775,6 @@ INSN_ENTRY(opt_aset_with) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3877,12 +3792,12 @@ INSN_ENTRY(opt_aref_with) VALUE key = (VALUE)GET_OPERAND(1); CALL_DATA cd = (CALL_DATA)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _opt_aref_with(key, cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, key); @@ -3899,7 +3814,7 @@ INSN_ENTRY(opt_aref_with) CALL_SIMPLE_METHOD(); } } -# line 3903 "vm.inc" +# line 3818 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3909,7 +3824,6 @@ INSN_ENTRY(opt_aref_with) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3926,12 +3840,12 @@ INSN_ENTRY(opt_length) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_length(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3946,7 +3860,7 @@ INSN_ENTRY(opt_length) CALL_SIMPLE_METHOD(); } } -# line 3950 "vm.inc" +# line 3864 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -3956,7 +3870,6 @@ INSN_ENTRY(opt_length) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -3973,12 +3886,12 @@ INSN_ENTRY(opt_size) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_size(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -3993,7 +3906,7 @@ INSN_ENTRY(opt_size) CALL_SIMPLE_METHOD(); } } -# line 3997 "vm.inc" +# line 3910 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4003,7 +3916,6 @@ INSN_ENTRY(opt_size) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4020,12 +3932,12 @@ INSN_ENTRY(opt_empty_p) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_empty_p(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -4040,7 +3952,7 @@ INSN_ENTRY(opt_empty_p) CALL_SIMPLE_METHOD(); } } -# line 4044 "vm.inc" +# line 3956 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4050,7 +3962,6 @@ INSN_ENTRY(opt_empty_p) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4067,12 +3978,12 @@ INSN_ENTRY(opt_succ) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_succ(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -4087,7 +3998,7 @@ INSN_ENTRY(opt_succ) CALL_SIMPLE_METHOD(); } } -# line 4091 "vm.inc" +# line 4002 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4097,7 +4008,6 @@ INSN_ENTRY(opt_succ) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4114,12 +4024,12 @@ INSN_ENTRY(opt_not) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_not(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE recv = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -4134,7 +4044,7 @@ INSN_ENTRY(opt_not) CALL_SIMPLE_METHOD(); } } -# line 4138 "vm.inc" +# line 4048 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4144,7 +4054,6 @@ INSN_ENTRY(opt_not) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4161,13 +4070,13 @@ INSN_ENTRY(opt_regexpmatch2) /* ### Declare and assign variables. ### */ CALL_DATA cd = (CALL_DATA)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _opt_regexpmatch2(cd) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE obj2 = TOPN(1); VALUE obj1 = TOPN(0); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, cd); @@ -4182,7 +4091,7 @@ INSN_ENTRY(opt_regexpmatch2) CALL_SIMPLE_METHOD(); } } -# line 4186 "vm.inc" +# line 4095 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4192,7 +4101,6 @@ INSN_ENTRY(opt_regexpmatch2) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4209,11 +4117,11 @@ INSN_ENTRY(invokebuiltin) /* ### Declare and assign variables. ### */ RB_BUILTIN bf = (RB_BUILTIN)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _invokebuiltin(bf) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, bf); @@ -4224,7 +4132,7 @@ INSN_ENTRY(invokebuiltin) { val = vm_invoke_builtin(ec, reg_cfp, bf, STACK_ADDR_FROM_TOP(bf->argc)); } -# line 4228 "vm.inc" +# line 4136 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4234,7 +4142,6 @@ INSN_ENTRY(invokebuiltin) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4252,11 +4159,11 @@ INSN_ENTRY(opt_invokebuiltin_delegate) RB_BUILTIN bf = (RB_BUILTIN)GET_OPERAND(1); rb_num_t index = (rb_num_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _opt_invokebuiltin_delegate(bf, index) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, bf); @@ -4268,7 +4175,7 @@ INSN_ENTRY(opt_invokebuiltin_delegate) { val = vm_invoke_builtin_delegate(ec, reg_cfp, bf, (unsigned int)index); } -# line 4272 "vm.inc" +# line 4179 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4278,7 +4185,6 @@ INSN_ENTRY(opt_invokebuiltin_delegate) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4296,11 +4202,11 @@ INSN_ENTRY(opt_invokebuiltin_delegate_leave) RB_BUILTIN bf = (RB_BUILTIN)GET_OPERAND(1); rb_num_t index = (rb_num_t)GET_OPERAND(2); # define INSN_ATTR(x) attr_ ## x ## _opt_invokebuiltin_delegate_leave(bf, index) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, bf); @@ -4326,7 +4232,7 @@ INSN_ENTRY(opt_invokebuiltin_delegate_leave) RESTORE_REGS(); } } -# line 4330 "vm.inc" +# line 4236 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4336,7 +4242,6 @@ INSN_ENTRY(opt_invokebuiltin_delegate_leave) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4353,14 +4258,14 @@ INSN_ENTRY(getlocal_WC_0) /* ### Declare and assign variables. ### */ #line 10 "defs/opt_operand.def" const rb_num_t level = 0; -#line 4357 "vm.inc" +#line 4262 "vm.inc" lindex_t idx = (lindex_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _getlocal_WC_0(idx) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); @@ -4373,7 +4278,7 @@ INSN_ENTRY(getlocal_WC_0) RB_DEBUG_COUNTER_INC(lvar_get); (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); } -# line 4377 "vm.inc" +# line 4282 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4383,7 +4288,6 @@ INSN_ENTRY(getlocal_WC_0) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4400,14 +4304,14 @@ INSN_ENTRY(getlocal_WC_1) /* ### Declare and assign variables. ### */ #line 11 "defs/opt_operand.def" const rb_num_t level = 1; -#line 4404 "vm.inc" +#line 4308 "vm.inc" lindex_t idx = (lindex_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _getlocal_WC_1(idx) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val; /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); @@ -4420,7 +4324,7 @@ INSN_ENTRY(getlocal_WC_1) RB_DEBUG_COUNTER_INC(lvar_get); (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); } -# line 4424 "vm.inc" +# line 4328 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ @@ -4430,7 +4334,6 @@ INSN_ENTRY(getlocal_WC_1) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4447,14 +4350,14 @@ INSN_ENTRY(setlocal_WC_0) /* ### Declare and assign variables. ### */ #line 12 "defs/opt_operand.def" const rb_num_t level = 0; -#line 4451 "vm.inc" +#line 4354 "vm.inc" lindex_t idx = (lindex_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _setlocal_WC_0(idx) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); @@ -4467,14 +4370,13 @@ INSN_ENTRY(setlocal_WC_0) RB_DEBUG_COUNTER_INC(lvar_set); (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); } -# line 4471 "vm.inc" +# line 4374 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4491,14 +4393,14 @@ INSN_ENTRY(setlocal_WC_1) /* ### Declare and assign variables. ### */ #line 13 "defs/opt_operand.def" const rb_num_t level = 1; -#line 4495 "vm.inc" +#line 4397 "vm.inc" lindex_t idx = (lindex_t)GET_OPERAND(1); # define INSN_ATTR(x) attr_ ## x ## _setlocal_WC_1(idx) - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); VALUE val = TOPN(0); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); SETUP_CANARY(leaf); COLLECT_USAGE_INSN(INSN_ATTR(bin)); COLLECT_USAGE_OPERAND(INSN_ATTR(bin), 0, idx); @@ -4511,14 +4413,13 @@ INSN_ENTRY(setlocal_WC_1) RB_DEBUG_COUNTER_INC(lvar_set); (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); } -# line 4515 "vm.inc" +# line 4417 "vm.inc" # undef NAME_OF_CURRENT_INSN /* ### Instruction trailers. ### */ CHECK_VM_STACK_OVERFLOW_FOR_INSN(VM_REG_CFP, INSN_ATTR(retn)); CHECK_CANARY(leaf, INSN_ATTR(bin)); INC_SP(INSN_ATTR(sp_inc)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4535,12 +4436,12 @@ INSN_ENTRY(putobject_INT2FIX_0_) /* ### Declare and assign variables. ### */ #line 15 "defs/opt_operand.def" const VALUE val = INT2FIX(0); -#line 4539 "vm.inc" +#line 4440 "vm.inc" # define INSN_ATTR(x) attr_ ## x ## _putobject_INT2FIX_0_() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); COLLECT_USAGE_INSN(INSN_ATTR(bin)); /* ### Instruction trailers. ### */ @@ -4549,7 +4450,6 @@ INSN_ENTRY(putobject_INT2FIX_0_) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ @@ -4566,12 +4466,12 @@ INSN_ENTRY(putobject_INT2FIX_1_) /* ### Declare and assign variables. ### */ #line 16 "defs/opt_operand.def" const VALUE val = INT2FIX(1); -#line 4570 "vm.inc" +#line 4470 "vm.inc" # define INSN_ATTR(x) attr_ ## x ## _putobject_INT2FIX_1_() - const bool leaf = INSN_ATTR(leaf); + const bool MAYBE_UNUSED(leaf) = INSN_ATTR(leaf); /* ### Instruction preambles. ### */ - if (! leaf) ADD_PC(INSN_ATTR(width)); + ADD_PC(INSN_ATTR(width)); COLLECT_USAGE_INSN(INSN_ATTR(bin)); /* ### Instruction trailers. ### */ @@ -4580,7 +4480,6 @@ INSN_ENTRY(putobject_INT2FIX_1_) TOPN(0) = val; VM_ASSERT(!RB_TYPE_P(TOPN(0), T_NONE)); VM_ASSERT(!RB_TYPE_P(TOPN(0), T_MOVED)); - if (leaf) ADD_PC(INSN_ATTR(width)); # undef INSN_ATTR /* ### Leave the instruction. ### */ diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_call_iseq_optimized.inc b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_call_iseq_optimized.inc similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_call_iseq_optimized.inc rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_call_iseq_optimized.inc diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_callinfo.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_callinfo.h similarity index 92% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_callinfo.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_callinfo.h index ccdf720c..91c92854 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_callinfo.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_callinfo.h @@ -65,8 +65,12 @@ struct rb_callinfo { VALUE argc; }; -#ifndef USE_EMBED_CI +#if !defined(USE_EMBED_CI) || (USE_EMBED_CI+0) +#undef USE_EMBED_CI #define USE_EMBED_CI 1 +#else +#undef USE_EMBED_CI +#define USE_EMBED_CI 0 #endif #if SIZEOF_VALUE == 8 @@ -96,7 +100,9 @@ struct rb_callinfo { static inline bool vm_ci_packed_p(const struct rb_callinfo *ci) { -#if USE_EMBED_CI + if (!USE_EMBED_CI) { + return 0; + } if (LIKELY(((VALUE)ci) & 0x01)) { return 1; } @@ -104,9 +110,6 @@ vm_ci_packed_p(const struct rb_callinfo *ci) VM_ASSERT(IMEMO_TYPE_P(ci, imemo_callinfo)); return 0; } -#else - return 0; -#endif } static inline bool @@ -196,12 +199,10 @@ vm_ci_dump(const struct rb_callinfo *ci) static inline const struct rb_callinfo * vm_ci_new_(ID mid, unsigned int flag, unsigned int argc, const struct rb_callinfo_kwarg *kwarg, const char *file, int line) { -#if USE_EMBED_CI - if (VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg)) { + if (USE_EMBED_CI && VM_CI_EMBEDDABLE_P(mid, flag, argc, kwarg)) { RB_DEBUG_COUNTER_INC(ci_packed); return vm_ci_new_id(mid, flag, argc, kwarg); } -#endif const bool debug = 0; if (debug) ruby_debug_printf("%s:%d ", file, line); @@ -295,6 +296,17 @@ struct rb_callcache { #define VM_CALLCACHE_UNMARKABLE FL_FREEZE #define VM_CALLCACHE_ON_STACK FL_EXIVAR +#define VM_CALLCACHE_IVAR IMEMO_FL_USER0 +#define VM_CALLCACHE_BF IMEMO_FL_USER1 +#define VM_CALLCACHE_SUPER IMEMO_FL_USER2 +#define VM_CALLCACHE_REFINEMENT IMEMO_FL_USER3 + +enum vm_cc_type { + cc_type_normal, // chained from ccs + cc_type_super, + cc_type_refinement, +}; + extern const struct rb_callcache *rb_vm_empty_cc(void); extern const struct rb_callcache *rb_vm_empty_cc_for_super(void); @@ -311,14 +323,39 @@ vm_cc_attr_index_initialize(const struct rb_callcache *cc, shape_id_t shape_id) static inline const struct rb_callcache * vm_cc_new(VALUE klass, const struct rb_callable_method_entry_struct *cme, - vm_call_handler call) + vm_call_handler call, + enum vm_cc_type type) { const struct rb_callcache *cc = (const struct rb_callcache *)rb_imemo_new(imemo_callcache, (VALUE)cme, (VALUE)call, 0, klass); + + switch (type) { + case cc_type_normal: + break; + case cc_type_super: + *(VALUE *)&cc->flags |= VM_CALLCACHE_SUPER; + break; + case cc_type_refinement: + *(VALUE *)&cc->flags |= VM_CALLCACHE_REFINEMENT; + break; + } + vm_cc_attr_index_initialize(cc, INVALID_SHAPE_ID); RB_DEBUG_COUNTER_INC(cc_new); return cc; } +static inline bool +vm_cc_super_p(const struct rb_callcache *cc) +{ + return (cc->flags & VM_CALLCACHE_SUPER) != 0; +} + +static inline bool +vm_cc_refinement_p(const struct rb_callcache *cc) +{ + return (cc->flags & VM_CALLCACHE_REFINEMENT) != 0; +} + #define VM_CC_ON_STACK(clazz, call, aux, cme) \ (struct rb_callcache) { \ .flags = T_IMEMO | \ @@ -438,9 +475,6 @@ vm_cc_valid_p(const struct rb_callcache *cc, const rb_callable_method_entry_t *c /* callcache: mutate */ -#define VM_CALLCACH_IVAR IMEMO_FL_USER0 -#define VM_CALLCACH_BF IMEMO_FL_USER1 - static inline void vm_cc_call_set(const struct rb_callcache *cc, vm_call_handler call) { @@ -460,13 +494,13 @@ vm_cc_attr_index_set(const struct rb_callcache *cc, attr_index_t index, shape_id VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); VM_ASSERT(cc != vm_cc_empty()); *attr_value = (attr_index_t)(index + 1) | ((uintptr_t)(dest_shape_id) << SHAPE_FLAG_SHIFT); - *(VALUE *)&cc->flags |= VM_CALLCACH_IVAR; + *(VALUE *)&cc->flags |= VM_CALLCACHE_IVAR; } static inline bool vm_cc_ivar_p(const struct rb_callcache *cc) { - return (cc->flags & VM_CALLCACH_IVAR) != 0; + return (cc->flags & VM_CALLCACHE_IVAR) != 0; } static inline void @@ -495,13 +529,13 @@ vm_cc_bf_set(const struct rb_callcache *cc, const struct rb_builtin_function *bf VM_ASSERT(IMEMO_TYPE_P(cc, imemo_callcache)); VM_ASSERT(cc != vm_cc_empty()); *(const struct rb_builtin_function **)&cc->aux_.bf = bf; - *(VALUE *)&cc->flags |= VM_CALLCACH_BF; + *(VALUE *)&cc->flags |= VM_CALLCACHE_BF; } static inline bool vm_cc_bf_p(const struct rb_callcache *cc) { - return (cc->flags & VM_CALLCACH_BF) != 0; + return (cc->flags & VM_CALLCACHE_BF) != 0; } static inline void diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_core.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_core.h similarity index 97% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_core.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_core.h index 7cdd4067..f3e5a04f 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_core.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_core.h @@ -132,18 +132,9 @@ extern int ruby_assert_critical_section_entered; #define RUBY_NSIG NSIG #if defined(SIGCLD) -# define RUBY_SIGCHLD (SIGCLD) +# define RUBY_SIGCHLD (SIGCLD) #elif defined(SIGCHLD) -# define RUBY_SIGCHLD (SIGCHLD) -#else -# define RUBY_SIGCHLD (0) -#endif - -/* platforms with broken or non-existent SIGCHLD work by polling */ -#if defined(__APPLE__) -# define SIGCHLD_LOSSY (1) -#else -# define SIGCHLD_LOSSY (0) +# define RUBY_SIGCHLD (SIGCHLD) #endif #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__) @@ -191,9 +182,6 @@ void *rb_register_sigaltstack(void *); #if OPT_DIRECT_THREADED_CODE #undef OPT_DIRECT_THREADED_CODE #endif /* OPT_DIRECT_THREADED_CODE */ -#if OPT_STACK_CACHING -#undef OPT_STACK_CACHING -#endif /* OPT_STACK_CACHING */ #endif /* OPT_CALL_THREADED_CODE */ void rb_vm_encoded_insn_data_table_init(void); @@ -290,7 +278,7 @@ union iseq_inline_storage_entry { }; struct rb_calling_info { - const struct rb_callinfo *ci; + const struct rb_call_data *cd; const struct rb_callcache *cc; VALUE block_handler; VALUE recv; @@ -515,10 +503,17 @@ struct rb_iseq_constant_body { const rb_iseq_t *mandatory_only_iseq; #if USE_RJIT || USE_YJIT - // Function pointer for JIT code - rb_jit_func_t jit_func; - // Number of total calls with jit_exec() - long unsigned total_calls; + // Function pointer for JIT code on jit_exec() + rb_jit_func_t jit_entry; + // Number of calls on jit_exec() + long unsigned jit_entry_calls; +#endif + +#if USE_YJIT + // Function pointer for JIT code on jit_exec_exception() + rb_jit_func_t jit_exception; + // Number of calls on jit_exec_exception() + long unsigned jit_exception_calls; #endif #if USE_RJIT @@ -557,22 +552,21 @@ struct rb_iseq_struct { #define ISEQ_BODY(iseq) ((iseq)->body) -#ifndef USE_LAZY_LOAD +#if !defined(USE_LAZY_LOAD) || !(USE_LAZY_LOAD+0) #define USE_LAZY_LOAD 0 #endif -#if USE_LAZY_LOAD -const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq); +#if !USE_LAZY_LOAD +static inline const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq) {return 0;} #endif +const rb_iseq_t *rb_iseq_complete(const rb_iseq_t *iseq); static inline const rb_iseq_t * rb_iseq_check(const rb_iseq_t *iseq) { -#if USE_LAZY_LOAD - if (ISEQ_BODY(iseq) == NULL) { + if (USE_LAZY_LOAD && ISEQ_BODY(iseq) == NULL) { rb_iseq_complete((rb_iseq_t *)iseq); } -#endif return iseq; } @@ -819,19 +813,16 @@ struct rb_block { }; typedef struct rb_control_frame_struct { - const VALUE *pc; /* cfp[0] */ - VALUE *sp; /* cfp[1] */ - const rb_iseq_t *iseq; /* cfp[2] */ - VALUE self; /* cfp[3] / block[0] */ - const VALUE *ep; /* cfp[4] / block[1] */ - const void *block_code; /* cfp[5] / block[2] */ /* iseq or ifunc or forwarded block handler */ - VALUE *__bp__; /* cfp[6] */ /* outside vm_push_frame, use vm_base_ptr instead. */ - + const VALUE *pc; // cfp[0] + VALUE *sp; // cfp[1] + const rb_iseq_t *iseq; // cfp[2] + VALUE self; // cfp[3] / block[0] + const VALUE *ep; // cfp[4] / block[1] + const void *block_code; // cfp[5] / block[2] -- iseq, ifunc, or forwarded block handler + void *jit_return; // cfp[6] -- return address for JIT code #if VM_DEBUG_BP_CHECK - VALUE *bp_check; /* cfp[7] */ + VALUE *bp_check; // cfp[7] #endif - // Return address for YJIT code - void *jit_return; } rb_control_frame_t; extern const rb_data_type_t ruby_threadptr_data_type; @@ -1559,12 +1550,6 @@ vm_block_handler_verify(MAYBE_UNUSED(VALUE block_handler)) (vm_block_handler_type(block_handler), 1)); } -static inline int -vm_cfp_forwarded_bh_p(const rb_control_frame_t *cfp, VALUE block_handler) -{ - return ((VALUE) cfp->block_code) == block_handler; -} - static inline enum rb_block_type vm_block_type(const struct rb_block *block) { @@ -1695,11 +1680,7 @@ VALUE rb_proc_dup(VALUE self); /* for debug */ extern void rb_vmdebug_stack_dump_raw(const rb_execution_context_t *ec, const rb_control_frame_t *cfp); extern void rb_vmdebug_debug_print_pre(const rb_execution_context_t *ec, const rb_control_frame_t *cfp, const VALUE *_pc); -extern void rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const rb_control_frame_t *cfp -#if OPT_STACK_CACHING - , VALUE reg_a, VALUE reg_b -#endif -); +extern void rb_vmdebug_debug_print_post(const rb_execution_context_t *ec, const rb_control_frame_t *cfp); #define SDR() rb_vmdebug_stack_dump_raw(GET_EC(), GET_EC()->cfp) #define SDR2(cfp) rb_vmdebug_stack_dump_raw(GET_EC(), (cfp)) @@ -1771,6 +1752,7 @@ rb_thread_t * ruby_thread_from_native(void); int ruby_thread_set_native(rb_thread_t *th); int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp); void rb_vm_rewind_cfp(rb_execution_context_t *ec, rb_control_frame_t *cfp); +void rb_vm_env_write(const VALUE *ep, int index, VALUE v); VALUE rb_vm_bh_to_procval(const rb_execution_context_t *ec, VALUE block_handler); void rb_vm_register_special_exception_str(enum ruby_special_exceptions sp, VALUE exception_class, VALUE mesg); diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_debug.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_debug.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_debug.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_debug.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_exec.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_exec.h similarity index 94% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_exec.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_exec.h index a00bd502..152410a6 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_exec.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_exec.h @@ -21,11 +21,7 @@ typedef rb_iseq_t *ISEQ; #define DEBUG_ENTER_INSN(insn) \ rb_vmdebug_debug_print_pre(ec, GET_CFP(), GET_PC()); -#if OPT_STACK_CACHING -#define SC_REGS() , reg_a, reg_b -#else #define SC_REGS() -#endif #define DEBUG_END_INSN() \ rb_vmdebug_debug_print_post(ec, GET_CFP() SC_REGS()); @@ -40,10 +36,6 @@ typedef rb_iseq_t *ISEQ; #define throwdebug if(0)ruby_debug_printf /* #define throwdebug ruby_debug_printf */ -#ifndef USE_INSNS_COUNTER -#define USE_INSNS_COUNTER 0 -#endif - /************************************************/ #if defined(DISPATCH_XXX) error ! @@ -80,8 +72,7 @@ error ! (reg_cfp->pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded), \ RSTRING_PTR(rb_iseq_path(reg_cfp->iseq)), \ rb_iseq_line_no(reg_cfp->iseq, reg_pc - ISEQ_BODY(reg_cfp->iseq)->iseq_encoded)); \ - } \ - if (USE_INSNS_COUNTER) vm_insns_counter_count_insn(BIN(insn)); + } #define INSN_DISPATCH_SIG(insn) @@ -174,10 +165,20 @@ default: \ #define THROW_EXCEPTION(exc) return (VALUE)(exc) #endif +// Run the interpreter from the JIT +#define VM_EXEC(ec, val) do { \ + if (val == Qundef) { \ + VM_ENV_FLAGS_SET(ec->cfp->ep, VM_FRAME_FLAG_FINISH); \ + val = vm_exec(ec); \ + } \ +} while (0) + +// Run the JIT from the interpreter #define JIT_EXEC(ec, val) do { \ rb_jit_func_t func; \ if (val == Qundef && (func = jit_compile(ec))) { \ val = func(ec, ec->cfp); \ + RESTORE_REGS(); /* fix cfp for tailcall */ \ if (ec->tag->state) THROW_EXCEPTION(val); \ } \ } while (0) diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_insnhelper.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_insnhelper.h similarity index 88% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_insnhelper.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_insnhelper.h index ac60c40e..90372853 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_insnhelper.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_insnhelper.h @@ -20,30 +20,29 @@ RUBY_EXTERN rb_serial_t ruby_vm_global_cvar_state; # define RJIT_STATS RUBY_DEBUG #endif +#if USE_YJIT // We want vm_insns_count on any YJIT-enabled build +// Increment vm_insns_count for --yjit-stats. We increment this even when +// --yjit or --yjit-stats is not used because branching to skip it is slower. +// We also don't use ATOMIC_INC for performance, allowing inaccuracy on Ractors. +#define YJIT_COLLECT_USAGE_INSN(insn) rb_vm_insns_count++ +#else +#define YJIT_COLLECT_USAGE_INSN(insn) // none +#endif + +#if RJIT_STATS +#define RJIT_COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn) +#else +#define RJIT_COLLECT_USAGE_INSN(insn) // none +#endif + #if VM_COLLECT_USAGE_DETAILS #define COLLECT_USAGE_INSN(insn) vm_collect_usage_insn(insn) #define COLLECT_USAGE_OPERAND(insn, n, op) vm_collect_usage_operand((insn), (n), ((VALUE)(op))) - #define COLLECT_USAGE_REGISTER(reg, s) vm_collect_usage_register((reg), (s)) -#elif RJIT_STATS && YJIT_STATS -// Both flags could be enabled at the same time. You need to call both in that case. -#define COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn); rb_yjit_collect_vm_usage_insn(insn) -#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */ -#define COLLECT_USAGE_REGISTER(reg, s) /* none */ -#elif RJIT_STATS -// for --rjit-stats -#define COLLECT_USAGE_INSN(insn) rb_rjit_collect_vm_usage_insn(insn) -#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */ -#define COLLECT_USAGE_REGISTER(reg, s) /* none */ -#elif YJIT_STATS -/* for --yjit-stats */ -#define COLLECT_USAGE_INSN(insn) rb_yjit_collect_vm_usage_insn(insn) -#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */ -#define COLLECT_USAGE_REGISTER(reg, s) /* none */ #else -#define COLLECT_USAGE_INSN(insn) /* none */ -#define COLLECT_USAGE_OPERAND(insn, n, op) /* none */ -#define COLLECT_USAGE_REGISTER(reg, s) /* none */ +#define COLLECT_USAGE_INSN(insn) YJIT_COLLECT_USAGE_INSN(insn); RJIT_COLLECT_USAGE_INSN(insn) +#define COLLECT_USAGE_OPERAND(insn, n, op) // none +#define COLLECT_USAGE_REGISTER(reg, s) // none #endif /**********************************************************/ @@ -182,10 +181,8 @@ CC_SET_FASTPATH(const struct rb_callcache *cc, vm_call_handler func, bool enable /**********************************************************/ #define CALL_SIMPLE_METHOD() do { \ - rb_snum_t x = leaf ? INSN_ATTR(width) : 0; \ - rb_snum_t y = attr_width_opt_send_without_block(0); \ - rb_snum_t z = x - y; \ - ADD_PC(z); \ + rb_snum_t insn_width = attr_width_opt_send_without_block(0); \ + ADD_PC(-insn_width); \ DISPATCH_ORIGINAL_INSN(opt_send_without_block); \ } while (0) diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_opts.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_opts.h similarity index 93% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_opts.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_opts.h index 86616649..7b3caf47 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_opts.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_opts.h @@ -54,17 +54,12 @@ #define OPT_OPERANDS_UNIFICATION 1 #define OPT_INSTRUCTIONS_UNIFICATION 0 #define OPT_UNIFY_ALL_COMBINATION 0 -#define OPT_STACK_CACHING 0 /* misc */ #ifndef OPT_SUPPORT_JOKE #define OPT_SUPPORT_JOKE 0 #endif -#ifndef OPT_SUPPORT_CALL_C_FUNCTION -#define OPT_SUPPORT_CALL_C_FUNCTION 0 -#endif - #ifndef VM_COLLECT_USAGE_DETAILS #define VM_COLLECT_USAGE_DETAILS 0 #endif diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_sync.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_sync.h similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/vm_sync.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/vm_sync.h diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/vmtc.inc b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/vmtc.inc similarity index 100% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/vmtc.inc rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/vmtc.inc diff --git a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/yjit.h b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/yjit.h similarity index 86% rename from lib/debase/ruby_core_source/ruby-3.3.0-preview1/yjit.h rename to lib/debase/ruby_core_source/ruby-3.3.0-preview2/yjit.h index a640d598..d54bd7e0 100644 --- a/lib/debase/ruby_core_source/ruby-3.3.0-preview1/yjit.h +++ b/lib/debase/ruby_core_source/ruby-3.3.0-preview2/yjit.h @@ -27,13 +27,12 @@ // Expose these as declarations since we are building YJIT. bool rb_yjit_enabled_p(void); bool rb_yjit_compile_new_iseqs(void); -unsigned rb_yjit_call_threshold(void); +bool rb_yjit_threshold_hit(const rb_iseq_t *const iseq, unsigned long total_calls); void rb_yjit_invalidate_all_method_lookup_assumptions(void); void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme); -void rb_yjit_collect_vm_usage_insn(int insn); void rb_yjit_collect_binding_alloc(void); void rb_yjit_collect_binding_set(void); -bool rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec); +void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception); void rb_yjit_init(void); void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop); void rb_yjit_constant_state_changed(ID id); @@ -50,13 +49,12 @@ void rb_yjit_tracing_invalidate_all(void); static inline bool rb_yjit_enabled_p(void) { return false; } static inline bool rb_yjit_compile_new_iseqs(void) { return false; } -static inline unsigned rb_yjit_call_threshold(void) { return UINT_MAX; } +static inline bool rb_yjit_threshold_hit(const rb_iseq_t *const iseq, unsigned long total_calls) { return false; } static inline void rb_yjit_invalidate_all_method_lookup_assumptions(void) {} static inline void rb_yjit_cme_invalidate(rb_callable_method_entry_t *cme) {} -static inline void rb_yjit_collect_vm_usage_insn(int insn) {} static inline void rb_yjit_collect_binding_alloc(void) {} static inline void rb_yjit_collect_binding_set(void) {} -static inline bool rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec) { return false; } +static inline void rb_yjit_compile_iseq(const rb_iseq_t *iseq, rb_execution_context_t *ec, bool jit_exception) {} static inline void rb_yjit_init(void) {} static inline void rb_yjit_bop_redefined(int redefined_flag, enum ruby_basic_operators bop) {} static inline void rb_yjit_constant_state_changed(ID id) {}