equal
deleted
inserted
replaced
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 * 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. |
50 // either the CompiledIC_lock must be set or we must be at a safe point. |
50 // either the CompiledIC_lock must be set or we must be at a safe point. |
51 |
51 |
52 CompiledICLocker::CompiledICLocker(CompiledMethod* method) |
52 CompiledICLocker::CompiledICLocker(CompiledMethod* method) |
53 : _method(method), |
53 : _method(method), |
54 _behaviour(CompiledICProtectionBehaviour::current()), |
54 _behaviour(CompiledICProtectionBehaviour::current()), |
55 _locked(_behaviour->lock(_method)), |
55 _locked(_behaviour->lock(_method)) { |
56 _nsv(true, !SafepointSynchronize::is_at_safepoint()) { |
|
57 } |
56 } |
58 |
57 |
59 CompiledICLocker::~CompiledICLocker() { |
58 CompiledICLocker::~CompiledICLocker() { |
60 if (_locked) { |
59 if (_locked) { |
61 _behaviour->unlock(_method); |
60 _behaviour->unlock(_method); |
740 tty->print("interpreted"); |
739 tty->print("interpreted"); |
741 } |
740 } |
742 tty->cr(); |
741 tty->cr(); |
743 } |
742 } |
744 |
743 |
|
744 void CompiledDirectStaticCall::verify_mt_safe(const methodHandle& callee, address entry, |
|
745 NativeMovConstReg* method_holder, |
|
746 NativeJump* jump) { |
|
747 // A generated lambda form might be deleted from the Lambdaform |
|
748 // cache in MethodTypeForm. If a jit compiled lambdaform method |
|
749 // becomes not entrant and the cache access returns null, the new |
|
750 // resolve will lead to a new generated LambdaForm. |
|
751 Method* old_method = reinterpret_cast<Method*>(method_holder->data()); |
|
752 assert(old_method == NULL || old_method == callee() || |
|
753 callee->is_compiled_lambda_form() || |
|
754 !old_method->method_holder()->is_loader_alive() || |
|
755 old_method->is_old(), // may be race patching deoptimized nmethod due to redefinition. |
|
756 "a) MT-unsafe modification of inline cache"); |
|
757 |
|
758 address destination = jump->jump_destination(); |
|
759 assert(destination == (address)-1 || destination == entry, |
|
760 "b) MT-unsafe modification of inline cache"); |
|
761 } |
745 #endif // !PRODUCT |
762 #endif // !PRODUCT |