Mercurial > hg > truffle
annotate src/share/vm/ci/ciObjectFactory.hpp @ 20543:e7d0505c8a30
8059758: Footprint regressions with JDK-8038423
Summary: Changes in JDK-8038423 always initialize (zero out) virtual memory used for auxiliary data structures. This causes a footprint regression for G1 in startup benchmarks. This is because they do not touch that memory at all, so the operating system does not actually commit these pages. The fix is to, if the initialization value of the data structures matches the default value of just committed memory (=0), do not do anything.
Reviewed-by: jwilhelm, brutisso
author | tschatzl |
---|---|
date | Fri, 10 Oct 2014 15:51:58 +0200 |
parents | 2c6ef90f030a |
children | 6a528388c7da |
rev | line source |
---|---|
0 | 1 /* |
17467
55fb97c4c58d
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
mikael
parents:
12160
diff
changeset
|
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
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 | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_CI_CIOBJECTFACTORY_HPP |
26 #define SHARE_VM_CI_CIOBJECTFACTORY_HPP | |
27 | |
28 #include "ci/ciClassList.hpp" | |
29 #include "ci/ciObject.hpp" | |
30 #include "utilities/growableArray.hpp" | |
31 | |
0 | 32 // ciObjectFactory |
33 // | |
34 // This class handles requests for the creation of new instances | |
35 // of ciObject and its subclasses. It contains a caching mechanism | |
36 // which ensures that for each oop, at most one ciObject is created. | |
37 // This invariant allows efficient implementation of ciObject. | |
38 class ciObjectFactory : public ResourceObj { | |
3939 | 39 friend class VMStructs; |
40 friend class ciEnv; | |
41 | |
0 | 42 private: |
43 static volatile bool _initialized; | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
44 static GrowableArray<ciMetadata*>* _shared_ci_metadata; |
0 | 45 static ciSymbol* _shared_ci_symbols[]; |
46 static int _shared_ident_limit; | |
47 | |
48 Arena* _arena; | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
49 GrowableArray<ciMetadata*>* _ci_metadata; |
0 | 50 GrowableArray<ciMethod*>* _unloaded_methods; |
51 GrowableArray<ciKlass*>* _unloaded_klasses; | |
1602 | 52 GrowableArray<ciInstance*>* _unloaded_instances; |
0 | 53 GrowableArray<ciReturnAddress*>* _return_addresses; |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
54 GrowableArray<ciSymbol*>* _symbols; // keep list of symbols created |
0 | 55 int _next_ident; |
56 | |
57 public: | |
58 struct NonPermObject : public ResourceObj { | |
59 ciObject* _object; | |
60 NonPermObject* _next; | |
61 | |
62 inline NonPermObject(NonPermObject* &bucket, oop key, ciObject* object); | |
63 ciObject* object() { return _object; } | |
64 NonPermObject* &next() { return _next; } | |
65 }; | |
66 private: | |
67 enum { NON_PERM_BUCKETS = 61 }; | |
68 NonPermObject* _non_perm_bucket[NON_PERM_BUCKETS]; | |
69 int _non_perm_count; | |
70 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
71 int find(Metadata* key, GrowableArray<ciMetadata*>* objects); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
72 bool is_found_at(int index, Metadata* key, GrowableArray<ciMetadata*>* objects); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
73 void insert(int index, ciMetadata* obj, GrowableArray<ciMetadata*>* objects); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
74 |
0 | 75 ciObject* create_new_object(oop o); |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
76 ciMetadata* create_new_object(Metadata* o); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
77 |
20278
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
17467
diff
changeset
|
78 void ensure_metadata_alive(ciMetadata* m); |
2c6ef90f030a
8049421: G1 Class Unloading after completing a concurrent mark cycle
stefank
parents:
17467
diff
changeset
|
79 |
0 | 80 static bool is_equal(NonPermObject* p, oop key) { |
81 return p->object()->get_oop() == key; | |
82 } | |
83 | |
84 NonPermObject* &find_non_perm(oop key); | |
85 void insert_non_perm(NonPermObject* &where, oop key, ciObject* obj); | |
86 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
87 void init_ident_of(ciBaseObject* obj); |
0 | 88 |
89 Arena* arena() { return _arena; } | |
90 | |
91 void print_contents_impl(); | |
92 | |
1602 | 93 ciInstance* get_unloaded_instance(ciInstanceKlass* klass); |
94 | |
0 | 95 public: |
96 static bool is_initialized() { return _initialized; } | |
97 | |
98 static void initialize(); | |
99 void init_shared_objects(); | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
100 void remove_symbols(); |
0 | 101 |
102 ciObjectFactory(Arena* arena, int expected_size); | |
103 | |
104 // Get the ciObject corresponding to some oop. | |
105 ciObject* get(oop key); | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
106 ciMetadata* get_metadata(Metadata* key); |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
107 ciSymbol* get_symbol(Symbol* key); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
108 |
0 | 109 // Get the ciSymbol corresponding to one of the vmSymbols. |
110 static ciSymbol* vm_symbol_at(int index); | |
111 | |
112 // Get the ciMethod representing an unloaded/unfound method. | |
113 ciMethod* get_unloaded_method(ciInstanceKlass* holder, | |
114 ciSymbol* name, | |
4001
5eb9169b1a14
7092712: JSR 292: unloaded invokedynamic call sites can lead to a crash with signature types not on BCP
twisti
parents:
3939
diff
changeset
|
115 ciSymbol* signature, |
5eb9169b1a14
7092712: JSR 292: unloaded invokedynamic call sites can lead to a crash with signature types not on BCP
twisti
parents:
3939
diff
changeset
|
116 ciInstanceKlass* accessor); |
0 | 117 |
118 // Get a ciKlass representing an unloaded klass. | |
119 ciKlass* get_unloaded_klass(ciKlass* accessing_klass, | |
120 ciSymbol* name, | |
121 bool create_if_not_found); | |
122 | |
1602 | 123 // Get a ciInstance representing an unresolved klass mirror. |
124 ciInstance* get_unloaded_klass_mirror(ciKlass* type); | |
125 | |
126 // Get a ciInstance representing an unresolved method handle constant. | |
127 ciInstance* get_unloaded_method_handle_constant(ciKlass* holder, | |
128 ciSymbol* name, | |
129 ciSymbol* signature, | |
130 int ref_kind); | |
131 | |
132 // Get a ciInstance representing an unresolved method type constant. | |
133 ciInstance* get_unloaded_method_type_constant(ciSymbol* signature); | |
134 | |
0 | 135 |
12160
f98f5d48f511
7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
roland
parents:
6972
diff
changeset
|
136 ciInstance* get_unloaded_object_constant(); |
f98f5d48f511
7199175: JSR 292: C1 needs patching when invokedynamic/invokehandle call site is not linked
roland
parents:
6972
diff
changeset
|
137 |
0 | 138 // Get the ciMethodData representing the methodData for a method |
139 // with none. | |
140 ciMethodData* get_empty_methodData(); | |
141 | |
142 ciReturnAddress* get_return_address(int bci); | |
143 | |
6972
bd7a7ce2e264
6830717: replay of compilations would help with debugging
minqi
parents:
6725
diff
changeset
|
144 GrowableArray<ciMetadata*>* get_ci_metadata() const { return _ci_metadata; } |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
145 // RedefineClasses support |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
146 void metadata_do(void f(Metadata*)); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
4001
diff
changeset
|
147 |
0 | 148 void print_contents(); |
149 void print(); | |
150 }; | |
1972 | 151 |
152 #endif // SHARE_VM_CI_CIOBJECTFACTORY_HPP |