Top


定義場所(file name)

hotspot/src/os_cpu/solaris_x86/vm/assembler_solaris_x86.cpp

名前(function name)

void MacroAssembler::get_thread(Register thread) {

本体部(body)

      int segment = NOT_LP64(Assembler::GS_segment) LP64_ONLY(Assembler::FS_segment);
      // Try to emit a Solaris-specific fast TSD/TLS accessor.
      ThreadLocalStorage::pd_tlsAccessMode tlsMode = ThreadLocalStorage::pd_getTlsAccessMode ();
      if (tlsMode == ThreadLocalStorage::pd_tlsAccessIndirect) {            // T1
         // Use thread as a temporary: mov r, gs:[0]; mov r, [r+tlsOffset]
         emit_byte (segment);
         // ExternalAddress doesn't work because it can't take NULL
         AddressLiteral null(0, relocInfo::none);
         movptr (thread, null);
         movptr(thread, Address(thread, ThreadLocalStorage::pd_getTlsOffset())) ;
         return ;
      } else
      if (tlsMode == ThreadLocalStorage::pd_tlsAccessDirect) {              // T2
         // mov r, gs:[tlsOffset]
         emit_byte (segment);
         AddressLiteral tls_off((address)ThreadLocalStorage::pd_getTlsOffset(), relocInfo::none);
         movptr (thread, tls_off);
         return ;
      }

      slow_call_thr_specific(this, thread);

    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.