src/hotspot/cpu/sparc/sharedRuntime_sparc.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54847 59ea39bb2809
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
    30 #include "gc/shared/gcLocker.hpp"
    30 #include "gc/shared/gcLocker.hpp"
    31 #include "interpreter/interpreter.hpp"
    31 #include "interpreter/interpreter.hpp"
    32 #include "logging/log.hpp"
    32 #include "logging/log.hpp"
    33 #include "memory/resourceArea.hpp"
    33 #include "memory/resourceArea.hpp"
    34 #include "oops/compiledICHolder.hpp"
    34 #include "oops/compiledICHolder.hpp"
       
    35 #include "oops/klass.inline.hpp"
    35 #include "runtime/safepointMechanism.hpp"
    36 #include "runtime/safepointMechanism.hpp"
    36 #include "runtime/sharedRuntime.hpp"
    37 #include "runtime/sharedRuntime.hpp"
    37 #include "runtime/vframeArray.hpp"
    38 #include "runtime/vframeArray.hpp"
    38 #include "utilities/align.hpp"
    39 #include "utilities/align.hpp"
    39 #include "vmreg_sparc.inline.hpp"
    40 #include "vmreg_sparc.inline.hpp"
   559       else                  __ ldx(base, ld_off, G1_scratch);
   560       else                  __ ldx(base, ld_off, G1_scratch);
   560     }
   561     }
   561 
   562 
   562     if (r_1->is_Register()) {
   563     if (r_1->is_Register()) {
   563       Register r = r_1->as_Register()->after_restore();
   564       Register r = r_1->as_Register()->after_restore();
   564       if (sig_bt[i] == T_OBJECT || sig_bt[i] == T_ARRAY) {
   565       if (is_reference_type(sig_bt[i])) {
   565         store_c2i_object(r, base, st_off);
   566         store_c2i_object(r, base, st_off);
   566       } else if (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) {
   567       } else if (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) {
   567         store_c2i_long(r, base, st_off, r_2->is_stack());
   568         store_c2i_long(r, base, st_off, r_2->is_stack());
   568       } else {
   569       } else {
   569         store_c2i_int(r, base, st_off);
   570         store_c2i_int(r, base, st_off);
  1635                             const BasicType* sig_bt,
  1636                             const BasicType* sig_bt,
  1636                             const VMRegPair* regs) {
  1637                             const VMRegPair* regs) {
  1637   Register temp_reg = G5_method;  // not part of any compiled calling seq
  1638   Register temp_reg = G5_method;  // not part of any compiled calling seq
  1638   if (VerifyOops) {
  1639   if (VerifyOops) {
  1639     for (int i = 0; i < method->size_of_parameters(); i++) {
  1640     for (int i = 0; i < method->size_of_parameters(); i++) {
  1640       if (sig_bt[i] == T_OBJECT ||
  1641       if (is_reference_type(sig_bt[i])) {
  1641           sig_bt[i] == T_ARRAY) {
       
  1642         VMReg r = regs[i].first();
  1642         VMReg r = regs[i].first();
  1643         assert(r->is_valid(), "bad oop arg");
  1643         assert(r->is_valid(), "bad oop arg");
  1644         if (r->is_stack()) {
  1644         if (r->is_stack()) {
  1645           RegisterOrConstant ld_off = reg2offset(r) + STACK_BIAS;
  1645           RegisterOrConstant ld_off = reg2offset(r) + STACK_BIAS;
  1646           ld_off = __ ensure_simm13_or_reg(ld_off, temp_reg);
  1646           ld_off = __ ensure_simm13_or_reg(ld_off, temp_reg);
  1749 nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
  1749 nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
  1750                                                 const methodHandle& method,
  1750                                                 const methodHandle& method,
  1751                                                 int compile_id,
  1751                                                 int compile_id,
  1752                                                 BasicType* in_sig_bt,
  1752                                                 BasicType* in_sig_bt,
  1753                                                 VMRegPair* in_regs,
  1753                                                 VMRegPair* in_regs,
  1754                                                 BasicType ret_type) {
  1754                                                 BasicType ret_type,
       
  1755                                                 address critical_entry) {
  1755   if (method->is_method_handle_intrinsic()) {
  1756   if (method->is_method_handle_intrinsic()) {
  1756     vmIntrinsics::ID iid = method->intrinsic_id();
  1757     vmIntrinsics::ID iid = method->intrinsic_id();
  1757     intptr_t start = (intptr_t)__ pc();
  1758     intptr_t start = (intptr_t)__ pc();
  1758     int vep_offset = ((intptr_t)__ pc()) - start;
  1759     int vep_offset = ((intptr_t)__ pc()) - start;
  1759     gen_special_dispatch(masm,
  1760     gen_special_dispatch(masm,
  1772                                        in_ByteSize(-1),
  1773                                        in_ByteSize(-1),
  1773                                        in_ByteSize(-1),
  1774                                        in_ByteSize(-1),
  1774                                        (OopMapSet*)NULL);
  1775                                        (OopMapSet*)NULL);
  1775   }
  1776   }
  1776   bool is_critical_native = true;
  1777   bool is_critical_native = true;
  1777   address native_func = method->critical_native_function();
  1778   address native_func = critical_entry;
  1778   if (native_func == NULL) {
  1779   if (native_func == NULL) {
  1779     native_func = method->native_function();
  1780     native_func = method->native_function();
  1780     is_critical_native = false;
  1781     is_critical_native = false;
  1781   }
  1782   }
  1782   assert(native_func != NULL, "must have function");
  1783   assert(native_func != NULL, "must have function");
  1830     }
  1831     }
  1831 
  1832 
  1832     // Read the header and build a mask to get its hash field.  Give up if the object is not unlocked.
  1833     // Read the header and build a mask to get its hash field.  Give up if the object is not unlocked.
  1833     // We depend on hash_mask being at most 32 bits and avoid the use of
  1834     // We depend on hash_mask being at most 32 bits and avoid the use of
  1834     // hash_mask_in_place because it could be larger than 32 bits in a 64-bit
  1835     // hash_mask_in_place because it could be larger than 32 bits in a 64-bit
  1835     // vm: see markOop.hpp.
  1836     // vm: see markWord.hpp.
  1836     __ ld_ptr(obj_reg, oopDesc::mark_offset_in_bytes(), header);
  1837     __ ld_ptr(obj_reg, oopDesc::mark_offset_in_bytes(), header);
  1837     __ sethi(markOopDesc::hash_mask, mask);
  1838     __ sethi(markWord::hash_mask, mask);
  1838     __ btst(markOopDesc::unlocked_value, header);
  1839     __ btst(markWord::unlocked_value, header);
  1839     __ br(Assembler::zero, false, Assembler::pn, slowCase);
  1840     __ br(Assembler::zero, false, Assembler::pn, slowCase);
  1840     if (UseBiasedLocking) {
  1841     if (UseBiasedLocking) {
  1841       // Check if biased and fall through to runtime if so
  1842       // Check if biased and fall through to runtime if so
  1842       __ delayed()->nop();
  1843       __ delayed()->nop();
  1843       __ btst(markOopDesc::biased_lock_bit_in_place, header);
  1844       __ btst(markWord::biased_lock_bit_in_place, header);
  1844       __ br(Assembler::notZero, false, Assembler::pn, slowCase);
  1845       __ br(Assembler::notZero, false, Assembler::pn, slowCase);
  1845     }
  1846     }
  1846     __ delayed()->or3(mask, markOopDesc::hash_mask & 0x3ff, mask);
  1847     __ delayed()->or3(mask, markWord::hash_mask & 0x3ff, mask);
  1847 
  1848 
  1848     // Check for a valid (non-zero) hash code and get its value.
  1849     // Check for a valid (non-zero) hash code and get its value.
  1849     __ srlx(header, markOopDesc::hash_shift, hash);
  1850     __ srlx(header, markWord::hash_shift, hash);
  1850     __ andcc(hash, mask, hash);
  1851     __ andcc(hash, mask, hash);
  1851     __ br(Assembler::equal, false, Assembler::pn, slowCase);
  1852     __ br(Assembler::equal, false, Assembler::pn, slowCase);
  1852     __ delayed()->nop();
  1853     __ delayed()->nop();
  1853 
  1854 
  1854     // leaf return.
  1855     // leaf return.
  2504   // Clear "last Java frame" SP and PC.
  2505   // Clear "last Java frame" SP and PC.
  2505   __ verify_thread(); // G2_thread must be correct
  2506   __ verify_thread(); // G2_thread must be correct
  2506   __ reset_last_Java_frame();
  2507   __ reset_last_Java_frame();
  2507 
  2508 
  2508   // Unbox oop result, e.g. JNIHandles::resolve value in I0.
  2509   // Unbox oop result, e.g. JNIHandles::resolve value in I0.
  2509   if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
  2510   if (is_reference_type(ret_type)) {
  2510     __ resolve_jobject(I0, G3_scratch);
  2511     __ resolve_jobject(I0, G3_scratch);
  2511   }
  2512   }
  2512 
  2513 
  2513   if (CheckJNICalls) {
  2514   if (CheckJNICalls) {
  2514     // clear_pending_jni_exception_check
  2515     // clear_pending_jni_exception_check