Mercurial > hg > graal-compiler
comparison src/share/vm/oops/cpCacheOop.cpp @ 3279:08ccee2c4dbf
6993078: JSR 292 too many pushes: Lesp points into register window
Reviewed-by: kvn, never
author | twisti |
---|---|
date | Thu, 21 Apr 2011 00:25:40 -0700 |
parents | ed69575596ac |
children | 81d815b05abb |
comparison
equal
deleted
inserted
replaced
3278:66b0e2371912 | 3279:08ccee2c4dbf |
---|---|
102 oop* f1_addr = (oop*) &_f1; | 102 oop* f1_addr = (oop*) &_f1; |
103 update_barrier_set_pre(f1_addr, f1); | 103 update_barrier_set_pre(f1_addr, f1); |
104 void* result = Atomic::cmpxchg_ptr(f1, f1_addr, NULL); | 104 void* result = Atomic::cmpxchg_ptr(f1, f1_addr, NULL); |
105 bool success = (result == NULL); | 105 bool success = (result == NULL); |
106 if (success) { | 106 if (success) { |
107 update_barrier_set(f1_addr, f1); | 107 update_barrier_set((void*) f1_addr, f1); |
108 } | 108 } |
109 } | 109 } |
110 | 110 |
111 #ifdef ASSERT | 111 #ifdef ASSERT |
112 // It is possible to have two different dummy methodOops created | 112 // It is possible to have two different dummy methodOops created |
273 intptr_t bsm_cache_index = (intptr_t) _f2 - constantPoolOopDesc::CPCACHE_INDEX_TAG; | 273 intptr_t bsm_cache_index = (intptr_t) _f2 - constantPoolOopDesc::CPCACHE_INDEX_TAG; |
274 assert(bsm_cache_index == (intptr_t)(u2)bsm_cache_index, "oob"); | 274 assert(bsm_cache_index == (intptr_t)(u2)bsm_cache_index, "oob"); |
275 return (int) bsm_cache_index; | 275 return (int) bsm_cache_index; |
276 } | 276 } |
277 | 277 |
278 void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site, | 278 void ConstantPoolCacheEntry::set_dynamic_call(Handle call_site, methodHandle signature_invoker) { |
279 methodHandle signature_invoker) { | |
280 assert(is_secondary_entry(), ""); | 279 assert(is_secondary_entry(), ""); |
280 // NOTE: it's important that all other values are set before f1 is | |
281 // set since some users short circuit on f1 being set | |
282 // (i.e. non-null) and that may result in uninitialized values for | |
283 // other racing threads (e.g. flags). | |
281 int param_size = signature_invoker->size_of_parameters(); | 284 int param_size = signature_invoker->size_of_parameters(); |
282 assert(param_size >= 1, "method argument size must include MH.this"); | 285 assert(param_size >= 1, "method argument size must include MH.this"); |
283 param_size -= 1; // do not count MH.this; it is not stacked for invokedynamic | 286 param_size -= 1; // do not count MH.this; it is not stacked for invokedynamic |
284 if (Atomic::cmpxchg_ptr(call_site(), &_f1, NULL) == NULL) { | |
285 // racing threads might be trying to install their own favorites | |
286 set_f1(call_site()); | |
287 } | |
288 bool is_final = true; | 287 bool is_final = true; |
289 assert(signature_invoker->is_final_method(), "is_final"); | 288 assert(signature_invoker->is_final_method(), "is_final"); |
290 set_flags(as_flags(as_TosState(signature_invoker->result_type()), is_final, false, false, false, true) | param_size); | 289 int flags = as_flags(as_TosState(signature_invoker->result_type()), is_final, false, false, false, true) | param_size; |
290 assert(_flags == 0 || _flags == flags, "flags should be the same"); | |
291 set_flags(flags); | |
291 // do not do set_bytecode on a secondary CP cache entry | 292 // do not do set_bytecode on a secondary CP cache entry |
292 //set_bytecode_1(Bytecodes::_invokedynamic); | 293 //set_bytecode_1(Bytecodes::_invokedynamic); |
294 set_f1_if_null_atomic(call_site()); // This must be the last one to set (see NOTE above)! | |
293 } | 295 } |
294 | 296 |
295 | 297 |
296 class LocalOopClosure: public OopClosure { | 298 class LocalOopClosure: public OopClosure { |
297 private: | 299 private: |