hotspot/src/share/vm/oops/cpCacheOop.cpp
author jrose
Thu, 23 Jun 2011 17:14:06 -0700
changeset 10008 d84de97ad847
parent 9328 144894b3384b
child 10546 e79347eebbc5
permissions -rw-r--r--
7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path Reviewed-by: never
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
8297
f05d10c1c4b8 7014851: Remove unused parallel compaction code
stefank
parents: 7397
diff changeset
     2
 * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5420
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5420
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 5420
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    25
#include "precompiled.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    26
#include "gc_implementation/shared/markSweep.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    27
#include "interpreter/interpreter.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    28
#include "interpreter/rewriter.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    29
#include "memory/universe.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    30
#include "oops/cpCacheOop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    31
#include "oops/objArrayOop.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    32
#include "oops/oop.inline.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    33
#include "prims/jvmtiRedefineClassesTrace.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 7104
diff changeset
    34
#include "runtime/handles.inline.hpp"
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// Implememtation of ConstantPoolCacheEntry
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
4429
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
    39
void ConstantPoolCacheEntry::initialize_entry(int index) {
2570
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
    40
  assert(0 < index && index < 0x10000, "sanity check");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  _indices = index;
2570
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
    42
  assert(constant_pool_index() == index, "");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
4429
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
    45
void ConstantPoolCacheEntry::initialize_secondary_entry(int main_index) {
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
    46
  assert(0 <= main_index && main_index < 0x10000, "sanity check");
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
    47
  _indices = (main_index << 16);
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
    48
  assert(main_entry_index() == main_index, "");
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
    49
}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
int ConstantPoolCacheEntry::as_flags(TosState state, bool is_final,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
                    bool is_vfinal, bool is_volatile,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
                    bool is_method_interface, bool is_method) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  int f = state;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  assert( state < number_of_states, "Invalid state in as_flags");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
  f <<= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  if (is_final) f |= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
  f <<= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  if (is_vfinal) f |= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  f <<= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  if (is_volatile) f |= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  f <<= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  if (is_method_interface) f |= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  f <<= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  if (is_method) f |= 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  f <<= ConstantPoolCacheEntry::hotSwapBit;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  // Preserve existing flag bit values
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  int old_state = ((_flags >> tosBits) & 0x0F);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  assert(old_state == 0 || old_state == state,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
         "inconsistent cpCache flags state");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  return (_flags | f) ;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
void ConstantPoolCacheEntry::set_bytecode_1(Bytecodes::Code code) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
  // Read once.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  volatile Bytecodes::Code c = bytecode_1();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  assert(c == 0 || c == code || code == 0, "update must be consistent");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  // Need to flush pending stores here before bytecode is written.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
  OrderAccess::release_store_ptr(&_indices, _indices | ((u_char)code << 16));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
void ConstantPoolCacheEntry::set_bytecode_2(Bytecodes::Code code) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  // Read once.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  volatile Bytecodes::Code c = bytecode_2();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  assert(c == 0 || c == code || code == 0, "update must be consistent");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  // Need to flush pending stores here before bytecode is written.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  OrderAccess::release_store_ptr(&_indices, _indices | ((u_char)code << 24));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
7104
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
    98
// Atomically sets f1 if it is still NULL, otherwise it keeps the
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
    99
// current value.
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
   100
void ConstantPoolCacheEntry::set_f1_if_null_atomic(oop f1) {
8316
0816329cc3ee 7012339: JSR 292 crash in G1SATBCardTableModRefBS::write_ref_field_pre_work()
twisti
parents: 7397
diff changeset
   101
  // Use barriers as in oop_store
0816329cc3ee 7012339: JSR 292 crash in G1SATBCardTableModRefBS::write_ref_field_pre_work()
twisti
parents: 7397
diff changeset
   102
  oop* f1_addr = (oop*) &_f1;
0816329cc3ee 7012339: JSR 292 crash in G1SATBCardTableModRefBS::write_ref_field_pre_work()
twisti
parents: 7397
diff changeset
   103
  update_barrier_set_pre(f1_addr, f1);
0816329cc3ee 7012339: JSR 292 crash in G1SATBCardTableModRefBS::write_ref_field_pre_work()
twisti
parents: 7397
diff changeset
   104
  void* result = Atomic::cmpxchg_ptr(f1, f1_addr, NULL);
0816329cc3ee 7012339: JSR 292 crash in G1SATBCardTableModRefBS::write_ref_field_pre_work()
twisti
parents: 7397
diff changeset
   105
  bool success = (result == NULL);
0816329cc3ee 7012339: JSR 292 crash in G1SATBCardTableModRefBS::write_ref_field_pre_work()
twisti
parents: 7397
diff changeset
   106
  if (success) {
9328
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   107
    update_barrier_set((void*) f1_addr, f1);
7104
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
   108
  }
8316
0816329cc3ee 7012339: JSR 292 crash in G1SATBCardTableModRefBS::write_ref_field_pre_work()
twisti
parents: 7397
diff changeset
   109
}
7104
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
   110
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
#ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
// It is possible to have two different dummy methodOops created
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
// when the resolve code for invoke interface executes concurrently
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
// Hence the assertion below is weakened a bit for the invokeinterface
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
// case.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
bool ConstantPoolCacheEntry::same_methodOop(oop cur_f1, oop f1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  return (cur_f1 == f1 || ((methodOop)cur_f1)->name() ==
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
         ((methodOop)f1)->name() || ((methodOop)cur_f1)->signature() ==
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
         ((methodOop)f1)->signature());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
// Note that concurrent update of both bytecodes can leave one of them
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
// reset to zero.  This is harmless; the interpreter will simply re-resolve
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
// the damaged entry.  More seriously, the memory synchronization is needed
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
// to flush other fields (f1, f2) completely to memory before the bytecodes
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
// are updated, lest other processors see a non-zero bytecode but zero f1/f2.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
void ConstantPoolCacheEntry::set_field(Bytecodes::Code get_code,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
                                       Bytecodes::Code put_code,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
                                       KlassHandle field_holder,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
                                       int orig_field_index,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
                                       int field_offset,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
                                       TosState field_type,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
                                       bool is_final,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
                                       bool is_volatile) {
8725
8c1e3dd5fe1b 7017732: move static fields into Class to prepare for perm gen removal
never
parents: 8334
diff changeset
   136
  set_f1(field_holder()->java_mirror());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  set_f2(field_offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  // The field index is used by jvm/ti and is the index into fields() array
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  // in holder instanceKlass.  This is scaled by instanceKlass::next_offset.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  assert((orig_field_index % instanceKlass::next_offset) == 0, "wierd index");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  const int field_index = orig_field_index / instanceKlass::next_offset;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  assert(field_index <= field_index_mask,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
         "field index does not fit in low flag bits");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  set_flags(as_flags(field_type, is_final, false, is_volatile, false, false) |
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
            (field_index & field_index_mask));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  set_bytecode_1(get_code);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  set_bytecode_2(put_code);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  NOT_PRODUCT(verify(tty));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
int  ConstantPoolCacheEntry::field_index() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
  return (_flags & field_index_mask) * instanceKlass::next_offset;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
void ConstantPoolCacheEntry::set_method(Bytecodes::Code invoke_code,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
                                        methodHandle method,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
                                        int vtable_index) {
6062
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   158
  assert(!is_secondary_entry(), "");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  assert(method->interpreter_entry() != NULL, "should have been set at this point");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  assert(!method->is_obsolete(),  "attempt to write obsolete method to cpCache");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  bool change_to_virtual = (invoke_code == Bytecodes::_invokeinterface);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  int byte_no = -1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  bool needs_vfinal_flag = false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  switch (invoke_code) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
    case Bytecodes::_invokevirtual:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
    case Bytecodes::_invokeinterface: {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
        if (method->can_be_statically_bound()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
          set_f2((intptr_t)method());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
          needs_vfinal_flag = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
          assert(vtable_index >= 0, "valid index");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
          set_f2(vtable_index);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
        byte_no = 2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
    }
6062
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   178
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   179
    case Bytecodes::_invokedynamic:  // similar to _invokevirtual
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   180
      if (TraceInvokeDynamic) {
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   181
        tty->print_cr("InvokeDynamic set_method%s method="PTR_FORMAT" index=%d",
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   182
                      (is_secondary_entry() ? " secondary" : ""),
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   183
                      (intptr_t)method(), vtable_index);
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   184
        method->print();
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   185
        this->print(tty, 0);
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   186
      }
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   187
      assert(method->can_be_statically_bound(), "must be a MH invoker method");
9116
9bc44be338d6 6981791: remove experimental code for JSR 292
jrose
parents: 8725
diff changeset
   188
      assert(_f2 >= constantPoolOopDesc::CPCACHE_INDEX_TAG, "BSM index initialized");
7104
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
   189
      // SystemDictionary::find_method_handle_invoke only caches
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
   190
      // methods which signature classes are on the boot classpath,
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
   191
      // otherwise the newly created method is returned.  To avoid
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
   192
      // races in that case we store the first one coming in into the
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
   193
      // cp-cache atomically if it's still unset.
0c8b519af363 6990192: VM crashes in ciTypeFlow::get_block_for()
twisti
parents: 6064
diff changeset
   194
      set_f1_if_null_atomic(method());
6062
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   195
      needs_vfinal_flag = false;  // _f2 is not an oop
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   196
      assert(!is_vfinal(), "f2 not an oop");
6064
71e316283a85 6969574: invokedynamic call sites deoptimize instead of executing
jrose
parents: 6062
diff changeset
   197
      byte_no = 1;  // coordinate this with bytecode_number & is_resolved
6062
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   198
      break;
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   199
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
    case Bytecodes::_invokespecial:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
      // Preserve the value of the vfinal flag on invokevirtual bytecode
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
      // which may be shared with this constant pool cache entry.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
      needs_vfinal_flag = is_resolved(Bytecodes::_invokevirtual) && is_vfinal();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
      // fall through
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
    case Bytecodes::_invokestatic:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
      set_f1(method());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
      byte_no = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
    default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
      ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  set_flags(as_flags(as_TosState(method->result_type()),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
                     method->is_final_method(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
                     needs_vfinal_flag,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
                     false,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
                     change_to_virtual,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
                     true)|
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
            method()->size_of_parameters());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  // Note:  byte_no also appears in TemplateTable::resolve.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  if (byte_no == 1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
    set_bytecode_1(invoke_code);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  } else if (byte_no == 2)  {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
    if (change_to_virtual) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
      // NOTE: THIS IS A HACK - BE VERY CAREFUL!!!
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
      //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
      // Workaround for the case where we encounter an invokeinterface, but we
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
      // should really have an _invokevirtual since the resolved method is a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
      // virtual method in java.lang.Object. This is a corner case in the spec
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
      // but is presumably legal. javac does not generate this code.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
      //
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
      // We set bytecode_1() to _invokeinterface, because that is the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
      // bytecode # used by the interpreter to see if it is resolved.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
      // We set bytecode_2() to _invokevirtual.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
      // See also interpreterRuntime.cpp. (8/25/2000)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
      // Only set resolved for the invokeinterface case if method is public.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
      // Otherwise, the method needs to be reresolved with caller for each
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
      // interface call.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
      if (method->is_public()) set_bytecode_1(invoke_code);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
      set_bytecode_2(Bytecodes::_invokevirtual);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
      set_bytecode_2(invoke_code);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
    ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
  NOT_PRODUCT(verify(tty));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index) {
6062
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   254
  assert(!is_secondary_entry(), "");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
  klassOop interf = method->method_holder();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
  assert(instanceKlass::cast(interf)->is_interface(), "must be an interface");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  set_f1(interf);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
  set_f2(index);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
  set_flags(as_flags(as_TosState(method->result_type()), method->is_final_method(), false, false, false, true) | method()->size_of_parameters());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
  set_bytecode_1(Bytecodes::_invokeinterface);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
6062
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   264
void ConstantPoolCacheEntry::initialize_bootstrap_method_index_in_cache(int bsm_cache_index) {
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   265
  assert(!is_secondary_entry(), "only for JVM_CONSTANT_InvokeDynamic main entry");
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   266
  assert(_f2 == 0, "initialize once");
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   267
  assert(bsm_cache_index == (int)(u2)bsm_cache_index, "oob");
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   268
  set_f2(bsm_cache_index + constantPoolOopDesc::CPCACHE_INDEX_TAG);
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   269
}
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   270
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   271
int ConstantPoolCacheEntry::bootstrap_method_index_in_cache() {
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   272
  assert(!is_secondary_entry(), "only for JVM_CONSTANT_InvokeDynamic main entry");
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   273
  intptr_t bsm_cache_index = (intptr_t) _f2 - constantPoolOopDesc::CPCACHE_INDEX_TAG;
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   274
  assert(bsm_cache_index == (intptr_t)(u2)bsm_cache_index, "oob");
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   275
  return (int) bsm_cache_index;
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   276
}
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   277
9328
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   278
void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site, methodHandle signature_invoker) {
6062
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   279
  assert(is_secondary_entry(), "");
9328
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   280
  // NOTE: it's important that all other values are set before f1 is
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   281
  // set since some users short circuit on f1 being set
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   282
  // (i.e. non-null) and that may result in uninitialized values for
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   283
  // other racing threads (e.g. flags).
5420
586d3988e72b 6939134: JSR 292 adjustments to method handle invocation
jrose
parents: 4429
diff changeset
   284
  int param_size = signature_invoker->size_of_parameters();
4429
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   285
  assert(param_size >= 1, "method argument size must include MH.this");
9328
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   286
  param_size -= 1;  // do not count MH.this; it is not stacked for invokedynamic
5420
586d3988e72b 6939134: JSR 292 adjustments to method handle invocation
jrose
parents: 4429
diff changeset
   287
  bool is_final = true;
586d3988e72b 6939134: JSR 292 adjustments to method handle invocation
jrose
parents: 4429
diff changeset
   288
  assert(signature_invoker->is_final_method(), "is_final");
9328
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   289
  int flags = as_flags(as_TosState(signature_invoker->result_type()), is_final, false, false, false, true) | param_size;
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   290
  assert(_flags == 0 || _flags == flags, "flags should be the same");
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   291
  set_flags(flags);
2570
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
   292
  // do not do set_bytecode on a secondary CP cache entry
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
   293
  //set_bytecode_1(Bytecodes::_invokedynamic);
9328
144894b3384b 6993078: JSR 292 too many pushes: Lesp points into register window
twisti
parents: 9116
diff changeset
   294
  set_f1_if_null_atomic(call_site());  // This must be the last one to set (see NOTE above)!
2570
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
   295
}
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
   296
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
   297
10008
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   298
methodOop ConstantPoolCacheEntry::get_method_if_resolved(Bytecodes::Code invoke_code, constantPoolHandle cpool) {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   299
  assert(invoke_code > (Bytecodes::Code)0, "bad query");
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   300
  if (is_secondary_entry()) {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   301
    return cpool->cache()->entry_at(main_entry_index())->get_method_if_resolved(invoke_code, cpool);
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   302
  }
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   303
  // Decode the action of set_method and set_interface_call
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   304
  if (bytecode_1() == invoke_code) {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   305
    oop f1 = _f1;
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   306
    if (f1 != NULL) {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   307
      switch (invoke_code) {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   308
      case Bytecodes::_invokeinterface:
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   309
        assert(f1->is_klass(), "");
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   310
        return klassItable::method_for_itable_index(klassOop(f1), (int) f2());
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   311
      case Bytecodes::_invokestatic:
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   312
      case Bytecodes::_invokespecial:
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   313
        assert(f1->is_method(), "");
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   314
        return methodOop(f1);
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   315
      }
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   316
    }
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   317
  }
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   318
  if (bytecode_2() == invoke_code) {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   319
    switch (invoke_code) {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   320
    case Bytecodes::_invokevirtual:
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   321
      if (is_vfinal()) {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   322
        // invokevirtual
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   323
        methodOop m = methodOop((intptr_t) f2());
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   324
        assert(m->is_method(), "");
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   325
        return m;
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   326
      } else {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   327
        int holder_index = cpool->uncached_klass_ref_index_at(constant_pool_index());
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   328
        if (cpool->tag_at(holder_index).is_klass()) {
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   329
          klassOop klass = cpool->resolved_klass_at(holder_index);
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   330
          if (!Klass::cast(klass)->oop_is_instance())
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   331
            klass = SystemDictionary::Object_klass();
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   332
          return instanceKlass::cast(klass)->method_at_vtable((int) f2());
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   333
        }
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   334
      }
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   335
    }
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   336
  }
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   337
  return NULL;
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   338
}
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   339
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   340
d84de97ad847 7056328: JSR 292 invocation sometimes fails in adapters for types not on boot class path
jrose
parents: 9328
diff changeset
   341
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
class LocalOopClosure: public OopClosure {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  void (*_f)(oop*);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
  LocalOopClosure(void f(oop*))        { _f = f; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
  virtual void do_oop(oop* o)          { _f(o); }
360
21d113ecbf6a 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 1
diff changeset
   349
  virtual void do_oop(narrowOop *o)    { ShouldNotReachHere(); }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
void ConstantPoolCacheEntry::oops_do(void f(oop*)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
  LocalOopClosure blk(f);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
  oop_iterate(&blk);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
void ConstantPoolCacheEntry::oop_iterate(OopClosure* blk) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
  assert(in_words(size()) == 4, "check code below - may need adjustment");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
  // field[1] is always oop or NULL
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
  blk->do_oop((oop*)&_f1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
  if (is_vfinal()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
    blk->do_oop((oop*)&_f2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
void ConstantPoolCacheEntry::oop_iterate_m(OopClosure* blk, MemRegion mr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
  assert(in_words(size()) == 4, "check code below - may need adjustment");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
  // field[1] is always oop or NULL
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
  if (mr.contains((oop *)&_f1)) blk->do_oop((oop*)&_f1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
  if (is_vfinal()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
    if (mr.contains((oop *)&_f2)) blk->do_oop((oop*)&_f2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
void ConstantPoolCacheEntry::follow_contents() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
  assert(in_words(size()) == 4, "check code below - may need adjustment");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
  // field[1] is always oop or NULL
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
  MarkSweep::mark_and_push((oop*)&_f1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
  if (is_vfinal()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
    MarkSweep::mark_and_push((oop*)&_f2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
void ConstantPoolCacheEntry::follow_contents(ParCompactionManager* cm) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
  assert(in_words(size()) == 4, "check code below - may need adjustment");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
  // field[1] is always oop or NULL
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
  PSParallelCompact::mark_and_push(cm, (oop*)&_f1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
  if (is_vfinal()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
    PSParallelCompact::mark_and_push(cm, (oop*)&_f2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
void ConstantPoolCacheEntry::adjust_pointers() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
  assert(in_words(size()) == 4, "check code below - may need adjustment");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
  // field[1] is always oop or NULL
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
  MarkSweep::adjust_pointer((oop*)&_f1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
  if (is_vfinal()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
    MarkSweep::adjust_pointer((oop*)&_f2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
void ConstantPoolCacheEntry::update_pointers() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
  assert(in_words(size()) == 4, "check code below - may need adjustment");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
  // field[1] is always oop or NULL
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
  PSParallelCompact::adjust_pointer((oop*)&_f1);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
  if (is_vfinal()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
    PSParallelCompact::adjust_pointer((oop*)&_f2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
// RedefineClasses() API support:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
// If this constantPoolCacheEntry refers to old_method then update it
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
// to refer to new_method.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
bool ConstantPoolCacheEntry::adjust_method_entry(methodOop old_method,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
       methodOop new_method, bool * trace_name_printed) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
  if (is_vfinal()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
    // virtual and final so f2() contains method ptr instead of vtable index
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
    if (f2() == (intptr_t)old_method) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
      // match old_method so need an update
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
      _f2 = (intptr_t)new_method;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
      if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
        if (!(*trace_name_printed)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
          // RC_TRACE_MESG macro has an embedded ResourceMark
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
          RC_TRACE_MESG(("adjust: name=%s",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
            Klass::cast(old_method->method_holder())->external_name()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
          *trace_name_printed = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
        // RC_TRACE macro has an embedded ResourceMark
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
        RC_TRACE(0x00400000, ("cpc vf-entry update: %s(%s)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
          new_method->name()->as_C_string(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
          new_method->signature()->as_C_string()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
    // f1() is not used with virtual entries so bail out
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
  if ((oop)_f1 == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
    // NULL f1() means this is a virtual entry so bail out
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
    // We are assuming that the vtable index does not need change.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
  if ((oop)_f1 == old_method) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
    _f1 = new_method;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
    if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
      if (!(*trace_name_printed)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
        // RC_TRACE_MESG macro has an embedded ResourceMark
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
        RC_TRACE_MESG(("adjust: name=%s",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
          Klass::cast(old_method->method_holder())->external_name()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
        *trace_name_printed = true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
      // RC_TRACE macro has an embedded ResourceMark
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
      RC_TRACE(0x00400000, ("cpc entry update: %s(%s)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
        new_method->name()->as_C_string(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
        new_method->signature()->as_C_string()));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
    return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
  return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
bool ConstantPoolCacheEntry::is_interesting_method_entry(klassOop k) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
  if (!is_method_entry()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
    // not a method entry so not interesting by default
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
  methodOop m = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
  if (is_vfinal()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
    // virtual and final so _f2 contains method ptr instead of vtable index
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
    m = (methodOop)_f2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
  } else if ((oop)_f1 == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
    // NULL _f1 means this is a virtual entry so also not interesting
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
    if (!((oop)_f1)->is_method()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
      // _f1 can also contain a klassOop for an interface
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
      return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
    m = (methodOop)_f1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
  assert(m != NULL && m->is_method(), "sanity check");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
  if (m == NULL || !m->is_method() || m->method_holder() != k) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
    // robustness for above sanity checks or method is not in
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
    // the interesting class
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
  // the method is in the interesting class so the entry is interesting
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
  return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
void ConstantPoolCacheEntry::print(outputStream* st, int index) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
  // print separator
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
  if (index == 0) tty->print_cr("                 -------------");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
  // print entry
6062
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   513
  tty->print("%3d  ("PTR_FORMAT")  ", index, (intptr_t)this);
2570
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
   514
  if (is_secondary_entry())
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
   515
    tty->print_cr("[%5d|secondary]", main_entry_index());
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
   516
  else
ecc7862946d4 6655646: dynamic languages need dynamically linked call sites
jrose
parents: 670
diff changeset
   517
    tty->print_cr("[%02x|%02x|%5d]", bytecode_2(), bytecode_1(), constant_pool_index());
6062
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   518
  tty->print_cr("                 [   "PTR_FORMAT"]", (intptr_t)(oop)_f1);
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   519
  tty->print_cr("                 [   "PTR_FORMAT"]", (intptr_t)_f2);
bab93afe9df7 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 5547
diff changeset
   520
  tty->print_cr("                 [   "PTR_FORMAT"]", (intptr_t)_flags);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
  tty->print_cr("                 -------------");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
void ConstantPoolCacheEntry::verify(outputStream* st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
  // not implemented yet
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
// Implementation of ConstantPoolCache
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
void constantPoolCacheOopDesc::initialize(intArray& inverse_index_map) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
  assert(inverse_index_map.length() == length(), "inverse index map must have same length as cache");
4429
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   532
  for (int i = 0; i < length(); i++) {
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   533
    ConstantPoolCacheEntry* e = entry_at(i);
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   534
    int original_index = inverse_index_map[i];
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   535
    if ((original_index & Rewriter::_secondary_entry_tag) != 0) {
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   536
      int main_index = (original_index - Rewriter::_secondary_entry_tag);
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   537
      assert(!entry_at(main_index)->is_secondary_entry(), "valid main index");
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   538
      e->initialize_secondary_entry(main_index);
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   539
    } else {
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   540
      e->initialize_entry(original_index);
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   541
    }
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   542
    assert(entry_at(i) == e, "sanity");
d7eb4e2099aa 6858164: invokedynamic code needs some cleanup (post-6655638)
jrose
parents: 3261
diff changeset
   543
  }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   544
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   545
489c9b5090e2 Initial load
duke
parents:
diff changeset
   546
// RedefineClasses() API support:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   547
// If any entry of this constantPoolCache points to any of
489c9b5090e2 Initial load
duke
parents:
diff changeset
   548
// old_methods, replace it with the corresponding new_method.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   549
void constantPoolCacheOopDesc::adjust_method_entries(methodOop* old_methods, methodOop* new_methods,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   550
                                                     int methods_length, bool * trace_name_printed) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   551
489c9b5090e2 Initial load
duke
parents:
diff changeset
   552
  if (methods_length == 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   553
    // nothing to do if there are no methods
489c9b5090e2 Initial load
duke
parents:
diff changeset
   554
    return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   555
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
  // get shorthand for the interesting class
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
  klassOop old_holder = old_methods[0]->method_holder();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   559
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
  for (int i = 0; i < length(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
    if (!entry_at(i)->is_interesting_method_entry(old_holder)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   562
      // skip uninteresting methods
489c9b5090e2 Initial load
duke
parents:
diff changeset
   563
      continue;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
489c9b5090e2 Initial load
duke
parents:
diff changeset
   566
    // The constantPoolCache contains entries for several different
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
    // things, but we only care about methods. In fact, we only care
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
    // about methods in the same class as the one that contains the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
    // old_methods. At this point, we have an interesting entry.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
    for (int j = 0; j < methods_length; j++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
      methodOop old_method = old_methods[j];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   573
      methodOop new_method = new_methods[j];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   574
489c9b5090e2 Initial load
duke
parents:
diff changeset
   575
      if (entry_at(i)->adjust_method_entry(old_method, new_method,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   576
          trace_name_printed)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   577
        // current old_method matched this entry and we updated it so
489c9b5090e2 Initial load
duke
parents:
diff changeset
   578
        // break out and get to the next interesting entry if there one
489c9b5090e2 Initial load
duke
parents:
diff changeset
   579
        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   580
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
}