Mercurial > hg > graal-compiler
comparison src/share/vm/interpreter/rewriter.hpp @ 6822:f6b0eb4e44cf
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
Reviewed-by: jrose, kvn
author | twisti |
---|---|
date | Mon, 01 Oct 2012 14:50:10 -0700 |
parents | da91efe96a93 |
children | cc6a617fffd2 |
comparison
equal
deleted
inserted
replaced
6811:1b582b1bf7cb | 6822:f6b0eb4e44cf |
---|---|
111 _reference_map.at_put(cp_index, ref_index); | 111 _reference_map.at_put(cp_index, ref_index); |
112 assert(cp_entry_to_resolved_references(cp_index) == ref_index, ""); | 112 assert(cp_entry_to_resolved_references(cp_index) == ref_index, ""); |
113 return ref_index; | 113 return ref_index; |
114 } | 114 } |
115 | 115 |
116 // add a new entry to the resolved_references map (for invokedynamic only) | 116 // add a new entries to the resolved_references map (for invokedynamic and invokehandle only) |
117 int add_invokedynamic_resolved_references_entry(int cp_index, int cache_index) { | 117 int add_invokedynamic_resolved_references_entries(int cp_index, int cache_index) { |
118 assert(_resolved_reference_limit >= 0, "must add indy refs after first iteration"); | 118 assert(_resolved_reference_limit >= 0, "must add indy refs after first iteration"); |
119 int ref_index = _resolved_references_map.append(cp_index); // many-to-one | 119 int ref_index = -1; |
120 assert(ref_index >= _resolved_reference_limit, ""); | 120 for (int entry = 0; entry < ConstantPoolCacheEntry::_indy_resolved_references_entries; entry++) { |
121 _invokedynamic_references_map.at_put_grow(ref_index, cache_index, -1); | 121 const int index = _resolved_references_map.append(cp_index); // many-to-one |
122 assert(index >= _resolved_reference_limit, ""); | |
123 if (entry == 0) { | |
124 ref_index = index; | |
125 } | |
126 assert((index - entry) == ref_index, "entries must be consecutive"); | |
127 _invokedynamic_references_map.at_put_grow(index, cache_index, -1); | |
128 } | |
122 return ref_index; | 129 return ref_index; |
123 } | 130 } |
124 | 131 |
125 int resolved_references_entry_to_pool_index(int ref_index) { | 132 int resolved_references_entry_to_pool_index(int ref_index) { |
126 int cp_index = _resolved_references_map[ref_index]; | 133 int cp_index = _resolved_references_map[ref_index]; |
127 return cp_index; | 134 return cp_index; |
128 } | |
129 | |
130 // invokedynamic support - append the cpCache entry (encoded) in object map. | |
131 // The resolved_references_map should still be in ascending order | |
132 // The resolved_references has the invokedynamic call site objects appended after | |
133 // the objects that are resolved in the constant pool. | |
134 int add_callsite_entry(int main_cpc_entry) { | |
135 int ref_index = _resolved_references_map.append(main_cpc_entry); | |
136 return ref_index; | |
137 } | 135 } |
138 | 136 |
139 // Access the contents of _cp_cache_map to determine CP cache layout. | 137 // Access the contents of _cp_cache_map to determine CP cache layout. |
140 int cp_cache_entry_pool_index(int cache_index) { | 138 int cp_cache_entry_pool_index(int cache_index) { |
141 int cp_index = _cp_cache_map[cache_index]; | 139 int cp_index = _cp_cache_map[cache_index]; |