ciEnv.cpp revision 2116
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * This code is free software; you can redistribute it and/or modify it
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * under the terms of the GNU General Public License version 2 only, as
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * published by the Free Software Foundation.
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * This code is distributed in the hope that it will be useful, but WITHOUT
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * version 2 for more details (a copy is included in the LICENSE file that
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * accompanied this code).
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * You should have received a copy of the GNU General Public License version
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * 2 along with this work; if not, write to the Free Software Foundation,
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * or visit www.oracle.com if you need additional information or have any
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna * questions.
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna// This class is the top level broker for requests from the compiler
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna// to the VM.
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David LunaciInstanceKlassKlass* ciEnv::_instance_klass_klass_instance;
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David LunaciTypeArrayKlassKlass* ciEnv::_type_array_klass_klass_instance;
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David LunaciObjArrayKlassKlass* ciEnv::_obj_array_klass_klass_instance;
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David Luna#define WK_KLASS_DEFN(name, ignore_s, ignore_o) ciInstanceKlass* ciEnv::_##name = NULL;
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David LunaciInstanceKlass* ciEnv::_unloaded_ciinstance_klass = NULL;
ae6eb91d10bf796c4affdfdb6f838386cc70aaf3David LunaciObjArrayKlass* ciEnv::_unloaded_ciobjarrayklass = NULL;
#ifndef PRODUCT
static bool firstEnv = true;
_break_at_compile = false;
#ifndef PRODUCT
_name_buffer_len = 0;
_break_at_compile = false;
#ifndef PRODUCT
firstEnv = false;
_name_buffer_len = 0;
if (_dtrace_extended_probes) {
_dtrace_monitor_probes = true;
_dtrace_method_probes = true;
_dtrace_alloc_probes = true;
// Cf. universe.cpp, creation of Universe::_null_ptr_exception_instance.
if (!HAS_PENDING_EXCEPTION)
if (HAS_PENDING_EXCEPTION) {
return _ArrayStoreException_instance;
return _ClassCastException_instance;
return _the_null_string;
return _the_min_jint_string;
if (HAS_PENDING_EXCEPTION) {
return NULL;
for (int i = 0; i < length; i++) {
for (int i = 0; i < length; i++) {
if (a->obj_at(i) == o) return i;
bool require_local) {
return unloaded_klass;
if (!require_local) {
bool require_local) {
int index,
bool& is_accessible,
if (!k->is_loaded()) {
is_accessible = false;
is_accessible = false;
is_accessible = false;
return unloaded_klass;
is_accessible = true;
int index,
bool& is_accessible,
bool ignore_will_link;
if (cache_index >= 0) {
if (HAS_PENDING_EXCEPTION) {
return ciConstant();
if (HAS_PENDING_EXCEPTION) {
return ciConstant();
return ciConstant();
int index) {
return field;
return field;
int index) {
switch (bc) {
h_accessor, true);
h_accessor, true);
default: ShouldNotReachHere();
return dest_method();
bool holder_is_accessible;
if (m != NULL) {
is_resolved = false;
if (!is_resolved) {
ciInstanceKlass* mh_klass = get_object(SystemDictionary::MethodHandle_klass())->as_instance_klass();
assert(signature_invoker != NULL && signature_invoker->is_method() && signature_invoker->is_method_handle_invoke(),
// declared holder is Object.clone since that's where the call will bottom out.
return NULL;
return _name_buffer;
if (!test_deps) return;
bool print_failures = false;
int violated = 0;
++violated;
if (!keep_going) break;
if (violated != 0) {
int entry_bci,
int orig_pc_offset,
int frame_words,
int comp_level,
bool has_debug_info,
bool has_unsafe_access) {
if (!failing() &&
( (!jvmti_can_hotswap_or_post_breakpoint() &&
(!jvmti_can_post_on_exceptions() &&
if (!failing() &&
if (!failing()) {
if (failing()) {
compile_id(),
if (TieredCompilation) {
if (TraceNMethodInstalls ) {
if (TraceNMethodInstalls ) {
return _num_inlined_bytecodes;
int new_compilable =
if (all_tiers) {