Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8241503 C2: Share MacroAssembler between mach nodes during code emission
  3. JDK-8283138

Patch ADLC to not add "set_insts_mark" to every ::emit method

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 19
    • hotspot

      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).

            cslucas Cesar Soares
            cslucas Cesar Soares
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: