src/cpu/x86/vm/x86_32.ad

changeset 2103
3e8fbc61cee8
parent 2085
f55c4f82ab9d
child 2269
ae065c367d93
     1.1 --- a/src/cpu/x86/vm/x86_32.ad	Mon Aug 23 09:09:36 2010 -0700
     1.2 +++ b/src/cpu/x86/vm/x86_32.ad	Wed Aug 25 05:27:54 2010 -0700
     1.3 @@ -350,54 +350,46 @@
     1.4  // EMIT_RM()
     1.5  void emit_rm(CodeBuffer &cbuf, int f1, int f2, int f3) {
     1.6    unsigned char c = (unsigned char)((f1 << 6) | (f2 << 3) | f3);
     1.7 -  *(cbuf.code_end()) = c;
     1.8 -  cbuf.set_code_end(cbuf.code_end() + 1);
     1.9 +  cbuf.insts()->emit_int8(c);
    1.10  }
    1.11  
    1.12  // EMIT_CC()
    1.13  void emit_cc(CodeBuffer &cbuf, int f1, int f2) {
    1.14    unsigned char c = (unsigned char)( f1 | f2 );
    1.15 -  *(cbuf.code_end()) = c;
    1.16 -  cbuf.set_code_end(cbuf.code_end() + 1);
    1.17 +  cbuf.insts()->emit_int8(c);
    1.18  }
    1.19  
    1.20  // EMIT_OPCODE()
    1.21  void emit_opcode(CodeBuffer &cbuf, int code) {
    1.22 -  *(cbuf.code_end()) = (unsigned char)code;
    1.23 -  cbuf.set_code_end(cbuf.code_end() + 1);
    1.24 +  cbuf.insts()->emit_int8((unsigned char) code);
    1.25  }
    1.26  
    1.27  // EMIT_OPCODE() w/ relocation information
    1.28  void emit_opcode(CodeBuffer &cbuf, int code, relocInfo::relocType reloc, int offset = 0) {
    1.29 -  cbuf.relocate(cbuf.inst_mark() + offset, reloc);
    1.30 +  cbuf.relocate(cbuf.insts_mark() + offset, reloc);
    1.31    emit_opcode(cbuf, code);
    1.32  }
    1.33  
    1.34  // EMIT_D8()
    1.35  void emit_d8(CodeBuffer &cbuf, int d8) {
    1.36 -  *(cbuf.code_end()) = (unsigned char)d8;
    1.37 -  cbuf.set_code_end(cbuf.code_end() + 1);
    1.38 +  cbuf.insts()->emit_int8((unsigned char) d8);
    1.39  }
    1.40  
    1.41  // EMIT_D16()
    1.42  void emit_d16(CodeBuffer &cbuf, int d16) {
    1.43 -  *((short *)(cbuf.code_end())) = d16;
    1.44 -  cbuf.set_code_end(cbuf.code_end() + 2);
    1.45 +  cbuf.insts()->emit_int16(d16);
    1.46  }
    1.47  
    1.48  // EMIT_D32()
    1.49  void emit_d32(CodeBuffer &cbuf, int d32) {
    1.50 -  *((int *)(cbuf.code_end())) = d32;
    1.51 -  cbuf.set_code_end(cbuf.code_end() + 4);
    1.52 +  cbuf.insts()->emit_int32(d32);
    1.53  }
    1.54  
    1.55  // emit 32 bit value and construct relocation entry from relocInfo::relocType
    1.56  void emit_d32_reloc(CodeBuffer &cbuf, int d32, relocInfo::relocType reloc,
    1.57          int format) {
    1.58 -  cbuf.relocate(cbuf.inst_mark(), reloc, format);
    1.59 -
    1.60 -  *((int *)(cbuf.code_end())) = d32;
    1.61 -  cbuf.set_code_end(cbuf.code_end() + 4);
    1.62 +  cbuf.relocate(cbuf.insts_mark(), reloc, format);
    1.63 +  cbuf.insts()->emit_int32(d32);
    1.64  }
    1.65  
    1.66  // emit 32 bit value and construct relocation entry from RelocationHolder
    1.67 @@ -408,10 +400,8 @@
    1.68      assert(oop(d32)->is_oop() && (ScavengeRootsInCode || !oop(d32)->is_scavengable()), "cannot embed scavengable oops in code");
    1.69    }
    1.70  #endif
    1.71 -  cbuf.relocate(cbuf.inst_mark(), rspec, format);
    1.72 -
    1.73 -  *((int *)(cbuf.code_end())) = d32;
    1.74 -  cbuf.set_code_end(cbuf.code_end() + 4);
    1.75 +  cbuf.relocate(cbuf.insts_mark(), rspec, format);
    1.76 +  cbuf.insts()->emit_int32(d32);
    1.77  }
    1.78  
    1.79  // Access stack slot for load or store
    1.80 @@ -613,7 +603,7 @@
    1.81      emit_rm(cbuf, 0x3, 0x05, ESP_enc);
    1.82      emit_d32(cbuf, framesize);
    1.83    }
    1.84 -  C->set_frame_complete(cbuf.code_end() - cbuf.code_begin());
    1.85 +  C->set_frame_complete(cbuf.insts_size());
    1.86  
    1.87  #ifdef ASSERT
    1.88    if (VerifyStackAtCalls) {
    1.89 @@ -695,7 +685,7 @@
    1.90    emit_opcode(cbuf, 0x58 | EBP_enc);
    1.91  
    1.92    if( do_polling() && C->is_method_compilation() ) {
    1.93 -    cbuf.relocate(cbuf.code_end(), relocInfo::poll_return_type, 0);
    1.94 +    cbuf.relocate(cbuf.insts_end(), relocInfo::poll_return_type, 0);
    1.95      emit_opcode(cbuf,0x85);
    1.96      emit_rm(cbuf, 0x0, EAX_enc, 0x5); // EAX
    1.97      emit_d32(cbuf, (intptr_t)os::get_polling_page());
    1.98 @@ -1211,9 +1201,9 @@
    1.99    // mov rbx,0
   1.100    // jmp -1
   1.101  
   1.102 -  address mark = cbuf.inst_mark();  // get mark within main instrs section
   1.103 -
   1.104 -  // Note that the code buffer's inst_mark is always relative to insts.
   1.105 +  address mark = cbuf.insts_mark();  // get mark within main instrs section
   1.106 +
   1.107 +  // Note that the code buffer's insts_mark is always relative to insts.
   1.108    // That's why we must use the macroassembler to generate a stub.
   1.109    MacroAssembler _masm(&cbuf);
   1.110  
   1.111 @@ -1228,7 +1218,7 @@
   1.112    __ jump(RuntimeAddress(__ pc()));
   1.113  
   1.114    __ end_a_stub();
   1.115 -  // Update current stubs pointer and restore code_end.
   1.116 +  // Update current stubs pointer and restore insts_end.
   1.117  }
   1.118  // size of call stub, compiled java to interpretor
   1.119  uint size_java_to_interp() {
   1.120 @@ -1254,7 +1244,7 @@
   1.121  void MachUEPNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
   1.122    MacroAssembler masm(&cbuf);
   1.123  #ifdef ASSERT
   1.124 -  uint code_size = cbuf.code_size();
   1.125 +  uint insts_size = cbuf.insts_size();
   1.126  #endif
   1.127    masm.cmpptr(rax, Address(rcx, oopDesc::klass_offset_in_bytes()));
   1.128    masm.jump_cc(Assembler::notEqual,
   1.129 @@ -1266,7 +1256,7 @@
   1.130       nops_cnt += 1;
   1.131    masm.nop(nops_cnt);
   1.132  
   1.133 -  assert(cbuf.code_size() - code_size == size(ra_), "checking code size of inline cache node");
   1.134 +  assert(cbuf.insts_size() - insts_size == size(ra_), "checking code size of inline cache node");
   1.135  }
   1.136  
   1.137  uint MachUEPNode::size(PhaseRegAlloc *ra_) const {
   1.138 @@ -1288,14 +1278,14 @@
   1.139  // and call a VM stub routine.
   1.140  int emit_exception_handler(CodeBuffer& cbuf) {
   1.141  
   1.142 -  // Note that the code buffer's inst_mark is always relative to insts.
   1.143 +  // Note that the code buffer's insts_mark is always relative to insts.
   1.144    // That's why we must use the macroassembler to generate a handler.
   1.145    MacroAssembler _masm(&cbuf);
   1.146    address base =
   1.147    __ start_a_stub(size_exception_handler());
   1.148    if (base == NULL)  return 0;  // CodeBuffer::expand failed
   1.149    int offset = __ offset();
   1.150 -  __ jump(RuntimeAddress(OptoRuntime::exception_blob()->instructions_begin()));
   1.151 +  __ jump(RuntimeAddress(OptoRuntime::exception_blob()->entry_point()));
   1.152    assert(__ offset() - offset <= (int) size_exception_handler(), "overflow");
   1.153    __ end_a_stub();
   1.154    return offset;
   1.155 @@ -1313,7 +1303,7 @@
   1.156  // Emit deopt handler code.
   1.157  int emit_deopt_handler(CodeBuffer& cbuf) {
   1.158  
   1.159 -  // Note that the code buffer's inst_mark is always relative to insts.
   1.160 +  // Note that the code buffer's insts_mark is always relative to insts.
   1.161    // That's why we must use the macroassembler to generate a handler.
   1.162    MacroAssembler _masm(&cbuf);
   1.163    address base =
   1.164 @@ -1728,12 +1718,12 @@
   1.165  
   1.166    enc_class Lbl (label labl) %{ // JMP, CALL
   1.167      Label *l = $labl$$label;
   1.168 -    emit_d32(cbuf, l ? (l->loc_pos() - (cbuf.code_size()+4)) : 0);
   1.169 +    emit_d32(cbuf, l ? (l->loc_pos() - (cbuf.insts_size()+4)) : 0);
   1.170    %}
   1.171  
   1.172    enc_class LblShort (label labl) %{ // JMP, CALL
   1.173      Label *l = $labl$$label;
   1.174 -    int disp = l ? (l->loc_pos() - (cbuf.code_size()+1)) : 0;
   1.175 +    int disp = l ? (l->loc_pos() - (cbuf.insts_size()+1)) : 0;
   1.176      assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp");
   1.177      emit_d8(cbuf, disp);
   1.178    %}
   1.179 @@ -1764,13 +1754,13 @@
   1.180      Label *l = $labl$$label;
   1.181      $$$emit8$primary;
   1.182      emit_cc(cbuf, $secondary, $cop$$cmpcode);
   1.183 -    emit_d32(cbuf, l ? (l->loc_pos() - (cbuf.code_size()+4)) : 0);
   1.184 +    emit_d32(cbuf, l ? (l->loc_pos() - (cbuf.insts_size()+4)) : 0);
   1.185    %}
   1.186  
   1.187    enc_class JccShort (cmpOp cop, label labl) %{    // JCC
   1.188      Label *l = $labl$$label;
   1.189      emit_cc(cbuf, $primary, $cop$$cmpcode);
   1.190 -    int disp = l ? (l->loc_pos() - (cbuf.code_size()+1)) : 0;
   1.191 +    int disp = l ? (l->loc_pos() - (cbuf.insts_size()+1)) : 0;
   1.192      assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp");
   1.193      emit_d8(cbuf, disp);
   1.194    %}
   1.195 @@ -1838,10 +1828,10 @@
   1.196  
   1.197    enc_class Java_To_Runtime (method meth) %{    // CALL Java_To_Runtime, Java_To_Runtime_Leaf
   1.198      // This is the instruction starting address for relocation info.
   1.199 -    cbuf.set_inst_mark();
   1.200 +    cbuf.set_insts_mark();
   1.201      $$$emit8$primary;
   1.202      // CALL directly to the runtime
   1.203 -    emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.code_end()) - 4),
   1.204 +    emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
   1.205                  runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.206  
   1.207      if (UseSSE >= 2) {
   1.208 @@ -1871,12 +1861,12 @@
   1.209  
   1.210    enc_class pre_call_FPU %{
   1.211      // If method sets FPU control word restore it here
   1.212 -    debug_only(int off0 = cbuf.code_size());
   1.213 +    debug_only(int off0 = cbuf.insts_size());
   1.214      if( Compile::current()->in_24_bit_fp_mode() ) {
   1.215        MacroAssembler masm(&cbuf);
   1.216        masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std()));
   1.217      }
   1.218 -    debug_only(int off1 = cbuf.code_size());
   1.219 +    debug_only(int off1 = cbuf.insts_size());
   1.220      assert(off1 - off0 == pre_call_FPU_size(), "correct size prediction");
   1.221    %}
   1.222  
   1.223 @@ -1889,12 +1879,12 @@
   1.224    %}
   1.225  
   1.226    enc_class preserve_SP %{
   1.227 -    debug_only(int off0 = cbuf.code_size());
   1.228 +    debug_only(int off0 = cbuf.insts_size());
   1.229      MacroAssembler _masm(&cbuf);
   1.230      // RBP is preserved across all calls, even compiled calls.
   1.231      // Use it to preserve RSP in places where the callee might change the SP.
   1.232      __ movptr(rbp_mh_SP_save, rsp);
   1.233 -    debug_only(int off1 = cbuf.code_size());
   1.234 +    debug_only(int off1 = cbuf.insts_size());
   1.235      assert(off1 - off0 == preserve_SP_size(), "correct size prediction");
   1.236    %}
   1.237  
   1.238 @@ -1906,16 +1896,16 @@
   1.239    enc_class Java_Static_Call (method meth) %{    // JAVA STATIC CALL
   1.240      // CALL to fixup routine.  Fixup routine uses ScopeDesc info to determine
   1.241      // who we intended to call.
   1.242 -    cbuf.set_inst_mark();
   1.243 +    cbuf.set_insts_mark();
   1.244      $$$emit8$primary;
   1.245      if ( !_method ) {
   1.246 -      emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.code_end()) - 4),
   1.247 +      emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
   1.248                       runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.249      } else if(_optimized_virtual) {
   1.250 -      emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.code_end()) - 4),
   1.251 +      emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
   1.252                       opt_virtual_call_Relocation::spec(), RELOC_IMM32 );
   1.253      } else {
   1.254 -      emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.code_end()) - 4),
   1.255 +      emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
   1.256                       static_call_Relocation::spec(), RELOC_IMM32 );
   1.257      }
   1.258      if( _method ) {  // Emit stub for static call
   1.259 @@ -1927,15 +1917,15 @@
   1.260      // !!!!!
   1.261      // Generate  "Mov EAX,0x00", placeholder instruction to load oop-info
   1.262      // emit_call_dynamic_prologue( cbuf );
   1.263 -    cbuf.set_inst_mark();
   1.264 +    cbuf.set_insts_mark();
   1.265      emit_opcode(cbuf, 0xB8 + EAX_enc);        // mov    EAX,-1
   1.266      emit_d32_reloc(cbuf, (int)Universe::non_oop_word(), oop_Relocation::spec_for_immediate(), RELOC_IMM32);
   1.267 -    address  virtual_call_oop_addr = cbuf.inst_mark();
   1.268 +    address  virtual_call_oop_addr = cbuf.insts_mark();
   1.269      // CALL to fixup routine.  Fixup routine uses ScopeDesc info to determine
   1.270      // who we intended to call.
   1.271 -    cbuf.set_inst_mark();
   1.272 +    cbuf.set_insts_mark();
   1.273      $$$emit8$primary;
   1.274 -    emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.code_end()) - 4),
   1.275 +    emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4),
   1.276                  virtual_call_Relocation::spec(virtual_call_oop_addr), RELOC_IMM32 );
   1.277    %}
   1.278  
   1.279 @@ -1944,7 +1934,7 @@
   1.280      assert( -128 <= disp && disp <= 127, "compiled_code_offset isn't small");
   1.281  
   1.282      // CALL *[EAX+in_bytes(methodOopDesc::from_compiled_code_entry_point_offset())]
   1.283 -    cbuf.set_inst_mark();
   1.284 +    cbuf.set_insts_mark();
   1.285      $$$emit8$primary;
   1.286      emit_rm(cbuf, 0x01, $secondary, EAX_enc );  // R/M byte
   1.287      emit_d8(cbuf, disp);             // Displacement
   1.288 @@ -1976,9 +1966,9 @@
   1.289  //     emit_rm(cbuf, 0x3, EBP_enc, EBP_enc);
   1.290  //
   1.291  //     // CALL to interpreter.
   1.292 -//     cbuf.set_inst_mark();
   1.293 +//     cbuf.set_insts_mark();
   1.294  //     $$$emit8$primary;
   1.295 -//     emit_d32_reloc(cbuf, ($labl$$label - (int)(cbuf.code_end()) - 4),
   1.296 +//     emit_d32_reloc(cbuf, ($labl$$label - (int)(cbuf.insts_end()) - 4),
   1.297  //                 runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.298  //   %}
   1.299  
   1.300 @@ -2087,7 +2077,7 @@
   1.301    %}
   1.302  
   1.303    enc_class Opc_MemImm_F(immF src) %{
   1.304 -    cbuf.set_inst_mark();
   1.305 +    cbuf.set_insts_mark();
   1.306      $$$emit8$primary;
   1.307      emit_rm(cbuf, 0x0, $secondary, 0x5);
   1.308      emit_float_constant(cbuf, $src$$constant);
   1.309 @@ -2280,7 +2270,7 @@
   1.310    %}
   1.311  
   1.312    enc_class set_instruction_start( ) %{
   1.313 -    cbuf.set_inst_mark();            // Mark start of opcode for reloc info in mem operand
   1.314 +    cbuf.set_insts_mark();            // Mark start of opcode for reloc info in mem operand
   1.315    %}
   1.316  
   1.317    enc_class RegMem (eRegI ereg, memory mem) %{    // emit_reg_mem
   1.318 @@ -2429,7 +2419,7 @@
   1.319        emit_opcode( cbuf, 0xD9 ); // FLD (i.e., push it)
   1.320        emit_d8( cbuf, 0xC0-1+$src$$reg );
   1.321      }
   1.322 -    cbuf.set_inst_mark();       // Mark start of opcode for reloc info in mem operand
   1.323 +    cbuf.set_insts_mark();       // Mark start of opcode for reloc info in mem operand
   1.324      emit_opcode(cbuf,$primary);
   1.325      encode_RegMem(cbuf, reg_encoding, base, index, scale, displace, disp_is_oop);
   1.326    %}
   1.327 @@ -2474,7 +2464,7 @@
   1.328      emit_opcode(cbuf,0x1B);
   1.329      emit_rm(cbuf, 0x3, tmpReg, tmpReg);
   1.330      // AND $tmp,$y
   1.331 -    cbuf.set_inst_mark();       // Mark start of opcode for reloc info in mem operand
   1.332 +    cbuf.set_insts_mark();       // Mark start of opcode for reloc info in mem operand
   1.333      emit_opcode(cbuf,0x23);
   1.334      int reg_encoding = tmpReg;
   1.335      int base  = $mem$$base;
   1.336 @@ -3157,9 +3147,9 @@
   1.337      // PUSH src2.lo
   1.338      emit_opcode(cbuf,               0x50+$src2$$reg  );
   1.339      // CALL directly to the runtime
   1.340 -    cbuf.set_inst_mark();
   1.341 +    cbuf.set_insts_mark();
   1.342      emit_opcode(cbuf,0xE8);       // Call into runtime
   1.343 -    emit_d32_reloc(cbuf, (CAST_FROM_FN_PTR(address, SharedRuntime::ldiv) - cbuf.code_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.344 +    emit_d32_reloc(cbuf, (CAST_FROM_FN_PTR(address, SharedRuntime::ldiv) - cbuf.insts_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.345      // Restore stack
   1.346      emit_opcode(cbuf, 0x83); // add  SP, #framesize
   1.347      emit_rm(cbuf, 0x3, 0x00, ESP_enc);
   1.348 @@ -3176,9 +3166,9 @@
   1.349      // PUSH src2.lo
   1.350      emit_opcode(cbuf,               0x50+$src2$$reg  );
   1.351      // CALL directly to the runtime
   1.352 -    cbuf.set_inst_mark();
   1.353 +    cbuf.set_insts_mark();
   1.354      emit_opcode(cbuf,0xE8);       // Call into runtime
   1.355 -    emit_d32_reloc(cbuf, (CAST_FROM_FN_PTR(address, SharedRuntime::lrem ) - cbuf.code_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.356 +    emit_d32_reloc(cbuf, (CAST_FROM_FN_PTR(address, SharedRuntime::lrem ) - cbuf.insts_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.357      // Restore stack
   1.358      emit_opcode(cbuf, 0x83); // add  SP, #framesize
   1.359      emit_rm(cbuf, 0x3, 0x00, ESP_enc);
   1.360 @@ -3824,9 +3814,9 @@
   1.361    %}
   1.362  
   1.363    enc_class enc_rethrow() %{
   1.364 -    cbuf.set_inst_mark();
   1.365 +    cbuf.set_insts_mark();
   1.366      emit_opcode(cbuf, 0xE9);        // jmp    entry
   1.367 -    emit_d32_reloc(cbuf, (int)OptoRuntime::rethrow_stub() - ((int)cbuf.code_end())-4,
   1.368 +    emit_d32_reloc(cbuf, (int)OptoRuntime::rethrow_stub() - ((int)cbuf.insts_end())-4,
   1.369                     runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.370    %}
   1.371  
   1.372 @@ -3873,9 +3863,9 @@
   1.373      emit_opcode(cbuf,0xD9 );      // FLD     ST(i)
   1.374      emit_d8    (cbuf,0xC0-1+$src$$reg );
   1.375      // CALL directly to the runtime
   1.376 -    cbuf.set_inst_mark();
   1.377 +    cbuf.set_insts_mark();
   1.378      emit_opcode(cbuf,0xE8);       // Call into runtime
   1.379 -    emit_d32_reloc(cbuf, (StubRoutines::d2i_wrapper() - cbuf.code_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.380 +    emit_d32_reloc(cbuf, (StubRoutines::d2i_wrapper() - cbuf.insts_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.381      // Carry on here...
   1.382    %}
   1.383  
   1.384 @@ -3915,9 +3905,9 @@
   1.385      emit_opcode(cbuf,0xD9 );      // FLD     ST(i)
   1.386      emit_d8    (cbuf,0xC0-1+$src$$reg );
   1.387      // CALL directly to the runtime
   1.388 -    cbuf.set_inst_mark();
   1.389 +    cbuf.set_insts_mark();
   1.390      emit_opcode(cbuf,0xE8);       // Call into runtime
   1.391 -    emit_d32_reloc(cbuf, (StubRoutines::d2l_wrapper() - cbuf.code_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.392 +    emit_d32_reloc(cbuf, (StubRoutines::d2l_wrapper() - cbuf.insts_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.393      // Carry on here...
   1.394    %}
   1.395  
   1.396 @@ -3988,9 +3978,9 @@
   1.397      emit_d8(cbuf,0x04);
   1.398  
   1.399      // CALL directly to the runtime
   1.400 -    cbuf.set_inst_mark();
   1.401 +    cbuf.set_insts_mark();
   1.402      emit_opcode(cbuf,0xE8);       // Call into runtime
   1.403 -    emit_d32_reloc(cbuf, (StubRoutines::d2l_wrapper() - cbuf.code_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.404 +    emit_d32_reloc(cbuf, (StubRoutines::d2l_wrapper() - cbuf.insts_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.405      // Carry on here...
   1.406    %}
   1.407  
   1.408 @@ -4062,9 +4052,9 @@
   1.409      emit_d8(cbuf,0x08);
   1.410  
   1.411      // CALL directly to the runtime
   1.412 -    cbuf.set_inst_mark();
   1.413 +    cbuf.set_insts_mark();
   1.414      emit_opcode(cbuf,0xE8);      // Call into runtime
   1.415 -    emit_d32_reloc(cbuf, (StubRoutines::d2l_wrapper() - cbuf.code_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.416 +    emit_d32_reloc(cbuf, (StubRoutines::d2l_wrapper() - cbuf.insts_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.417      // Carry on here...
   1.418    %}
   1.419  
   1.420 @@ -4122,9 +4112,9 @@
   1.421      emit_d8(cbuf, $primary ? 0x8 : 0x4);
   1.422  
   1.423      // CALL directly to the runtime
   1.424 -    cbuf.set_inst_mark();
   1.425 +    cbuf.set_insts_mark();
   1.426      emit_opcode(cbuf,0xE8);       // Call into runtime
   1.427 -    emit_d32_reloc(cbuf, (StubRoutines::d2i_wrapper() - cbuf.code_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.428 +    emit_d32_reloc(cbuf, (StubRoutines::d2i_wrapper() - cbuf.insts_end()) - 4, runtime_call_Relocation::spec(), RELOC_IMM32 );
   1.429  
   1.430      // Carry on here...
   1.431    %}
   1.432 @@ -4321,7 +4311,7 @@
   1.433    // so the memory operand is used twice in the encoding.
   1.434    enc_class enc_storeL_volatile( memory mem, stackSlotL src ) %{
   1.435      store_to_stackslot( cbuf, 0x0DF, 0x05, $src$$disp );
   1.436 -    cbuf.set_inst_mark();            // Mark start of FIST in case $mem has an oop
   1.437 +    cbuf.set_insts_mark();            // Mark start of FIST in case $mem has an oop
   1.438      emit_opcode(cbuf,0xDF);
   1.439      int rm_byte_opcode = 0x07;
   1.440      int base     = $mem$$base;
   1.441 @@ -4345,7 +4335,7 @@
   1.442        bool disp_is_oop = $src->disp_is_oop(); // disp-as-oop when working with static globals
   1.443        encode_RegMem(cbuf, $tmp$$reg, base, index, scale, displace, disp_is_oop);
   1.444      }
   1.445 -    cbuf.set_inst_mark();            // Mark start of MOVSD in case $mem has an oop
   1.446 +    cbuf.set_insts_mark();            // Mark start of MOVSD in case $mem has an oop
   1.447      { // MOVSD $mem,$tmp ! atomic long store
   1.448        emit_opcode(cbuf,0xF2);
   1.449        emit_opcode(cbuf,0x0F);
   1.450 @@ -4378,7 +4368,7 @@
   1.451        emit_opcode(cbuf,0x62);
   1.452        emit_rm(cbuf, 0x3, $tmp$$reg, $tmp2$$reg);
   1.453      }
   1.454 -    cbuf.set_inst_mark();            // Mark start of MOVSD in case $mem has an oop
   1.455 +    cbuf.set_insts_mark();            // Mark start of MOVSD in case $mem has an oop
   1.456      { // MOVSD $mem,$tmp ! atomic long store
   1.457        emit_opcode(cbuf,0xF2);
   1.458        emit_opcode(cbuf,0x0F);
   1.459 @@ -4399,7 +4389,7 @@
   1.460    // A better choice might be TESTB [spp + pagesize() - CacheLineSize()],0
   1.461  
   1.462    enc_class Safepoint_Poll() %{
   1.463 -    cbuf.relocate(cbuf.inst_mark(), relocInfo::poll_type, 0);
   1.464 +    cbuf.relocate(cbuf.insts_mark(), relocInfo::poll_type, 0);
   1.465      emit_opcode(cbuf,0x85);
   1.466      emit_rm (cbuf, 0x0, 0x7, 0x5);
   1.467      emit_d32(cbuf, (intptr_t)os::get_polling_page());
   1.468 @@ -12932,7 +12922,7 @@
   1.469      bool ok = false;
   1.470      if ($cop$$cmpcode == Assembler::notEqual) {
   1.471         // the two jumps 6 bytes apart so the jump distances are too
   1.472 -       parity_disp = l ? (l->loc_pos() - (cbuf.code_size() + 4)) : 0;
   1.473 +       parity_disp = l ? (l->loc_pos() - (cbuf.insts_size() + 4)) : 0;
   1.474      } else if ($cop$$cmpcode == Assembler::equal) {
   1.475         parity_disp = 6;
   1.476         ok = true;
   1.477 @@ -12942,7 +12932,7 @@
   1.478      emit_d32(cbuf, parity_disp);
   1.479      $$$emit8$primary;
   1.480      emit_cc(cbuf, $secondary, $cop$$cmpcode);
   1.481 -    int disp = l ? (l->loc_pos() - (cbuf.code_size() + 4)) : 0;
   1.482 +    int disp = l ? (l->loc_pos() - (cbuf.insts_size() + 4)) : 0;
   1.483      emit_d32(cbuf, disp);
   1.484    %}
   1.485    ins_pipe(pipe_jcc);
   1.486 @@ -13128,7 +13118,7 @@
   1.487      emit_cc(cbuf, $primary, Assembler::parity);
   1.488      int parity_disp = -1;
   1.489      if ($cop$$cmpcode == Assembler::notEqual) {
   1.490 -      parity_disp = l ? (l->loc_pos() - (cbuf.code_size() + 1)) : 0;
   1.491 +      parity_disp = l ? (l->loc_pos() - (cbuf.insts_size() + 1)) : 0;
   1.492      } else if ($cop$$cmpcode == Assembler::equal) {
   1.493        parity_disp = 2;
   1.494      } else {
   1.495 @@ -13136,7 +13126,7 @@
   1.496      }
   1.497      emit_d8(cbuf, parity_disp);
   1.498      emit_cc(cbuf, $primary, $cop$$cmpcode);
   1.499 -    int disp = l ? (l->loc_pos() - (cbuf.code_size() + 1)) : 0;
   1.500 +    int disp = l ? (l->loc_pos() - (cbuf.insts_size() + 1)) : 0;
   1.501      emit_d8(cbuf, disp);
   1.502      assert(-128 <= disp && disp <= 127, "Displacement too large for short jmp");
   1.503      assert(-128 <= parity_disp && parity_disp <= 127, "Displacement too large for short jmp");

mercurial