comparison src/share/vm/oops/compiledICHolder.hpp @ 9057:b44df6c5942c

Added tag jdk8u232-ga for changeset 12177d88b89c
author andrew
date Tue, 15 Oct 2019 21:37:52 +0100
parents f8a45a60bc6b
children
comparison
equal deleted inserted replaced
1:912fe29cb87c 2:ef887349ef40
1 /* 1 /*
2 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1998, 2018, 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.
24 24
25 #ifndef SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP 25 #ifndef SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
26 #define SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP 26 #define SHARE_VM_OOPS_COMPILEDICHOLDEROOP_HPP
27 27
28 #include "oops/oop.hpp" 28 #include "oops/oop.hpp"
29 #include "oops/klass.hpp"
30 #include "oops/method.hpp"
29 31
30 // A CompiledICHolder* is a helper object for the inline cache implementation. 32 // A CompiledICHolder* is a helper object for the inline cache implementation.
31 // It holds: 33 // It holds:
32 // (1) (method+klass pair) when converting from compiled to an interpreted call 34 // (1) (method+klass pair) when converting from compiled to an interpreted call
33 // (2) (klass+klass pair) when calling itable stub from megamorphic compiled call 35 // (2) (klass+klass pair) when calling itable stub from megamorphic compiled call
46 // reachable by iterating over nmethods 48 // reachable by iterating over nmethods
47 49
48 Metadata* _holder_metadata; 50 Metadata* _holder_metadata;
49 Klass* _holder_klass; // to avoid name conflict with oopDesc::_klass 51 Klass* _holder_klass; // to avoid name conflict with oopDesc::_klass
50 CompiledICHolder* _next; 52 CompiledICHolder* _next;
53 bool _is_metadata_method;
51 54
52 public: 55 public:
53 // Constructor 56 // Constructor
54 CompiledICHolder(Metadata* metadata, Klass* klass) 57 CompiledICHolder(Metadata* metadata, Klass* klass, bool is_method = true)
55 : _holder_metadata(metadata), _holder_klass(klass) { 58 : _holder_metadata(metadata), _holder_klass(klass), _is_metadata_method(is_method) {
56 #ifdef ASSERT 59 #ifdef ASSERT
57 Atomic::inc(&_live_count); 60 Atomic::inc(&_live_count);
58 Atomic::inc(&_live_not_claimed_count); 61 Atomic::inc(&_live_not_claimed_count);
59 #endif 62 #endif
60 } 63 }
80 static int holder_klass_offset() { return offset_of(CompiledICHolder, _holder_klass); } 83 static int holder_klass_offset() { return offset_of(CompiledICHolder, _holder_klass); }
81 84
82 CompiledICHolder* next() { return _next; } 85 CompiledICHolder* next() { return _next; }
83 void set_next(CompiledICHolder* n) { _next = n; } 86 void set_next(CompiledICHolder* n) { _next = n; }
84 87
85 bool is_loader_alive(BoolObjectClosure* is_alive); 88 inline bool is_loader_alive(BoolObjectClosure* is_alive) {
89 Klass* k = _is_metadata_method ? ((Method*)_holder_metadata)->method_holder() : (Klass*)_holder_metadata;
90 if (!k->is_loader_alive(is_alive)) {
91 return false;
92 }
93 if (!_holder_klass->is_loader_alive(is_alive)) {
94 return false;
95 }
96 return true;
97 }
86 98
87 // Verify 99 // Verify
88 void verify_on(outputStream* st); 100 void verify_on(outputStream* st);
89 101
90 // Printing 102 // Printing