src/share/vm/adlc/formssel.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6961690 Cdiff src/share/vm/adlc/formssel.cpp

src/share/vm/adlc/formssel.cpp

Print this page
rev 1838 : 6961690: load oops from constant table on SPARC
Summary: oops should be loaded from the constant table of an nmethod instead of materializing them with a long code sequence.
Reviewed-by:

*** 28,42 **** //==============================Instructions=================================== //------------------------------InstructForm----------------------------------- InstructForm::InstructForm(const char *id, bool ideal_only) : _ident(id), _ideal_only(ideal_only), _localNames(cmpstr, hashstr, Form::arena), ! _effects(cmpstr, hashstr, Form::arena) { _ftype = Form::INS; _matrule = NULL; _insencode = NULL; _opcode = NULL; _size = NULL; _attribs = NULL; _predicate = NULL; _exprule = NULL; --- 28,45 ---- //==============================Instructions=================================== //------------------------------InstructForm----------------------------------- InstructForm::InstructForm(const char *id, bool ideal_only) : _ident(id), _ideal_only(ideal_only), _localNames(cmpstr, hashstr, Form::arena), ! _effects(cmpstr, hashstr, Form::arena), ! _is_mach_constant(false) ! { _ftype = Form::INS; _matrule = NULL; _insencode = NULL; + _constant = NULL; _opcode = NULL; _size = NULL; _attribs = NULL; _predicate = NULL; _exprule = NULL;
*** 56,70 **** } InstructForm::InstructForm(const char *id, InstructForm *instr, MatchRule *rule) : _ident(id), _ideal_only(false), _localNames(instr->_localNames), ! _effects(instr->_effects) { _ftype = Form::INS; _matrule = rule; _insencode = instr->_insencode; _opcode = instr->_opcode; _size = instr->_size; _attribs = instr->_attribs; _predicate = instr->_predicate; _exprule = instr->_exprule; --- 59,76 ---- } InstructForm::InstructForm(const char *id, InstructForm *instr, MatchRule *rule) : _ident(id), _ideal_only(false), _localNames(instr->_localNames), ! _effects(instr->_effects), ! _is_mach_constant(false) ! { _ftype = Form::INS; _matrule = rule; _insencode = instr->_insencode; + _constant = instr->_constant; _opcode = instr->_opcode; _size = instr->_size; _attribs = instr->_attribs; _predicate = instr->_predicate; _exprule = instr->_exprule;
*** 1092,1101 **** --- 1098,1110 ---- return "MachFastLockNode"; } else if (is_ideal_nop()) { return "MachNopNode"; } + else if (is_mach_constant()) { + return "MachConstantNode"; + } else if (captures_bottom_type(globals)) { return "MachTypeNode"; } else { return "MachNode"; }
*** 1188,1197 **** --- 1197,1221 ---- // --------------------------- FILE *output_routines // // Generate the format call for the replacement variable void InstructForm::rep_var_format(FILE *fp, const char *rep_var) { + // Handle special constant table variables. + if (strcmp(rep_var, "constanttablebase") == 0) { + fprintf(fp, "char reg[128]; ra->dump_register(in(mach_constant_base_node_input()), reg);\n"); + fprintf(fp, "st->print(\"%%s\");\n"); + return; + } + if (strcmp(rep_var, "constantoffset") == 0) { + fprintf(fp, "st->print(\"#%%d\", constant_offset());\n"); + return; + } + if (strcmp(rep_var, "constantaddress") == 0) { + fprintf(fp, "st->print(\"constant table base + #%%d\", constant_offset());\n"); + return; + } + // Find replacement variable's type const Form *form = _localNames[rep_var]; if (form == NULL) { fprintf(stderr, "unknown replacement variable in format statement: '%s'\n", rep_var); assert(false, "ShouldNotReachHere()");
*** 1346,1355 **** --- 1370,1380 ---- void InstructForm::output(FILE *fp) { fprintf(fp,"\nInstruction: %s\n", (_ident?_ident:"")); if (_matrule) _matrule->output(fp); if (_insencode) _insencode->output(fp); + if (_constant) _constant->output(fp); if (_opcode) _opcode->output(fp); if (_attribs) _attribs->output(fp); if (_predicate) _predicate->output(fp); if (_effects.Size()) { fprintf(fp,"Effects\n");
src/share/vm/adlc/formssel.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File