Feature #11371 ยป 0001-parse.y-struct-parser_params-pack-to-four-cache-line.patch
| parse.y | ||
|---|---|---|
|
NODE *heap;
|
||
|
YYSTYPE *parser_yylval;
|
||
|
VALUE eofp;
|
||
|
NODE *parser_lex_strterm;
|
||
|
stack_type parser_cond_stack;
|
||
| ... | ... | |
|
enum lex_state_e parser_lex_state;
|
||
|
int parser_paren_nest;
|
||
|
int parser_lpar_beg;
|
||
|
int parser_in_single;
|
||
|
int parser_in_def;
|
||
|
int parser_in_single; /* counter */
|
||
|
int parser_in_def; /* counter */
|
||
|
int parser_brace_nest;
|
||
|
int parser_compile_for_eval;
|
||
|
int parser_in_kwarg;
|
||
|
int parser_in_defined;
|
||
|
int parser_tokidx;
|
||
|
int parser_toksiz;
|
||
|
int parser_tokline;
|
||
|
int parser_heredoc_end;
|
||
|
char *parser_tokenbuf;
|
||
|
VALUE parser_lex_input;
|
||
|
VALUE parser_lex_lastline;
|
||
| ... | ... | |
|
const char *parser_lex_pbeg;
|
||
|
const char *parser_lex_p;
|
||
|
const char *parser_lex_pend;
|
||
|
int parser_heredoc_end;
|
||
|
int parser_command_start;
|
||
|
NODE *parser_deferred_nodes;
|
||
|
long parser_lex_gets_ptr;
|
||
|
VALUE (*parser_lex_gets)(struct parser_params*,VALUE);
|
||
| ... | ... | |
|
int last_cr_line;
|
||
|
unsigned int parser_command_start:1;
|
||
|
unsigned int eofp: 1;
|
||
|
unsigned int parser_ruby__end__seen: 1;
|
||
|
unsigned int parser_yydebug: 1;
|
||
|
unsigned int has_shebang: 1;
|
||
|
unsigned int parser_in_defined: 1;
|
||
|
unsigned int parser_compile_for_eval: 1;
|
||
|
unsigned int parser_in_kwarg: 1;
|
||
|
#ifndef RIPPER
|
||
|
/* Ruby core only */
|
||
| ... | ... | |
|
# if WARN_PAST_SCOPE
|
||
|
unsigned int parser_past_scope_enabled: 1;
|
||
|
# endif
|
||
|
int nerr;
|
||
|
unsigned int has_err: 1;
|
||
|
NODE *parser_eval_tree_begin;
|
||
|
NODE *parser_eval_tree;
|
||
| ... | ... | |
|
# define PARSER_ARG parser,
|
||
|
#else
|
||
|
# define rb_compile_error rb_compile_error_with_enc
|
||
|
# define compile_error parser->nerr++,rb_compile_error_with_enc
|
||
|
# define compile_error (parser->has_err = 1),rb_compile_error_with_enc
|
||
|
# define PARSER_ARG ruby_sourcefile, ruby_sourceline, (void *)current_enc,
|
||
|
#endif
|
||
| ... | ... | |
|
}
|
||
|
f_args term
|
||
|
{
|
||
|
parser->parser_in_kwarg = $<num>1;
|
||
|
parser->parser_in_kwarg = !!$<num>1;
|
||
|
$$ = $2;
|
||
|
lex_state = EXPR_BEG;
|
||
|
command_start = TRUE;
|
||
| ... | ... | |
|
lex_strterm = 0;
|
||
|
lex_p = lex_pbeg = lex_pend = 0;
|
||
|
lex_lastline = lex_nextline = 0;
|
||
|
if (parser->nerr) {
|
||
|
if (parser->has_err) {
|
||
|
return 0;
|
||
|
}
|
||
|
tree = ruby_eval_tree;
|
||
| ... | ... | |
|
lex_gets_ptr = 0;
|
||
|
lex_input = rb_str_new_frozen(s);
|
||
|
lex_pbeg = lex_p = lex_pend = 0;
|
||
|
compile_for_eval = rb_parse_in_eval();
|
||
|
compile_for_eval = !!rb_parse_in_eval();
|
||
|
node = yycompile(parser, fname, line);
|
||
|
RB_GC_GUARD(vparser); /* prohibit tail call optimization */
|
||
| ... | ... | |
|
lex_gets = lex_io_gets;
|
||
|
lex_input = file;
|
||
|
lex_pbeg = lex_p = lex_pend = 0;
|
||
|
compile_for_eval = rb_parse_in_eval();
|
||
|
compile_for_eval = !!rb_parse_in_eval();
|
||
|
node = yycompile(parser, fname, start);
|
||
|
RB_GC_GUARD(vparser); /* prohibit tail call optimization */
|
||
| ... | ... | |
|
return -1;
|
||
|
if (!lex_input || NIL_P(v = lex_getline(parser))) {
|
||
|
parser->eofp = Qtrue;
|
||
|
parser->eofp = 1;
|
||
|
lex_goto_eol(parser);
|
||
|
return -1;
|
||
|
}
|
||
| ... | ... | |
|
case '_':
|
||
|
if (was_bol() && whole_match_p("__END__", 7, 0)) {
|
||
|
ruby__end__seen = 1;
|
||
|
parser->eofp = Qtrue;
|
||
|
parser->eofp = 1;
|
||
|
#ifndef RIPPER
|
||
|
return -1;
|
||
|
#else
|
||
| ... | ... | |
|
static void
|
||
|
parser_initialize(struct parser_params *parser)
|
||
|
{
|
||
|
parser->eofp = Qfalse;
|
||
|
parser->eofp = 0;
|
||
|
parser->parser_lex_strterm = 0;
|
||
|
parser->parser_cond_stack = 0;
|
||
| ... | ... | |
|
parser->parser_brace_nest = 0;
|
||
|
parser->parser_in_single = 0;
|
||
|
parser->parser_in_def = 0;
|
||
|
parser->parser_in_defined = 0;
|
||
|
parser->parser_in_kwarg = 0;
|
||
|
parser->parser_compile_for_eval = 0;
|
||
|
parser->parser_tokenbuf = NULL;
|
||
|
-
|
||