src/share/vm/interpreter/rewriter.hpp

changeset 4133
f6b0eb4e44cf
parent 4037
da91efe96a93
child 4395
cc6a617fffd2
     1.1 --- a/src/share/vm/interpreter/rewriter.hpp	Fri Sep 28 14:36:20 2012 -0700
     1.2 +++ b/src/share/vm/interpreter/rewriter.hpp	Mon Oct 01 14:50:10 2012 -0700
     1.3 @@ -113,12 +113,19 @@
     1.4      return ref_index;
     1.5    }
     1.6  
     1.7 -  // add a new entry to the resolved_references map (for invokedynamic only)
     1.8 -  int add_invokedynamic_resolved_references_entry(int cp_index, int cache_index) {
     1.9 +  // add a new entries to the resolved_references map (for invokedynamic and invokehandle only)
    1.10 +  int add_invokedynamic_resolved_references_entries(int cp_index, int cache_index) {
    1.11      assert(_resolved_reference_limit >= 0, "must add indy refs after first iteration");
    1.12 -    int ref_index = _resolved_references_map.append(cp_index);  // many-to-one
    1.13 -    assert(ref_index >= _resolved_reference_limit, "");
    1.14 -    _invokedynamic_references_map.at_put_grow(ref_index, cache_index, -1);
    1.15 +    int ref_index = -1;
    1.16 +    for (int entry = 0; entry < ConstantPoolCacheEntry::_indy_resolved_references_entries; entry++) {
    1.17 +      const int index = _resolved_references_map.append(cp_index);  // many-to-one
    1.18 +      assert(index >= _resolved_reference_limit, "");
    1.19 +      if (entry == 0) {
    1.20 +        ref_index = index;
    1.21 +      }
    1.22 +      assert((index - entry) == ref_index, "entries must be consecutive");
    1.23 +      _invokedynamic_references_map.at_put_grow(index, cache_index, -1);
    1.24 +    }
    1.25      return ref_index;
    1.26    }
    1.27  
    1.28 @@ -127,15 +134,6 @@
    1.29      return cp_index;
    1.30    }
    1.31  
    1.32 -  // invokedynamic support - append the cpCache entry (encoded) in object map.
    1.33 -  // The resolved_references_map should still be in ascending order
    1.34 -  // The resolved_references has the invokedynamic call site objects appended after
    1.35 -  // the objects that are resolved in the constant pool.
    1.36 -  int add_callsite_entry(int main_cpc_entry) {
    1.37 -    int ref_index = _resolved_references_map.append(main_cpc_entry);
    1.38 -    return ref_index;
    1.39 -  }
    1.40 -
    1.41    // Access the contents of _cp_cache_map to determine CP cache layout.
    1.42    int cp_cache_entry_pool_index(int cache_index) {
    1.43      int cp_index = _cp_cache_map[cache_index];

mercurial