diff options
author | Takashi Kokubun <[email protected]> | 2019-09-03 02:51:48 +0900 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2019-09-03 14:22:44 +0900 |
commit | 1a9cc3b27c020c33c87d8b4fe659243aacfeedf3 () | |
tree | a42b16de623a5e7236bf326a185444ff1985d2cb | |
parent | 355ccdeae52cde250f09675e9d5e65b3ddc41f2e (diff) |
Avoid defining unused instructions
Notes: Merged: https://.com/ruby/ruby/pull/2420
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | insns.def | 6 | ||||
-rw-r--r-- | tool/ruby_vm/loaders/insns_def.rb | 34 | ||||
-rw-r--r-- | vm_opts.h | 3 |
4 files changed, 25 insertions, 20 deletions
@@ -154,7 +154,7 @@ env: <<: *cron-only <<: *make-test-only env: - - BEFORE_INSTALL="sed vm_opts.h -e 's/SUPPORT_JOKE *0/SUPPORT_JOKE 1/' -i" - &WITH_COROUTINE_UCONTEXT name: COROUTINE=ucontext @@ -624,7 +624,7 @@ reverse } /* for stack caching. */ -DEFINE_INSN reput () (..., VALUE val) @@ -1485,7 +1485,7 @@ opt_call_c_function } /* BLT */ -DEFINE_INSN bitblt () () @@ -1495,7 +1495,7 @@ bitblt } /* The Answer to Life, the Universe, and Everything */ -DEFINE_INSN answer () () @@ -11,6 +11,7 @@ # details. require_relative '../helpers/scanner' json = [] scanner = RubyVM::Scanner.new '../../../insns.def' @@ -33,7 +34,7 @@ grammar = %r' (?<pragma:name> \g<ident> ) \g<ws>* = \g<ws>* (?<pragma:expr> .+?; ) \g<ws>* ){0} - (?<insn> DEFINE_INSN \g<ws>+ (?<insn:name> \g<ident> ) \g<ws>* [(] \g<ws>* (?<insn:opes> \g<argv> ) \g<ws>* [)] \g<ws>* [(] \g<ws>* (?<insn:pops> \g<argv> ) \g<ws>* [)] \g<ws>* @@ -52,6 +53,7 @@ until scanner.eos? do l1 = scanner.scan!(/\G#{grammar}\g<insn>/o) name = scanner["insn:name"] ope = split.(scanner["insn:opes"]) pop = split.(scanner["insn:pops"]) ret = split.(scanner["insn:rets"]) @@ -67,21 +69,23 @@ until scanner.eos? do end l3 = scanner.scan!(/\G#{grammar}\g<block>/o) - json << { - name: name, - location: [path, l1], - signature: { name: name, - ope: ope, - pop: pop, - ret: ret, - }, - attributes: attrs, - expr: { - location: [path, l3], - expr: scanner["block"], - }, - } end RubyVM::InsnsDef = json @@ -61,7 +61,8 @@ #define OPT_STACK_CACHING 0 /* misc */ -#define SUPPORT_JOKE 0 #ifndef VM_COLLECT_USAGE_DETAILS #define VM_COLLECT_USAGE_DETAILS 0 |