Mon, 01 Dec 2014 13:06:20 -0500
8064524: Compiler code generation improvements
Reviewed-by: jrose, acorn, vlivanov
1 /*
2 * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
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 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
25 #ifndef SHARE_VM_CODE_DEPENDENCIES_HPP
26 #define SHARE_VM_CODE_DEPENDENCIES_HPP
28 #include "ci/ciCallSite.hpp"
29 #include "ci/ciKlass.hpp"
30 #include "ci/ciMethodHandle.hpp"
31 #include "classfile/systemDictionary.hpp"
32 #include "code/compressedStream.hpp"
33 #include "code/nmethod.hpp"
34 #include "utilities/growableArray.hpp"
36 //** Dependencies represent assertions (approximate invariants) within
37 // the runtime system, e.g. class hierarchy changes. An example is an
38 // assertion that a given method is not overridden; another example is
39 // that a type has only one concrete subtype. Compiled code which
40 // relies on such assertions must be discarded if they are overturned
41 // by changes in the runtime system. We can think of these assertions
42 // as approximate invariants, because we expect them to be overturned
43 // very infrequently. We are willing to perform expensive recovery
44 // operations when they are overturned. The benefit, of course, is
45 // performing optimistic optimizations (!) on the object code.
46 //
47 // Changes in the class hierarchy due to dynamic linking or
48 // class evolution can violate dependencies. There is enough
49 // indexing between classes and nmethods to make dependency
50 // checking reasonably efficient.
52 class ciEnv;
53 class nmethod;
54 class OopRecorder;
55 class xmlStream;
56 class CompileLog;
57 class DepChange;
58 class KlassDepChange;
59 class CallSiteDepChange;
60 class No_Safepoint_Verifier;
62 class Dependencies: public ResourceObj {
63 public:
64 // Note: In the comments on dependency types, most uses of the terms
65 // subtype and supertype are used in a "non-strict" or "inclusive"
66 // sense, and are starred to remind the reader of this fact.
67 // Strict uses of the terms use the word "proper".
68 //
69 // Specifically, every class is its own subtype* and supertype*.
70 // (This trick is easier than continually saying things like "Y is a
71 // subtype of X or X itself".)
72 //
73 // Sometimes we write X > Y to mean X is a proper supertype of Y.
74 // The notation X > {Y, Z} means X has proper subtypes Y, Z.
75 // The notation X.m > Y means that Y inherits m from X, while
76 // X.m > Y.m means Y overrides X.m. A star denotes abstractness,
77 // as *I > A, meaning (abstract) interface I is a super type of A,
78 // or A.*m > B.m, meaning B.m implements abstract method A.m.
79 //
80 // In this module, the terms "subtype" and "supertype" refer to
81 // Java-level reference type conversions, as detected by
82 // "instanceof" and performed by "checkcast" operations. The method
83 // Klass::is_subtype_of tests these relations. Note that "subtype"
84 // is richer than "subclass" (as tested by Klass::is_subclass_of),
85 // since it takes account of relations involving interface and array
86 // types.
87 //
88 // To avoid needless complexity, dependencies involving array types
89 // are not accepted. If you need to make an assertion about an
90 // array type, make the assertion about its corresponding element
91 // types. Any assertion that might change about an array type can
92 // be converted to an assertion about its element type.
93 //
94 // Most dependencies are evaluated over a "context type" CX, which
95 // stands for the set Subtypes(CX) of every Java type that is a subtype*
96 // of CX. When the system loads a new class or interface N, it is
97 // responsible for re-evaluating changed dependencies whose context
98 // type now includes N, that is, all super types of N.
99 //
100 enum DepType {
101 end_marker = 0,
103 // An 'evol' dependency simply notes that the contents of the
104 // method were used. If it evolves (is replaced), the nmethod
105 // must be recompiled. No other dependencies are implied.
106 evol_method,
107 FIRST_TYPE = evol_method,
109 // A context type CX is a leaf it if has no proper subtype.
110 leaf_type,
112 // An abstract class CX has exactly one concrete subtype CC.
113 abstract_with_unique_concrete_subtype,
115 // The type CX is purely abstract, with no concrete subtype* at all.
116 abstract_with_no_concrete_subtype,
118 // The concrete CX is free of concrete proper subtypes.
119 concrete_with_no_concrete_subtype,
121 // Given a method M1 and a context class CX, the set MM(CX, M1) of
122 // "concrete matching methods" in CX of M1 is the set of every
123 // concrete M2 for which it is possible to create an invokevirtual
124 // or invokeinterface call site that can reach either M1 or M2.
125 // That is, M1 and M2 share a name, signature, and vtable index.
126 // We wish to notice when the set MM(CX, M1) is just {M1}, or
127 // perhaps a set of two {M1,M2}, and issue dependencies on this.
129 // The set MM(CX, M1) can be computed by starting with any matching
130 // concrete M2 that is inherited into CX, and then walking the
131 // subtypes* of CX looking for concrete definitions.
133 // The parameters to this dependency are the method M1 and the
134 // context class CX. M1 must be either inherited in CX or defined
135 // in a subtype* of CX. It asserts that MM(CX, M1) is no greater
136 // than {M1}.
137 unique_concrete_method, // one unique concrete method under CX
139 // An "exclusive" assertion concerns two methods or subtypes, and
140 // declares that there are at most two (or perhaps later N>2)
141 // specific items that jointly satisfy the restriction.
142 // We list all items explicitly rather than just giving their
143 // count, for robustness in the face of complex schema changes.
145 // A context class CX (which may be either abstract or concrete)
146 // has two exclusive concrete subtypes* C1, C2 if every concrete
147 // subtype* of CX is either C1 or C2. Note that if neither C1 or C2
148 // are equal to CX, then CX itself must be abstract. But it is
149 // also possible (for example) that C1 is CX (a concrete class)
150 // and C2 is a proper subtype of C1.
151 abstract_with_exclusive_concrete_subtypes_2,
153 // This dependency asserts that MM(CX, M1) is no greater than {M1,M2}.
154 exclusive_concrete_methods_2,
156 // This dependency asserts that no instances of class or it's
157 // subclasses require finalization registration.
158 no_finalizable_subclasses,
160 // This dependency asserts when the CallSite.target value changed.
161 call_site_target_value,
163 TYPE_LIMIT
164 };
165 enum {
166 LG2_TYPE_LIMIT = 4, // assert(TYPE_LIMIT <= (1<<LG2_TYPE_LIMIT))
168 // handy categorizations of dependency types:
169 all_types = ((1 << TYPE_LIMIT) - 1) & ((-1) << FIRST_TYPE),
171 non_klass_types = (1 << call_site_target_value),
172 klass_types = all_types & ~non_klass_types,
174 non_ctxk_types = (1 << evol_method),
175 implicit_ctxk_types = (1 << call_site_target_value),
176 explicit_ctxk_types = all_types & ~(non_ctxk_types | implicit_ctxk_types),
178 max_arg_count = 3, // current maximum number of arguments (incl. ctxk)
180 // A "context type" is a class or interface that
181 // provides context for evaluating a dependency.
182 // When present, it is one of the arguments (dep_context_arg).
183 //
184 // If a dependency does not have a context type, there is a
185 // default context, depending on the type of the dependency.
186 // This bit signals that a default context has been compressed away.
187 default_context_type_bit = (1<<LG2_TYPE_LIMIT)
188 };
190 static const char* dep_name(DepType dept);
191 static int dep_args(DepType dept);
193 static bool is_klass_type( DepType dept) { return dept_in_mask(dept, klass_types ); }
195 static bool has_explicit_context_arg(DepType dept) { return dept_in_mask(dept, explicit_ctxk_types); }
196 static bool has_implicit_context_arg(DepType dept) { return dept_in_mask(dept, implicit_ctxk_types); }
198 static int dep_context_arg(DepType dept) { return has_explicit_context_arg(dept) ? 0 : -1; }
199 static int dep_implicit_context_arg(DepType dept) { return has_implicit_context_arg(dept) ? 0 : -1; }
201 static void check_valid_dependency_type(DepType dept);
203 private:
204 // State for writing a new set of dependencies:
205 GrowableArray<int>* _dep_seen; // (seen[h->ident] & (1<<dept))
206 GrowableArray<ciBaseObject*>* _deps[TYPE_LIMIT];
208 static const char* _dep_name[TYPE_LIMIT];
209 static int _dep_args[TYPE_LIMIT];
211 static bool dept_in_mask(DepType dept, int mask) {
212 return (int)dept >= 0 && dept < TYPE_LIMIT && ((1<<dept) & mask) != 0;
213 }
215 bool note_dep_seen(int dept, ciBaseObject* x) {
216 assert(dept < BitsPerInt, "oob");
217 int x_id = x->ident();
218 assert(_dep_seen != NULL, "deps must be writable");
219 int seen = _dep_seen->at_grow(x_id, 0);
220 _dep_seen->at_put(x_id, seen | (1<<dept));
221 // return true if we've already seen dept/x
222 return (seen & (1<<dept)) != 0;
223 }
225 bool maybe_merge_ctxk(GrowableArray<ciBaseObject*>* deps,
226 int ctxk_i, ciKlass* ctxk);
228 void sort_all_deps();
229 size_t estimate_size_in_bytes();
231 // Initialize _deps, etc.
232 void initialize(ciEnv* env);
234 // State for making a new set of dependencies:
235 OopRecorder* _oop_recorder;
237 // Logging support
238 CompileLog* _log;
240 address _content_bytes; // everything but the oop references, encoded
241 size_t _size_in_bytes;
243 public:
244 // Make a new empty dependencies set.
245 Dependencies(ciEnv* env) {
246 initialize(env);
247 }
249 private:
250 // Check for a valid context type.
251 // Enforce the restriction against array types.
252 static void check_ctxk(ciKlass* ctxk) {
253 assert(ctxk->is_instance_klass(), "java types only");
254 }
255 static void check_ctxk_concrete(ciKlass* ctxk) {
256 assert(is_concrete_klass(ctxk->as_instance_klass()), "must be concrete");
257 }
258 static void check_ctxk_abstract(ciKlass* ctxk) {
259 check_ctxk(ctxk);
260 assert(!is_concrete_klass(ctxk->as_instance_klass()), "must be abstract");
261 }
263 void assert_common_1(DepType dept, ciBaseObject* x);
264 void assert_common_2(DepType dept, ciBaseObject* x0, ciBaseObject* x1);
265 void assert_common_3(DepType dept, ciKlass* ctxk, ciBaseObject* x1, ciBaseObject* x2);
267 public:
268 // Adding assertions to a new dependency set at compile time:
269 void assert_evol_method(ciMethod* m);
270 void assert_leaf_type(ciKlass* ctxk);
271 void assert_abstract_with_unique_concrete_subtype(ciKlass* ctxk, ciKlass* conck);
272 void assert_abstract_with_no_concrete_subtype(ciKlass* ctxk);
273 void assert_concrete_with_no_concrete_subtype(ciKlass* ctxk);
274 void assert_unique_concrete_method(ciKlass* ctxk, ciMethod* uniqm);
275 void assert_abstract_with_exclusive_concrete_subtypes(ciKlass* ctxk, ciKlass* k1, ciKlass* k2);
276 void assert_exclusive_concrete_methods(ciKlass* ctxk, ciMethod* m1, ciMethod* m2);
277 void assert_has_no_finalizable_subclasses(ciKlass* ctxk);
278 void assert_call_site_target_value(ciCallSite* call_site, ciMethodHandle* method_handle);
280 // Define whether a given method or type is concrete.
281 // These methods define the term "concrete" as used in this module.
282 // For this module, an "abstract" class is one which is non-concrete.
283 //
284 // Future optimizations may allow some classes to remain
285 // non-concrete until their first instantiation, and allow some
286 // methods to remain non-concrete until their first invocation.
287 // In that case, there would be a middle ground between concrete
288 // and abstract (as defined by the Java language and VM).
289 static bool is_concrete_klass(Klass* k); // k is instantiable
290 static bool is_concrete_method(Method* m, Klass* k); // m is invocable
291 static Klass* find_finalizable_subclass(Klass* k);
293 // These versions of the concreteness queries work through the CI.
294 // The CI versions are allowed to skew sometimes from the VM
295 // (oop-based) versions. The cost of such a difference is a
296 // (safely) aborted compilation, or a deoptimization, or a missed
297 // optimization opportunity.
298 //
299 // In order to prevent spurious assertions, query results must
300 // remain stable within any single ciEnv instance. (I.e., they must
301 // not go back into the VM to get their value; they must cache the
302 // bit in the CI, either eagerly or lazily.)
303 static bool is_concrete_klass(ciInstanceKlass* k); // k appears instantiable
304 static bool has_finalizable_subclass(ciInstanceKlass* k);
306 // As a general rule, it is OK to compile under the assumption that
307 // a given type or method is concrete, even if it at some future
308 // point becomes abstract. So dependency checking is one-sided, in
309 // that it permits supposedly concrete classes or methods to turn up
310 // as really abstract. (This shouldn't happen, except during class
311 // evolution, but that's the logic of the checking.) However, if a
312 // supposedly abstract class or method suddenly becomes concrete, a
313 // dependency on it must fail.
315 // Checking old assertions at run-time (in the VM only):
316 static Klass* check_evol_method(Method* m);
317 static Klass* check_leaf_type(Klass* ctxk);
318 static Klass* check_abstract_with_unique_concrete_subtype(Klass* ctxk, Klass* conck,
319 KlassDepChange* changes = NULL);
320 static Klass* check_abstract_with_no_concrete_subtype(Klass* ctxk,
321 KlassDepChange* changes = NULL);
322 static Klass* check_concrete_with_no_concrete_subtype(Klass* ctxk,
323 KlassDepChange* changes = NULL);
324 static Klass* check_unique_concrete_method(Klass* ctxk, Method* uniqm,
325 KlassDepChange* changes = NULL);
326 static Klass* check_abstract_with_exclusive_concrete_subtypes(Klass* ctxk, Klass* k1, Klass* k2,
327 KlassDepChange* changes = NULL);
328 static Klass* check_exclusive_concrete_methods(Klass* ctxk, Method* m1, Method* m2,
329 KlassDepChange* changes = NULL);
330 static Klass* check_has_no_finalizable_subclasses(Klass* ctxk, KlassDepChange* changes = NULL);
331 static Klass* check_call_site_target_value(oop call_site, oop method_handle, CallSiteDepChange* changes = NULL);
332 // A returned Klass* is NULL if the dependency assertion is still
333 // valid. A non-NULL Klass* is a 'witness' to the assertion
334 // failure, a point in the class hierarchy where the assertion has
335 // been proven false. For example, if check_leaf_type returns
336 // non-NULL, the value is a subtype of the supposed leaf type. This
337 // witness value may be useful for logging the dependency failure.
338 // Note that, when a dependency fails, there may be several possible
339 // witnesses to the failure. The value returned from the check_foo
340 // method is chosen arbitrarily.
342 // The 'changes' value, if non-null, requests a limited spot-check
343 // near the indicated recent changes in the class hierarchy.
344 // It is used by DepStream::spot_check_dependency_at.
346 // Detecting possible new assertions:
347 static Klass* find_unique_concrete_subtype(Klass* ctxk);
348 static Method* find_unique_concrete_method(Klass* ctxk, Method* m);
349 static int find_exclusive_concrete_subtypes(Klass* ctxk, int klen, Klass* k[]);
351 // Create the encoding which will be stored in an nmethod.
352 void encode_content_bytes();
354 address content_bytes() {
355 assert(_content_bytes != NULL, "encode it first");
356 return _content_bytes;
357 }
358 size_t size_in_bytes() {
359 assert(_content_bytes != NULL, "encode it first");
360 return _size_in_bytes;
361 }
363 OopRecorder* oop_recorder() { return _oop_recorder; }
364 CompileLog* log() { return _log; }
366 void copy_to(nmethod* nm);
368 void log_all_dependencies();
369 void log_dependency(DepType dept, int nargs, ciBaseObject* args[]) {
370 write_dependency_to(log(), dept, nargs, args);
371 }
372 void log_dependency(DepType dept,
373 ciBaseObject* x0,
374 ciBaseObject* x1 = NULL,
375 ciBaseObject* x2 = NULL) {
376 if (log() == NULL) return;
377 ciBaseObject* args[max_arg_count];
378 args[0] = x0;
379 args[1] = x1;
380 args[2] = x2;
381 assert(2 < max_arg_count, "");
382 log_dependency(dept, dep_args(dept), args);
383 }
385 class DepArgument : public ResourceObj {
386 private:
387 bool _is_oop;
388 bool _valid;
389 void* _value;
390 public:
391 DepArgument() : _is_oop(false), _value(NULL), _valid(false) {}
392 DepArgument(oop v): _is_oop(true), _value(v), _valid(true) {}
393 DepArgument(Metadata* v): _is_oop(false), _value(v), _valid(true) {}
395 bool is_null() const { return _value == NULL; }
396 bool is_oop() const { return _is_oop; }
397 bool is_metadata() const { return !_is_oop; }
398 bool is_klass() const { return is_metadata() && metadata_value()->is_klass(); }
399 bool is_method() const { return is_metadata() && metadata_value()->is_method(); }
401 oop oop_value() const { assert(_is_oop && _valid, "must be"); return (oop) _value; }
402 Metadata* metadata_value() const { assert(!_is_oop && _valid, "must be"); return (Metadata*) _value; }
403 };
405 static void write_dependency_to(CompileLog* log,
406 DepType dept,
407 int nargs, ciBaseObject* args[],
408 Klass* witness = NULL);
409 static void write_dependency_to(CompileLog* log,
410 DepType dept,
411 int nargs, DepArgument args[],
412 Klass* witness = NULL);
413 static void write_dependency_to(xmlStream* xtty,
414 DepType dept,
415 int nargs, DepArgument args[],
416 Klass* witness = NULL);
417 static void print_dependency(DepType dept,
418 int nargs, DepArgument args[],
419 Klass* witness = NULL);
421 private:
422 // helper for encoding common context types as zero:
423 static ciKlass* ctxk_encoded_as_null(DepType dept, ciBaseObject* x);
425 static Klass* ctxk_encoded_as_null(DepType dept, Metadata* x);
427 public:
428 // Use this to iterate over an nmethod's dependency set.
429 // Works on new and old dependency sets.
430 // Usage:
431 //
432 // ;
433 // Dependencies::DepType dept;
434 // for (Dependencies::DepStream deps(nm); deps.next(); ) {
435 // ...
436 // }
437 //
438 // The caller must be in the VM, since oops are not wrapped in handles.
439 class DepStream {
440 private:
441 nmethod* _code; // null if in a compiler thread
442 Dependencies* _deps; // null if not in a compiler thread
443 CompressedReadStream _bytes;
444 #ifdef ASSERT
445 size_t _byte_limit;
446 #endif
448 // iteration variables:
449 DepType _type;
450 int _xi[max_arg_count+1];
452 void initial_asserts(size_t byte_limit) NOT_DEBUG({});
454 inline Metadata* recorded_metadata_at(int i);
455 inline oop recorded_oop_at(int i);
457 Klass* check_klass_dependency(KlassDepChange* changes);
458 Klass* check_call_site_dependency(CallSiteDepChange* changes);
460 void trace_and_log_witness(Klass* witness);
462 public:
463 DepStream(Dependencies* deps)
464 : _deps(deps),
465 _code(NULL),
466 _bytes(deps->content_bytes())
467 {
468 initial_asserts(deps->size_in_bytes());
469 }
470 DepStream(nmethod* code)
471 : _deps(NULL),
472 _code(code),
473 _bytes(code->dependencies_begin())
474 {
475 initial_asserts(code->dependencies_size());
476 }
478 bool next();
480 DepType type() { return _type; }
481 int argument_count() { return dep_args(type()); }
482 int argument_index(int i) { assert(0 <= i && i < argument_count(), "oob");
483 return _xi[i]; }
484 Metadata* argument(int i); // => recorded_oop_at(argument_index(i))
485 oop argument_oop(int i); // => recorded_oop_at(argument_index(i))
486 Klass* context_type();
488 bool is_klass_type() { return Dependencies::is_klass_type(type()); }
490 Method* method_argument(int i) {
491 Metadata* x = argument(i);
492 assert(x->is_method(), "type");
493 return (Method*) x;
494 }
495 Klass* type_argument(int i) {
496 Metadata* x = argument(i);
497 assert(x->is_klass(), "type");
498 return (Klass*) x;
499 }
501 // The point of the whole exercise: Is this dep still OK?
502 Klass* check_dependency() {
503 Klass* result = check_klass_dependency(NULL);
504 if (result != NULL) return result;
505 return check_call_site_dependency(NULL);
506 }
508 // A lighter version: Checks only around recent changes in a class
509 // hierarchy. (See Universe::flush_dependents_on.)
510 Klass* spot_check_dependency_at(DepChange& changes);
512 // Log the current dependency to xtty or compilation log.
513 void log_dependency(Klass* witness = NULL);
515 // Print the current dependency to tty.
516 void print_dependency(Klass* witness = NULL, bool verbose = false);
517 };
518 friend class Dependencies::DepStream;
520 static void print_statistics() PRODUCT_RETURN;
521 };
524 // Every particular DepChange is a sub-class of this class.
525 class DepChange : public StackObj {
526 public:
527 // What kind of DepChange is this?
528 virtual bool is_klass_change() const { return false; }
529 virtual bool is_call_site_change() const { return false; }
531 // Subclass casting with assertions.
532 KlassDepChange* as_klass_change() {
533 assert(is_klass_change(), "bad cast");
534 return (KlassDepChange*) this;
535 }
536 CallSiteDepChange* as_call_site_change() {
537 assert(is_call_site_change(), "bad cast");
538 return (CallSiteDepChange*) this;
539 }
541 void print();
543 public:
544 enum ChangeType {
545 NO_CHANGE = 0, // an uninvolved klass
546 Change_new_type, // a newly loaded type
547 Change_new_sub, // a super with a new subtype
548 Change_new_impl, // an interface with a new implementation
549 CHANGE_LIMIT,
550 Start_Klass = CHANGE_LIMIT // internal indicator for ContextStream
551 };
553 // Usage:
554 // for (DepChange::ContextStream str(changes); str.next(); ) {
555 // Klass* k = str.klass();
556 // switch (str.change_type()) {
557 // ...
558 // }
559 // }
560 class ContextStream : public StackObj {
561 private:
562 DepChange& _changes;
563 friend class DepChange;
565 // iteration variables:
566 ChangeType _change_type;
567 Klass* _klass;
568 Array<Klass*>* _ti_base; // i.e., transitive_interfaces
569 int _ti_index;
570 int _ti_limit;
572 // start at the beginning:
573 void start();
575 public:
576 ContextStream(DepChange& changes)
577 : _changes(changes)
578 { start(); }
580 ContextStream(DepChange& changes, No_Safepoint_Verifier& nsv)
581 : _changes(changes)
582 // the nsv argument makes it safe to hold oops like _klass
583 { start(); }
585 bool next();
587 ChangeType change_type() { return _change_type; }
588 Klass* klass() { return _klass; }
589 };
590 friend class DepChange::ContextStream;
591 };
594 // A class hierarchy change coming through the VM (under the Compile_lock).
595 // The change is structured as a single new type with any number of supers
596 // and implemented interface types. Other than the new type, any of the
597 // super types can be context types for a relevant dependency, which the
598 // new type could invalidate.
599 class KlassDepChange : public DepChange {
600 private:
601 // each change set is rooted in exactly one new type (at present):
602 KlassHandle _new_type;
604 void initialize();
606 public:
607 // notes the new type, marks it and all its super-types
608 KlassDepChange(KlassHandle new_type)
609 : _new_type(new_type)
610 {
611 initialize();
612 }
614 // cleans up the marks
615 ~KlassDepChange();
617 // What kind of DepChange is this?
618 virtual bool is_klass_change() const { return true; }
620 Klass* new_type() { return _new_type(); }
622 // involves_context(k) is true if k is new_type or any of the super types
623 bool involves_context(Klass* k);
624 };
627 // A CallSite has changed its target.
628 class CallSiteDepChange : public DepChange {
629 private:
630 Handle _call_site;
631 Handle _method_handle;
633 public:
634 CallSiteDepChange(Handle call_site, Handle method_handle)
635 : _call_site(call_site),
636 _method_handle(method_handle)
637 {
638 assert(_call_site() ->is_a(SystemDictionary::CallSite_klass()), "must be");
639 assert(_method_handle()->is_a(SystemDictionary::MethodHandle_klass()), "must be");
640 }
642 // What kind of DepChange is this?
643 virtual bool is_call_site_change() const { return true; }
645 oop call_site() const { return _call_site(); }
646 oop method_handle() const { return _method_handle(); }
647 };
649 #endif // SHARE_VM_CODE_DEPENDENCIES_HPP