src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp
changeset 58505 c16f3a24a6fc
parent 54440 23a04fe2aca2
child 58556 ff8716224f35
equal deleted inserted replaced
58504:94dd00d2da29 58505:c16f3a24a6fc
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
     3  * Copyright (c) 2014, 2018, Red Hat Inc. All rights reserved.
     3  * Copyright (c) 2014, 2018, Red Hat Inc. All rights reserved.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5  *
     5  *
     6  * This code is free software; you can redistribute it and/or modify it
     6  * This code is free software; you can redistribute it and/or modify it
     7  * under the terms of the GNU General Public License version 2 only, as
     7  * under the terms of the GNU General Public License version 2 only, as
   160   }
   160   }
   161 
   161 
   162   // Creation also verifies the object.
   162   // Creation also verifies the object.
   163   NativeMovConstReg* method_holder
   163   NativeMovConstReg* method_holder
   164     = nativeMovConstReg_at(stub + NativeInstruction::instruction_size);
   164     = nativeMovConstReg_at(stub + NativeInstruction::instruction_size);
   165 #ifndef PRODUCT
   165 
       
   166 #ifdef ASSERT
   166   NativeGeneralJump* jump = nativeGeneralJump_at(method_holder->next_instruction_address());
   167   NativeGeneralJump* jump = nativeGeneralJump_at(method_holder->next_instruction_address());
   167 
   168   verify_mt_safe(callee, entry, method_holder, jump);
   168   // read the value once
       
   169   volatile intptr_t data = method_holder->data();
       
   170   assert(data == 0 || data == (intptr_t)callee(),
       
   171          "a) MT-unsafe modification of inline cache");
       
   172   assert(data == 0 || jump->jump_destination() == entry,
       
   173          "b) MT-unsafe modification of inline cache");
       
   174 #endif
   169 #endif
       
   170 
   175   // Update stub.
   171   // Update stub.
   176   method_holder->set_data((intptr_t)callee());
   172   method_holder->set_data((intptr_t)callee());
   177   NativeGeneralJump::insert_unconditional(method_holder->next_instruction_address(), entry);
   173   NativeGeneralJump::insert_unconditional(method_holder->next_instruction_address(), entry);
   178   ICache::invalidate_range(stub, to_interp_stub_size());
   174   ICache::invalidate_range(stub, to_interp_stub_size());
   179   // Update jump to call.
   175   // Update jump to call.