1 /* |
1 /* |
2 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
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. |
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. |
285 // non-concrete until their first instantiation, and allow some |
285 // non-concrete until their first instantiation, and allow some |
286 // methods to remain non-concrete until their first invocation. |
286 // methods to remain non-concrete until their first invocation. |
287 // In that case, there would be a middle ground between concrete |
287 // In that case, there would be a middle ground between concrete |
288 // and abstract (as defined by the Java language and VM). |
288 // and abstract (as defined by the Java language and VM). |
289 static bool is_concrete_klass(Klass* k); // k is instantiable |
289 static bool is_concrete_klass(Klass* k); // k is instantiable |
290 static bool is_concrete_method(Method* m); // m is invocable |
290 static bool is_concrete_method(Method* m, Klass* k); // m is invocable |
291 static Klass* find_finalizable_subclass(Klass* k); |
291 static Klass* find_finalizable_subclass(Klass* k); |
292 |
292 |
293 // These versions of the concreteness queries work through the CI. |
293 // These versions of the concreteness queries work through the CI. |
294 // The CI versions are allowed to skew sometimes from the VM |
294 // The CI versions are allowed to skew sometimes from the VM |
295 // (oop-based) versions. The cost of such a difference is a |
295 // (oop-based) versions. The cost of such a difference is a |
299 // In order to prevent spurious assertions, query results must |
299 // In order to prevent spurious assertions, query results must |
300 // remain stable within any single ciEnv instance. (I.e., they 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 |
301 // not go back into the VM to get their value; they must cache the |
302 // bit in the CI, either eagerly or lazily.) |
302 // bit in the CI, either eagerly or lazily.) |
303 static bool is_concrete_klass(ciInstanceKlass* k); // k appears instantiable |
303 static bool is_concrete_klass(ciInstanceKlass* k); // k appears instantiable |
304 static bool is_concrete_method(ciMethod* m); // m appears invocable |
|
305 static bool has_finalizable_subclass(ciInstanceKlass* k); |
304 static bool has_finalizable_subclass(ciInstanceKlass* k); |
306 |
305 |
307 // As a general rule, it is OK to compile under the assumption that |
306 // As a general rule, it is OK to compile under the assumption that |
308 // a given type or method is concrete, even if it at some future |
307 // a given type or method is concrete, even if it at some future |
309 // point becomes abstract. So dependency checking is one-sided, in |
308 // point becomes abstract. So dependency checking is one-sided, in |
346 |
345 |
347 // Detecting possible new assertions: |
346 // Detecting possible new assertions: |
348 static Klass* find_unique_concrete_subtype(Klass* ctxk); |
347 static Klass* find_unique_concrete_subtype(Klass* ctxk); |
349 static Method* find_unique_concrete_method(Klass* ctxk, Method* m); |
348 static Method* find_unique_concrete_method(Klass* ctxk, Method* m); |
350 static int find_exclusive_concrete_subtypes(Klass* ctxk, int klen, Klass* k[]); |
349 static int find_exclusive_concrete_subtypes(Klass* ctxk, int klen, Klass* k[]); |
351 static int find_exclusive_concrete_methods(Klass* ctxk, int mlen, Method* m[]); |
|
352 |
350 |
353 // Create the encoding which will be stored in an nmethod. |
351 // Create the encoding which will be stored in an nmethod. |
354 void encode_content_bytes(); |
352 void encode_content_bytes(); |
355 |
353 |
356 address content_bytes() { |
354 address content_bytes() { |