1.1 --- a/src/os/linux/vm/os_linux.cpp Tue Dec 19 15:25:06 2017 -0800 1.2 +++ b/src/os/linux/vm/os_linux.cpp Mon May 28 10:33:52 2018 +0800 1.3 @@ -979,6 +979,14 @@ 1.4 Monitor* sync_with_child = osthread->startThread_lock(); 1.5 MutexLockerEx ml(sync_with_child, Mutex::_no_safepoint_check_flag); 1.6 sync_with_child->notify(); 1.7 + 1.8 +#ifdef MIPS64 1.9 + /* 2013/11/5 Jin: To be accessed in NativeGeneralJump::patch_verified_entry() */ 1.10 + if (thread->is_Java_thread()) 1.11 + { 1.12 + ((JavaThread*)thread)->set_handle_wrong_method_stub(SharedRuntime::get_handle_wrong_method_stub()); 1.13 + } 1.14 +#endif 1.15 } 1.16 1.17 // Free Linux resources related to the OSThread 1.18 @@ -1909,6 +1917,7 @@ 1.19 {EM_ALPHA, EM_ALPHA, ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"}, 1.20 {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"}, 1.21 {EM_MIPS, EM_MIPS, ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"}, 1.22 + {EM_MIPS, EM_MIPS, ELFCLASS64, ELFDATA2LSB, (char*)"MIPS64 LE"}, 1.23 {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"}, 1.24 {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"} 1.25 }; 1.26 @@ -1923,6 +1932,8 @@ 1.27 static Elf32_Half running_arch_code=EM_SPARCV9; 1.28 #elif (defined __sparc) && (!defined _LP64) 1.29 static Elf32_Half running_arch_code=EM_SPARC; 1.30 + #elif (defined MIPS64) 1.31 + static Elf32_Half running_arch_code=EM_MIPS; 1.32 #elif (defined __powerpc64__) 1.33 static Elf32_Half running_arch_code=EM_PPC64; 1.34 #elif (defined __powerpc__) 1.35 @@ -1943,7 +1954,7 @@ 1.36 static Elf32_Half running_arch_code=EM_68K; 1.37 #else 1.38 #error Method os::dll_load requires that one of following is defined:\ 1.39 - IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K 1.40 + IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, __mips64, PARISC, M68K 1.41 #endif 1.42 1.43 // Identify compatability class for VM's architecture and library's architecture 1.44 @@ -3362,7 +3373,7 @@ 1.45 1.46 #ifndef ZERO 1.47 large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M) 1.48 - ARM_ONLY(2 * M) PPC_ONLY(4 * M); 1.49 + ARM_ONLY(2 * M) PPC_ONLY(4 * M) MIPS64_ONLY(4 * M); //In MIPS _large_page_size is seted 4*M. 1.50 #endif // ZERO 1.51 1.52 FILE *fp = fopen("/proc/meminfo", "r"); 1.53 @@ -4957,7 +4968,12 @@ 1.54 Linux::fast_thread_clock_init(); 1.55 1.56 // Allocate a single page and mark it as readable for safepoint polling 1.57 +#ifdef OPT_SAFEPOINT 1.58 + void * p = (void *)(0x10000); 1.59 + address polling_page = (address) ::mmap(p, Linux::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); 1.60 +#else 1.61 address polling_page = (address) ::mmap(NULL, Linux::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); 1.62 +#endif 1.63 guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" ); 1.64 1.65 os::set_polling_page( polling_page ); 1.66 @@ -4992,13 +5008,18 @@ 1.67 // size. Add a page for compiler2 recursion in main thread. 1.68 // Add in 2*BytesPerWord times page size to account for VM stack during 1.69 // class initialization depending on 32 or 64 bit VM. 1.70 + 1.71 + /* 2014/1/2 Liao: JDK8 requires larger -Xss option. 1.72 + * TongWeb cannot run with -Xss192K. 1.73 + * We are not sure whether this causes errors, so simply print a warning. */ 1.74 + size_t min_stack_allowed_jdk6 = os::Linux::min_stack_allowed; 1.75 os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed, 1.76 (size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() + 1.77 (2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size()); 1.78 1.79 size_t threadStackSizeInBytes = ThreadStackSize * K; 1.80 if (threadStackSizeInBytes != 0 && 1.81 - threadStackSizeInBytes < os::Linux::min_stack_allowed) { 1.82 + threadStackSizeInBytes < min_stack_allowed_jdk6) { 1.83 tty->print_cr("\nThe stack size specified is too small, " 1.84 "Specify at least %dk", 1.85 os::Linux::min_stack_allowed/ K);