< prev index next >

src/cpu/x86/vm/c1_CodeStubs_x86.cpp

Print this page
rev 12906 : [mq]: gc_interface


  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_CodeStubs.hpp"
  27 #include "c1/c1_FrameMap.hpp"
  28 #include "c1/c1_LIRAssembler.hpp"
  29 #include "c1/c1_MacroAssembler.hpp"
  30 #include "c1/c1_Runtime1.hpp"
  31 #include "nativeInst_x86.hpp"
  32 #include "runtime/sharedRuntime.hpp"
  33 #include "utilities/macros.hpp"
  34 #include "vmreg_x86.inline.hpp"
  35 #if INCLUDE_ALL_GCS
  36 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  37 #endif // INCLUDE_ALL_GCS
  38 
  39 
  40 #define __ ce->masm()->
  41 
  42 float ConversionStub::float_zero = 0.0;
  43 double ConversionStub::double_zero = 0.0;
  44 
  45 void ConversionStub::emit_code(LIR_Assembler* ce) {
  46   __ bind(_entry);
  47   assert(bytecode() == Bytecodes::_f2i || bytecode() == Bytecodes::_d2i, "other conversions do not require stub");
  48 
  49 
  50   if (input()->is_single_xmm()) {
  51     __ comiss(input()->as_xmm_float_reg(),
  52               ExternalAddress((address)&float_zero));
  53   } else if (input()->is_double_xmm()) {
  54     __ comisd(input()->as_xmm_double_reg(),
  55               ExternalAddress((address)&double_zero));
  56   } else {
  57     LP64_ONLY(ShouldNotReachHere());
  58     __ push(rax);


 502     }
 503   }
 504 
 505   ce->align_call(lir_static_call);
 506 
 507   ce->emit_static_call_stub();
 508   if (ce->compilation()->bailed_out()) {
 509     return; // CodeCache is full
 510   }
 511   AddressLiteral resolve(SharedRuntime::get_resolve_static_call_stub(),
 512                          relocInfo::static_call_type);
 513   __ call(resolve);
 514   ce->add_call_info_here(info());
 515 
 516 #ifndef PRODUCT
 517   __ incrementl(ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
 518 #endif
 519 
 520   __ jmp(_continuation);
 521 }
 522 
 523 /////////////////////////////////////////////////////////////////////////////
 524 #if INCLUDE_ALL_GCS
 525 
 526 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
 527   // At this point we know that marking is in progress.
 528   // If do_load() is true then we have to emit the
 529   // load of the previous value; otherwise it has already
 530   // been loaded into _pre_val.
 531 
 532   __ bind(_entry);
 533   assert(pre_val()->is_register(), "Precondition.");
 534 
 535   Register pre_val_reg = pre_val()->as_register();
 536 
 537   if (do_load()) {
 538     ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
 539   }
 540 
 541   __ cmpptr(pre_val_reg, (int32_t) NULL_WORD);
 542   __ jcc(Assembler::equal, _continuation);
 543   ce->store_parameter(pre_val()->as_register(), 0);
 544   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_pre_barrier_slow_id)));
 545   __ jmp(_continuation);
 546 
 547 }
 548 
 549 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
 550   __ bind(_entry);
 551   assert(addr()->is_register(), "Precondition.");
 552   assert(new_val()->is_register(), "Precondition.");
 553   Register new_val_reg = new_val()->as_register();
 554   __ cmpptr(new_val_reg, (int32_t) NULL_WORD);
 555   __ jcc(Assembler::equal, _continuation);
 556   ce->store_parameter(addr()->as_pointer_register(), 0);
 557   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_post_barrier_slow_id)));
 558   __ jmp(_continuation);
 559 }
 560 
 561 #endif // INCLUDE_ALL_GCS
 562 /////////////////////////////////////////////////////////////////////////////
 563 
 564 #undef __


  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "c1/c1_CodeStubs.hpp"
  27 #include "c1/c1_FrameMap.hpp"
  28 #include "c1/c1_LIRAssembler.hpp"
  29 #include "c1/c1_MacroAssembler.hpp"
  30 #include "c1/c1_Runtime1.hpp"
  31 #include "nativeInst_x86.hpp"
  32 #include "runtime/sharedRuntime.hpp"
  33 #include "utilities/macros.hpp"
  34 #include "vmreg_x86.inline.hpp"




  35 
  36 #define __ ce->masm()->
  37 
  38 float ConversionStub::float_zero = 0.0;
  39 double ConversionStub::double_zero = 0.0;
  40 
  41 void ConversionStub::emit_code(LIR_Assembler* ce) {
  42   __ bind(_entry);
  43   assert(bytecode() == Bytecodes::_f2i || bytecode() == Bytecodes::_d2i, "other conversions do not require stub");
  44 
  45 
  46   if (input()->is_single_xmm()) {
  47     __ comiss(input()->as_xmm_float_reg(),
  48               ExternalAddress((address)&float_zero));
  49   } else if (input()->is_double_xmm()) {
  50     __ comisd(input()->as_xmm_double_reg(),
  51               ExternalAddress((address)&double_zero));
  52   } else {
  53     LP64_ONLY(ShouldNotReachHere());
  54     __ push(rax);


 498     }
 499   }
 500 
 501   ce->align_call(lir_static_call);
 502 
 503   ce->emit_static_call_stub();
 504   if (ce->compilation()->bailed_out()) {
 505     return; // CodeCache is full
 506   }
 507   AddressLiteral resolve(SharedRuntime::get_resolve_static_call_stub(),
 508                          relocInfo::static_call_type);
 509   __ call(resolve);
 510   ce->add_call_info_here(info());
 511 
 512 #ifndef PRODUCT
 513   __ incrementl(ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
 514 #endif
 515 
 516   __ jmp(_continuation);
 517 }









































 518 
 519 #undef __
< prev index next >