hotspot/src/share/vm/code/compiledIC.cpp
changeset 46329 53ccc37bda19
parent 42650 1f304d0c888b
equal deleted inserted replaced
46328:6061df52d610 46329:53ccc37bda19
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, 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.
   455 // static_bound: The call can be static bound. If it isn't also optimized, the property
   455 // static_bound: The call can be static bound. If it isn't also optimized, the property
   456 // wasn't provable at time of compilation. An optimized call will have any necessary
   456 // wasn't provable at time of compilation. An optimized call will have any necessary
   457 // null check, while a static_bound won't. A static_bound (but not optimized) must
   457 // null check, while a static_bound won't. A static_bound (but not optimized) must
   458 // therefore use the unverified entry point.
   458 // therefore use the unverified entry point.
   459 void CompiledIC::compute_monomorphic_entry(const methodHandle& method,
   459 void CompiledIC::compute_monomorphic_entry(const methodHandle& method,
   460                                            KlassHandle receiver_klass,
   460                                            Klass* receiver_klass,
   461                                            bool is_optimized,
   461                                            bool is_optimized,
   462                                            bool static_bound,
   462                                            bool static_bound,
   463                                            bool caller_is_nmethod,
   463                                            bool caller_is_nmethod,
   464                                            CompiledICInfo& info,
   464                                            CompiledICInfo& info,
   465                                            TRAPS) {
   465                                            TRAPS) {
   492     }
   492     }
   493   }
   493   }
   494   bool far_c2a = entry != NULL && caller_is_nmethod && method_code->is_far_code();
   494   bool far_c2a = entry != NULL && caller_is_nmethod && method_code->is_far_code();
   495   if (entry != NULL && !far_c2a) {
   495   if (entry != NULL && !far_c2a) {
   496     // Call to near compiled code (nmethod or aot).
   496     // Call to near compiled code (nmethod or aot).
   497     info.set_compiled_entry(entry, (static_bound || is_optimized) ? NULL : receiver_klass(), is_optimized);
   497     info.set_compiled_entry(entry, (static_bound || is_optimized) ? NULL : receiver_klass, is_optimized);
   498   } else {
   498   } else {
   499     if (is_optimized) {
   499     if (is_optimized) {
   500       if (far_c2a) {
   500       if (far_c2a) {
   501         // Call to aot code from nmethod.
   501         // Call to aot code from nmethod.
   502         info.set_aot_entry(entry, method());
   502         info.set_aot_entry(entry, method());
   505         info.set_interpreter_entry(method()->get_c2i_entry(), method());
   505         info.set_interpreter_entry(method()->get_c2i_entry(), method());
   506       }
   506       }
   507     } else {
   507     } else {
   508       // Use icholder entry
   508       // Use icholder entry
   509       assert(method_code == NULL || method_code->is_compiled(), "must be compiled");
   509       assert(method_code == NULL || method_code->is_compiled(), "must be compiled");
   510       CompiledICHolder* holder = new CompiledICHolder(method(), receiver_klass());
   510       CompiledICHolder* holder = new CompiledICHolder(method(), receiver_klass);
   511       info.set_icholder_entry(method()->get_c2i_unverified_entry(), holder);
   511       info.set_icholder_entry(method()->get_c2i_unverified_entry(), holder);
   512     }
   512     }
   513   }
   513   }
   514   assert(info.is_optimized() == is_optimized, "must agree");
   514   assert(info.is_optimized() == is_optimized, "must agree");
   515 }
   515 }