callGenerator.cpp revision 293
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * This code is free software; you can redistribute it and/or modify it
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * under the terms of the GNU General Public License version 2 only, as
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * published by the Free Software Foundation.
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * This code is distributed in the hope that it will be useful, but WITHOUT
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * version 2 for more details (a copy is included in the LICENSE file that
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * accompanied this code).
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * You should have received a copy of the GNU General Public License version
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * 2 along with this work; if not, write to the Free Software Foundation,
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
f71f7a61dec7c9089378d14493ad564a1dedf0b5neil_a_wilson * CA 95054 USA or visit www.sun.com if you need additional information or
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson * have any questions.
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson#include "incls/_precompiled.incl"
551c6d67504b98cefa6ea28db383787d7669fdcaludovicp#include "incls/_callGenerator.cpp.incl"
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilsonCallGenerator::CallGenerator(ciMethod* method) {
2f0f7926326cc76419b074fd91a589cb68980ffbdugan// Utility function.
b4c2f1fc47b8bfc3f550a3337dd23b45d5c68c64jvergara//-----------------------------ParseGenerator---------------------------------
2f0f7926326cc76419b074fd91a589cb68980ffbdugan// Internal class which handles all direct bytecode traversal.
014019918f7e3844f558f6159b8d41517254edc2lutoff ParseGenerator(ciMethod* method, float expected_uses, bool is_osr = false)
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson assert(can_parse(method, is_osr), "parse must be possible");
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara // Can we build either an OSR or a regular parser for this method?
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara static bool can_parse(ciMethod* method, int is_osr = false);
27f8adec83293fb8bd3bfa37175322b0ee3bb933jvergara virtual bool is_parse() const { return true; }
37f9a536593b696e5a3dcec443e1475f22fb5afdjvergaraJVMState* ParseGenerator::generate(JVMState* jvms) {
37f9a536593b696e5a3dcec443e1475f22fb5afdjvergara // The JVMS for a OSR has a single argument (see its TypeFunc).
b26e36d8a08a1c775531659c04abc3d4ed504139jvergara return NULL; // bailing out of the compile; do not try to parse
da7ab15aee42edf1c4ff33f66ca717f019b4a578lutoff // Grab signature for matching/allocation
844850276200bf083a9410753d88c49c00135816jvergara if (parser.tf() != (parser.depth() == 1 ? C->tf() : tf())) {
7a6cc509fac9c569f4fe1b959bd2d9e61cd6b3a7neil_a_wilson MutexLockerEx ml(Compile_lock, Mutex::_no_safepoint_check_flag);
da7ab15aee42edf1c4ff33f66ca717f019b4a578lutoff assert(C->env()->system_dictionary_modification_counter_changed(),
da7ab15aee42edf1c4ff33f66ca717f019b4a578lutoff "Must invalidate if TypeFuncs differ");
if (C->failing()) {
return NULL;
CallStaticJavaNode *call = new (kit.C, tf()->domain()->cnt()) CallStaticJavaNode(tf(), target, method(), kit.bci());
if (!is_static) {
int _vtable_index;
virtual bool is_virtual() const { return true; }
CallDynamicJavaNode *call = new (kit.C, tf()->domain()->cnt()) CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci());
if (!m->can_be_compiled()) return false;
if (!m->has_balanced_monitors()) return false;
return new DirectCallGenerator(m);
virtual bool is_deferred() const { return true; }
if (m->is_CallJava()) {
#ifndef PRODUCT
return jvms;
if (C->failing()) return;
if (res_size != 0) {
if (n->is_Proj()) {
if (p->is_handler_proj()) {
float _hit_prob;
virtual bool is_virtual() const { return true; }
float hit_prob) {
if (i == tos) {
if( i >= limit ) break;
: CallGenerator(m)
virtual bool is_trap() const { return true; }
bool keep_exact_action = true;
void WarmCallInfo::init(JVMState* call_site, ciMethod* call_method, ciCallProfile& profile, float prof_factor) {
float size_factor;
head = this;
return head;
while (next_p != this) {
return head;
return _always_hot;
return _always_cold;
#ifndef PRODUCT
p->print();
int cnt = 0;
cnt++;
return cnt;