ruby-changes:72633
From: Nobuyoshi <ko1@a...>
Date: Fri, 22 Jul 2022 02:09:36 +0900 (JST)
Subject: [ruby-changes:72633] 4af0dd36fc (master): Remove the file that was probably added by accident [ci skip]
https://git.ruby-lang.org/ruby.git/commit/?id=4af0dd36fc From 4af0dd36fcc3a5c9a8ec73a28f91ae3ccf94364d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 22 Jul 2022 02:07:51 +0900 Subject: Remove the file that was probably added by accident [ci skip] --- mjit_instruction.rb | 1034 --------------------------------------------------- 1 file changed, 1034 deletions(-) delete mode 100644 mjit_instruction.rb diff --git a/mjit_instruction.rb b/mjit_instruction.rb deleted file mode 100644 index 04f0db3b0a..0000000000 --- a/mjit_instruction.rb +++ /dev/null @@ -1,1034 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/#L0 -module RubyVM::MJIT - Instruction = Struct.new(:expr) - - INSTRUCTIONS = { - nop: Instruction.new( - expr: <<-EXPR, -{ - /* none */ -} - EXPR - ), - getlocal: Instruction.new( - expr: <<-EXPR, -{ - val = *(vm_get_ep(GET_EP(), level) - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); -} - EXPR - ), - setlocal: Instruction.new( - expr: <<-EXPR, -{ - vm_env_write(vm_get_ep(GET_EP(), level), -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); -} - EXPR - ), - getblockparam: Instruction.new( - expr: <<-EXPR, -{ - const VALUE *ep = vm_get_ep(GET_EP(), level); - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - - if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) { - val = rb_vm_bh_to_procval(ec, VM_ENV_BLOCK_HANDLER(ep)); - vm_env_write(ep, -(int)idx, val); - VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); - } - else { - val = *(ep - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); - } -} - EXPR - ), - setblockparam: Instruction.new( - expr: <<-EXPR, -{ - const VALUE *ep = vm_get_ep(GET_EP(), level); - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - - vm_env_write(ep, -(int)idx, val); - RB_DEBUG_COUNTER_INC(lvar_set); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_set_dynamic, level > 0); - - VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); -} - EXPR - ), - getblockparamproxy: Instruction.new( - expr: <<-EXPR, -{ - const VALUE *ep = vm_get_ep(GET_EP(), level); - VM_ASSERT(VM_ENV_LOCAL_P(ep)); - - if (!VM_ENV_FLAGS(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM)) { - VALUE block_handler = VM_ENV_BLOCK_HANDLER(ep); - - if (block_handler) { - switch (vm_block_handler_type(block_handler)) { - case block_handler_type_iseq: - case block_handler_type_ifunc: - val = rb_block_param_proxy; - break; - case block_handler_type_symbol: - val = rb_sym_to_proc(VM_BH_TO_SYMBOL(block_handler)); - goto INSN_LABEL(set); - case block_handler_type_proc: - val = VM_BH_TO_PROC(block_handler); - goto INSN_LABEL(set); - default: - VM_UNREACHABLE(getblockparamproxy); - } - } - else { - val = Qnil; - INSN_LABEL(set): - vm_env_write(ep, -(int)idx, val); - VM_ENV_FLAGS_SET(ep, VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM); - } - } - else { - val = *(ep - idx); - RB_DEBUG_COUNTER_INC(lvar_get); - (void)RB_DEBUG_COUNTER_INC_IF(lvar_get_dynamic, level > 0); - } -} - EXPR - ), - getspecial: Instruction.new( - expr: <<-EXPR, -{ - val = vm_getspecial(ec, GET_LEP(), key, type); -} - EXPR - ), - setspecial: Instruction.new( - expr: <<-EXPR, -{ - lep_svar_set(ec, GET_LEP(), key, obj); -} - EXPR - ), - getinstancevariable: Instruction.new( - expr: <<-EXPR, -{ - val = vm_getinstancevariable(GET_ISEQ(), GET_SELF(), id, ic); -} - EXPR - ), - setinstancevariable: Instruction.new( - expr: <<-EXPR, -{ - vm_setinstancevariable(GET_ISEQ(), GET_SELF(), id, val, ic); -} - EXPR - ), - getclassvariable: Instruction.new( - expr: <<-EXPR, -{ - rb_control_frame_t *cfp = GET_CFP(); - val = vm_getclassvariable(GET_ISEQ(), cfp, id, ic); -} - EXPR - ), - setclassvariable: Instruction.new( - expr: <<-EXPR, -{ - vm_ensure_not_refinement_module(GET_SELF()); - vm_setclassvariable(GET_ISEQ(), GET_CFP(), id, val, ic); -} - EXPR - ), - getconstant: Instruction.new( - expr: <<-EXPR, -{ - val = vm_get_ev_const(ec, klass, id, allow_nil == Qtrue, 0); -} - EXPR - ), - setconstant: Instruction.new( - expr: <<-EXPR, -{ - vm_check_if_namespace(cbase); - vm_ensure_not_refinement_module(GET_SELF()); - rb_const_set(cbase, id, val); -} - EXPR - ), - getglobal: Instruction.new( - expr: <<-EXPR, -{ - val = rb_gvar_get(gid); -} - EXPR - ), - setglobal: Instruction.new( - expr: <<-EXPR, -{ - rb_gvar_set(gid, val); -} - EXPR - ), - putnil: Instruction.new( - expr: <<-EXPR, -{ - val = Qnil; -} - EXPR - ), - putself: Instruction.new( - expr: <<-EXPR, -{ - val = GET_SELF(); -} - EXPR - ), - putobject: Instruction.new( - expr: <<-EXPR, -{ - /* */ -} - EXPR - ), - putspecialobject: Instruction.new( - expr: <<-EXPR, -{ - enum vm_special_object_type type; - - type = (enum vm_special_object_type)value_type; - val = vm_get_special_object(GET_EP(), type); -} - EXPR - ), - putstring: Instruction.new( - expr: <<-EXPR, -{ - val = rb_ec_str_resurrect(ec, str); -} - EXPR - ), - concatstrings: Instruction.new( - expr: <<-EXPR, -{ - val = rb_str_concat_literals(num, STACK_ADDR_FROM_TOP(num)); -} - EXPR - ), - anytostring: Instruction.new( - expr: <<-EXPR, -{ - val = rb_obj_as_string_result(str, val); -} - EXPR - ), - toregexp: Instruction.new( - expr: <<-EXPR, -{ - const VALUE ary = rb_ary_tmp_new_from_values(0, cnt, STACK_ADDR_FROM_TOP(cnt)); - val = rb_reg_new_ary(ary, (int)opt); - rb_ary_clear(ary); -} - EXPR - ), - intern: Instruction.new( - expr: <<-EXPR, -{ - sym = rb_str_intern(str); -} - EXPR - ), - newarray: Instruction.new( - expr: <<-EXPR, -{ - val = rb_ec_ary_new_from_values(ec, num, STACK_ADDR_FROM_TOP(num)); -} - EXPR - ), - newarraykwsplat: Instruction.new( - expr: <<-EXPR, -{ - if (RHASH_EMPTY_P(*STACK_ADDR_FROM_TOP(1))) { - val = rb_ary_new4(num-1, STACK_ADDR_FROM_TOP(num)); - } - else { - val = rb_ary_new4(num, STACK_ADDR_FROM_TOP(num)); - } -} - EXPR - ), - duparray: Instruction.new( - expr: <<-EXPR, -{ - RUBY_DTRACE_CREATE_HOOK(ARRAY, RARRAY_LEN(ary)); - val = rb_ary_resurrect(ary); -} - EXPR - ), - duphash: Instruction.new( - expr: <<-EXPR, -{ - RUBY_DTRACE_CREATE_HOOK(HASH, RHASH_SIZE(hash) << 1); - val = rb_hash_resurrect(hash); -} - EXPR - ), - expandarray: Instruction.new( - expr: <<-EXPR, -{ - vm_expandarray(GET_SP(), ary, num, (int)flag); -} - EXPR - ), - concatarray: Instruction.new( - expr: <<-EXPR, -{ - ary = vm_concat_array(ary1, ary2); -} - EXPR - ), - splatarray: Instruction.new( - expr: <<-EXPR, -{ - obj = vm_splat_array(flag, ary); -} - EXPR - ), - newhash: Instruction.new( - expr: <<-EXPR, -{ - RUBY_DTRACE_CREATE_HOOK(HASH, num); - - if (num) { - val = rb_hash_new_with_size(num / 2); - rb_hash_bulk_insert(num, STACK_ADDR_FROM_TOP(num), val); - } - else { - val = rb_hash_new(); - } -} - EXPR - ), - newrange: Instruction.new( - expr: <<-EXPR, -{ - val = rb_range_new(low, high, (int)flag); -} - EXPR - ), - pop: Instruction.new( - expr: <<-EXPR, -{ - (void)val; - /* none */ -} - EXPR - ), - dup: Instruction.new( - expr: <<-EXPR, -{ - val1 = val2 = val; -} - EXPR - ), - dupn: Instruction.new( - expr: <<-EXPR, -{ - void *dst = GET_SP(); - void *src = STACK_ADDR_FROM_TOP(n); - - MEMCPY(dst, src, VALUE, n); -} - EXPR - ), - swap: Instruction.new( - expr: <<-EXPR, -{ - /* none */ -} - EXPR - ), - topn: Instruction.new( - expr: <<-EXPR, -{ - val = TOPN(n); -} - EXPR - ), - setn: Instruction.new( - expr: <<-EXPR, -{ - TOPN(n) = val; -} - EXPR - ), - adjuststack: Instruction.new( - expr: <<-EXPR, -{ - /* none */ -} - EXPR - ), - defined: Instruction.new( - expr: <<-EXPR, -{ - val = Qnil; - if (vm_defined(ec, GET_CFP(), op_type, obj, v)) { - val = pushval; - } -} - EXPR - ), - checkmatch: Instruction.new( - expr: <<-EXPR, -{ - result = vm_check_match(ec, target, pattern, flag); -} - EXPR - ), - checkkeyword: Instruction.new( - expr: <<-EXPR, -{ - ret = vm_check_keyword(kw_bits_index, keyword_index, GET_EP()); -} - EXPR - ), - checktype: Instruction.new( - expr: <<-EXPR, -{ - ret = RBOOL(TYPE(val) == (int)type); -} - EXPR - ), - defineclass: Instruction.new( - expr: <<-EXPR, -{ - VALUE klass = vm_find_or_create_class_by_id(id, flags, cbase, super); - - rb_iseq_check(class_iseq); - - /* enter scope */ - vm_push_frame(ec, class_iseq, VM_FRAME_MAGIC_CLASS | VM_ENV_FLAG_LOCAL, klass, - GET_BLOCK_HANDLER(), - (VALUE)vm_cref_push(ec, klass, NULL, FALSE, FALSE), - ISEQ_BODY(class_iseq)->iseq_encoded, GET_SP(), - ISEQ_BODY(class_iseq)->local_table_size, - ISEQ_BODY(class_iseq)->stack_max); - RESTORE_REGS(); - NEXT_INSN(); -} - EXPR - ), - definemethod: Instruction.new( - expr: <<-EXPR, -{ - vm_define_method(ec, Qnil, id, (VALUE (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/