Project

General

Profile

Feature #10328 ยป 0001-make-OPT_SUPPORT_JOKE-a-proper-VM-option.patch

normalperson (Eric Wong), 10/05/2014 09:14 PM

View differences:

compile.c
ADD_INSN(ret, iseq->compile_data->last_line, leave);
}
#if SUPPORT_JOKE
#if OPT_SUPPORT_JOKE
if (iseq->compile_data->labels_table) {
validate_labels(iseq, iseq->compile_data->labels_table);
}
......
INIT_ANCHOR(recv);
INIT_ANCHOR(args);
#if SUPPORT_JOKE
#if OPT_SUPPORT_JOKE
if (nd_type(node) == NODE_VCALL) {
ID id_bitblt;
ID id_answer;
eval.c
ID id_cause;
CONST_ID(id_cause, "cause");
#if SUPPORT_JOKE
#if OPT_SUPPORT_JOKE
if (NIL_P(cause)) {
ID id_true_cause;
CONST_ID(id_true_cause, "true_cause");
iseq.h
int label_no;
int node_level;
const rb_compile_option_t *option;
#if SUPPORT_JOKE
#if OPT_SUPPORT_JOKE
st_table *labels_table;
#endif
};
tool/instruction.rb
def load_insns_def file
body = insn = opes = pops = rets = nil
comment = ''
support_joke = vm_opt?('SUPPORT_JOKE')
vpath.open(file) {|f|
f.instance_variable_set(:@line_no, 0)
......
# end instruction body
when /^\}/
if insn_in
body.instance_variable_set(:@line_no, line_no)
body.instance_variable_set(:@file, f.path)
insn = make_insn(insn, opes, pops, rets, comment, body, sp_inc)
if comment[:c] != "joke" || support_joke
body.instance_variable_set(:@line_no, line_no)
body.instance_variable_set(:@file, f.path)
insn = make_insn(insn, opes, pops, rets, comment, body, sp_inc)
end
insn_in = false
comment = ''
end
vm_opts.h
#define OPT_STACK_CACHING 0
/* misc */
#define SUPPORT_JOKE 0
#define OPT_SUPPORT_JOKE 0
#ifndef VM_COLLECT_USAGE_DETAILS
#define VM_COLLECT_USAGE_DETAILS 0
-
    (1-1/1)