-
Sub-task
-
Resolution: Unresolved
-
P4
-
19
Currently, ADL emit "cbuf.set_insts_mark();" on every Node::emit method which result in methods like the one below.
```
void loadConNNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
cbuf.set_insts_mark();
// Start at oper_input_base() and count operands
unsigned idx0 = 1;
unsigned idx1 = 1; // src
{
C2_MacroAssembler _masm(&cbuf);
#line 5832 "/wf/tortugo-jdk/src/hotspot/cpu/x86/x86_64.ad"
address con = (address)opnd_array(1)->constant();
if (con == NULL) {
ShouldNotReachHere();
} else {
__ set_narrow_oop(opnd_array(0)->as_Register(ra_,this)/* dst */, (jobject)opnd_array(1)->constant());
}
#line 999999
}
}
```
IF the definition of the matched instruction (in the AD file) only uses MacroAssembler to emit instructions then we don't need `cbuf.set_insts` in the ::emit method.
This is a clean up that I might would be useful to make before we convert the "::emit" methods to receive "masm" as parameter instead of instantiating one (see parent issue).
```
void loadConNNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const {
cbuf.set_insts_mark();
// Start at oper_input_base() and count operands
unsigned idx0 = 1;
unsigned idx1 = 1; // src
{
C2_MacroAssembler _masm(&cbuf);
#line 5832 "/wf/tortugo-jdk/src/hotspot/cpu/x86/x86_64.ad"
address con = (address)opnd_array(1)->constant();
if (con == NULL) {
ShouldNotReachHere();
} else {
__ set_narrow_oop(opnd_array(0)->as_Register(ra_,this)/* dst */, (jobject)opnd_array(1)->constant());
}
#line 999999
}
}
```
IF the definition of the matched instruction (in the AD file) only uses MacroAssembler to emit instructions then we don't need `cbuf.set_insts` in the ::emit method.
This is a clean up that I might would be useful to make before we convert the "::emit" methods to receive "masm" as parameter instead of instantiating one (see parent issue).