26 #include "classfile/systemDictionary.hpp"
27 #include "code/codeBehaviours.hpp"
28 #include "code/codeCache.hpp"
29 #include "code/compiledIC.hpp"
30 #include "code/icBuffer.hpp"
31 #include "code/nmethod.hpp"
32 #include "code/vtableStubs.hpp"
33 #include "interpreter/interpreter.hpp"
34 #include "interpreter/linkResolver.hpp"
35 #include "memory/metadataFactory.hpp"
36 #include "memory/oopFactory.hpp"
37 #include "memory/resourceArea.hpp"
38 #include "memory/universe.hpp"
39 #include "oops/method.inline.hpp"
40 #include "oops/oop.inline.hpp"
41 #include "oops/symbol.hpp"
42 #include "runtime/handles.inline.hpp"
43 #include "runtime/icache.hpp"
44 #include "runtime/sharedRuntime.hpp"
45 #include "runtime/stubRoutines.hpp"
46 #include "utilities/events.hpp"
47
48
49 // Every time a compiled IC is changed or its type is being accessed,
50 // either the CompiledIC_lock must be set or we must be at a safe point.
51
52 CompiledICLocker::CompiledICLocker(CompiledMethod* method)
53 : _method(method),
54 _behaviour(CompiledICProtectionBehaviour::current()),
55 _locked(_behaviour->lock(_method)) {
56 }
57
58 CompiledICLocker::~CompiledICLocker() {
59 if (_locked) {
60 _behaviour->unlock(_method);
61 }
62 }
63
64 bool CompiledICLocker::is_safe(CompiledMethod* method) {
65 return CompiledICProtectionBehaviour::current()->is_safe(method);
66 }
|
26 #include "classfile/systemDictionary.hpp"
27 #include "code/codeBehaviours.hpp"
28 #include "code/codeCache.hpp"
29 #include "code/compiledIC.hpp"
30 #include "code/icBuffer.hpp"
31 #include "code/nmethod.hpp"
32 #include "code/vtableStubs.hpp"
33 #include "interpreter/interpreter.hpp"
34 #include "interpreter/linkResolver.hpp"
35 #include "memory/metadataFactory.hpp"
36 #include "memory/oopFactory.hpp"
37 #include "memory/resourceArea.hpp"
38 #include "memory/universe.hpp"
39 #include "oops/method.inline.hpp"
40 #include "oops/oop.inline.hpp"
41 #include "oops/symbol.hpp"
42 #include "runtime/handles.inline.hpp"
43 #include "runtime/icache.hpp"
44 #include "runtime/sharedRuntime.hpp"
45 #include "runtime/stubRoutines.hpp"
46 #include "utilities/events.inline.hpp"
47
48
49 // Every time a compiled IC is changed or its type is being accessed,
50 // either the CompiledIC_lock must be set or we must be at a safe point.
51
52 CompiledICLocker::CompiledICLocker(CompiledMethod* method)
53 : _method(method),
54 _behaviour(CompiledICProtectionBehaviour::current()),
55 _locked(_behaviour->lock(_method)) {
56 }
57
58 CompiledICLocker::~CompiledICLocker() {
59 if (_locked) {
60 _behaviour->unlock(_method);
61 }
62 }
63
64 bool CompiledICLocker::is_safe(CompiledMethod* method) {
65 return CompiledICProtectionBehaviour::current()->is_safe(method);
66 }
|