Avoid defining unused instructions
This commit is contained in:
parent
355ccdeae5
commit
1a9cc3b27c
Notes:
git
2019-09-03 14:23:11 +09:00
@ -154,7 +154,7 @@ env:
|
|||||||
<<: *cron-only
|
<<: *cron-only
|
||||||
<<: *make-test-only
|
<<: *make-test-only
|
||||||
env:
|
env:
|
||||||
- BEFORE_INSTALL="sed vm_opts.h -e 's/SUPPORT_JOKE *0/SUPPORT_JOKE 1/' -i"
|
- BEFORE_INSTALL="sed vm_opts.h -e 's/OPT_SUPPORT_JOKE *0/OPT_SUPPORT_JOKE 1/' -i"
|
||||||
|
|
||||||
- &WITH_COROUTINE_UCONTEXT
|
- &WITH_COROUTINE_UCONTEXT
|
||||||
name: COROUTINE=ucontext
|
name: COROUTINE=ucontext
|
||||||
|
@ -624,7 +624,7 @@ reverse
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* for stack caching. */
|
/* for stack caching. */
|
||||||
DEFINE_INSN
|
DEFINE_INSN_IF(STACK_CACHING)
|
||||||
reput
|
reput
|
||||||
()
|
()
|
||||||
(..., VALUE val)
|
(..., VALUE val)
|
||||||
@ -1485,7 +1485,7 @@ opt_call_c_function
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* BLT */
|
/* BLT */
|
||||||
DEFINE_INSN
|
DEFINE_INSN_IF(SUPPORT_JOKE)
|
||||||
bitblt
|
bitblt
|
||||||
()
|
()
|
||||||
()
|
()
|
||||||
@ -1495,7 +1495,7 @@ bitblt
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* The Answer to Life, the Universe, and Everything */
|
/* The Answer to Life, the Universe, and Everything */
|
||||||
DEFINE_INSN
|
DEFINE_INSN_IF(SUPPORT_JOKE)
|
||||||
answer
|
answer
|
||||||
()
|
()
|
||||||
()
|
()
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
# details.
|
# details.
|
||||||
|
|
||||||
require_relative '../helpers/scanner'
|
require_relative '../helpers/scanner'
|
||||||
|
require_relative './vm_opts_h'
|
||||||
|
|
||||||
json = []
|
json = []
|
||||||
scanner = RubyVM::Scanner.new '../../../insns.def'
|
scanner = RubyVM::Scanner.new '../../../insns.def'
|
||||||
@ -33,7 +34,7 @@ grammar = %r'
|
|||||||
(?<pragma:name> \g<ident> ) \g<ws>*
|
(?<pragma:name> \g<ident> ) \g<ws>*
|
||||||
= \g<ws>*
|
= \g<ws>*
|
||||||
(?<pragma:expr> .+?; ) \g<ws>* ){0}
|
(?<pragma:expr> .+?; ) \g<ws>* ){0}
|
||||||
(?<insn> DEFINE_INSN \g<ws>+
|
(?<insn> DEFINE_INSN(_IF\((?<insn:if>\w+)\))? \g<ws>+
|
||||||
(?<insn:name> \g<ident> ) \g<ws>*
|
(?<insn:name> \g<ident> ) \g<ws>*
|
||||||
[(] \g<ws>* (?<insn:opes> \g<argv> ) \g<ws>* [)] \g<ws>*
|
[(] \g<ws>* (?<insn:opes> \g<argv> ) \g<ws>* [)] \g<ws>*
|
||||||
[(] \g<ws>* (?<insn:pops> \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)
|
l1 = scanner.scan!(/\G#{grammar}\g<insn>/o)
|
||||||
name = scanner["insn:name"]
|
name = scanner["insn:name"]
|
||||||
|
opt = scanner["insn:if"]
|
||||||
ope = split.(scanner["insn:opes"])
|
ope = split.(scanner["insn:opes"])
|
||||||
pop = split.(scanner["insn:pops"])
|
pop = split.(scanner["insn:pops"])
|
||||||
ret = split.(scanner["insn:rets"])
|
ret = split.(scanner["insn:rets"])
|
||||||
@ -67,21 +69,23 @@ until scanner.eos? do
|
|||||||
end
|
end
|
||||||
|
|
||||||
l3 = scanner.scan!(/\G#{grammar}\g<block>/o)
|
l3 = scanner.scan!(/\G#{grammar}\g<block>/o)
|
||||||
json << {
|
if opt.nil? || RubyVM::VmOptsH[opt]
|
||||||
name: name,
|
json << {
|
||||||
location: [path, l1],
|
|
||||||
signature: {
|
|
||||||
name: name,
|
name: name,
|
||||||
ope: ope,
|
location: [path, l1],
|
||||||
pop: pop,
|
signature: {
|
||||||
ret: ret,
|
name: name,
|
||||||
},
|
ope: ope,
|
||||||
attributes: attrs,
|
pop: pop,
|
||||||
expr: {
|
ret: ret,
|
||||||
location: [path, l3],
|
},
|
||||||
expr: scanner["block"],
|
attributes: attrs,
|
||||||
},
|
expr: {
|
||||||
}
|
location: [path, l3],
|
||||||
|
expr: scanner["block"],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
RubyVM::InsnsDef = json
|
RubyVM::InsnsDef = json
|
||||||
|
@ -61,7 +61,8 @@
|
|||||||
#define OPT_STACK_CACHING 0
|
#define OPT_STACK_CACHING 0
|
||||||
|
|
||||||
/* misc */
|
/* misc */
|
||||||
#define SUPPORT_JOKE 0
|
#define OPT_SUPPORT_JOKE 0
|
||||||
|
#define SUPPORT_JOKE OPT_SUPPORT_JOKE
|
||||||
|
|
||||||
#ifndef VM_COLLECT_USAGE_DETAILS
|
#ifndef VM_COLLECT_USAGE_DETAILS
|
||||||
#define VM_COLLECT_USAGE_DETAILS 0
|
#define VM_COLLECT_USAGE_DETAILS 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user