src/hotspot/os_cpu/linux_arm/os_linux_arm.cpp
changeset 55490 3f3dc00a69a5
parent 54915 278600885731
child 55653 3243c42d737d
equal deleted inserted replaced
55489:c749ecf599c0 55490:3f3dc00a69a5
     1 /*
     1 /*
     2  * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   382         // BugId 4454115: A read from a MappedByteBuffer can fault
   382         // BugId 4454115: A read from a MappedByteBuffer can fault
   383         // here if the underlying file has been truncated.
   383         // here if the underlying file has been truncated.
   384         // Do not crash the VM in such a case.
   384         // Do not crash the VM in such a case.
   385         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
   385         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
   386         CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
   386         CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
   387         if (nm != NULL && nm->has_unsafe_access()) {
   387         if ((nm != NULL && nm->has_unsafe_access()) || (thread->doing_unsafe_access() && UnsafeCopyMemory::contains_pc(pc))) {
   388           unsafe_access = true;
   388           unsafe_access = true;
   389         }
   389         }
   390       } else if (sig == SIGSEGV &&
   390       } else if (sig == SIGSEGV &&
   391                  MacroAssembler::uses_implicit_null_check(info->si_addr)) {
   391                  MacroAssembler::uses_implicit_null_check(info->si_addr)) {
   392           // Determination of interpreter/vtable stub/compiled code null exception
   392           // Determination of interpreter/vtable stub/compiled code null exception
   396           }
   396           }
   397       } else if (sig == SIGILL && *(int *)pc == NativeInstruction::zombie_illegal_instruction) {
   397       } else if (sig == SIGILL && *(int *)pc == NativeInstruction::zombie_illegal_instruction) {
   398         // Zombie
   398         // Zombie
   399         stub = SharedRuntime::get_handle_wrong_method_stub();
   399         stub = SharedRuntime::get_handle_wrong_method_stub();
   400       }
   400       }
   401     } else if (thread->thread_state() == _thread_in_vm &&
   401     } else if ((thread->thread_state() == _thread_in_vm ||
       
   402                 thread->thread_state() == _thread_in_native) &&
   402                sig == SIGBUS && thread->doing_unsafe_access()) {
   403                sig == SIGBUS && thread->doing_unsafe_access()) {
   403         unsafe_access = true;
   404         unsafe_access = true;
   404     }
   405     }
   405 
   406 
   406     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
   407     // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
   416   if (unsafe_access && stub == NULL) {
   417   if (unsafe_access && stub == NULL) {
   417     // it can be an unsafe access and we haven't found
   418     // it can be an unsafe access and we haven't found
   418     // any other suitable exception reason,
   419     // any other suitable exception reason,
   419     // so assume it is an unsafe access.
   420     // so assume it is an unsafe access.
   420     address next_pc = pc + Assembler::InstructionSize;
   421     address next_pc = pc + Assembler::InstructionSize;
       
   422     if (UnsafeCopyMemory::contains_pc(pc)) {
       
   423       next_pc = UnsafeCopyMemory::page_error_continue_pc(pc);
       
   424     }
   421 #ifdef __thumb__
   425 #ifdef __thumb__
   422     if (uc->uc_mcontext.arm_cpsr & PSR_T_BIT) {
   426     if (uc->uc_mcontext.arm_cpsr & PSR_T_BIT) {
   423       next_pc = (address)((intptr_t)next_pc | 0x1);
   427       next_pc = (address)((intptr_t)next_pc | 0x1);
   424     }
   428     }
   425 #endif
   429 #endif