Mercurial > hg > truffle
comparison src/share/vm/graal/graalEnv.cpp @ 7089:af30115c9d0e
added metering of code installation failure rate to detect excessive failure caused by overly optimistic assumptions
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 28 Nov 2012 20:39:43 +0100 |
parents | e5ec98288b91 |
children | eec7173947a1 |
comparison
equal
deleted
inserted
replaced
7088:97d0eae99568 | 7089:af30115c9d0e |
---|---|
426 return true; | 426 return true; |
427 } | 427 } |
428 | 428 |
429 // ------------------------------------------------------------------ | 429 // ------------------------------------------------------------------ |
430 // ciEnv::register_method | 430 // ciEnv::register_method |
431 nmethod* GraalEnv::register_method(methodHandle& method, | 431 GraalEnv::CodeInstallResult GraalEnv::register_method( |
432 methodHandle& method, | |
433 nmethod*& nm, | |
432 int entry_bci, | 434 int entry_bci, |
433 CodeOffsets* offsets, | 435 CodeOffsets* offsets, |
434 int orig_pc_offset, | 436 int orig_pc_offset, |
435 CodeBuffer* code_buffer, | 437 CodeBuffer* code_buffer, |
436 int frame_words, | 438 int frame_words, |
445 bool has_debug_info, | 447 bool has_debug_info, |
446 bool has_unsafe_access, | 448 bool has_unsafe_access, |
447 Handle installed_code) { | 449 Handle installed_code) { |
448 EXCEPTION_CONTEXT; | 450 EXCEPTION_CONTEXT; |
449 NMethodSweeper::possibly_sweep(); | 451 NMethodSweeper::possibly_sweep(); |
450 nmethod* nm = NULL; | 452 nm = NULL; |
451 int comp_level = CompLevel_simple; | 453 int comp_level = CompLevel_simple; |
452 { | 454 { |
453 // To prevent compile queue updates. | 455 // To prevent compile queue updates. |
454 MutexLocker locker(MethodCompileQueue_lock, THREAD); | 456 MutexLocker locker(MethodCompileQueue_lock, THREAD); |
455 | 457 |
470 | 472 |
471 // All buffers in the CodeBuffer are allocated in the CodeCache. | 473 // All buffers in the CodeBuffer are allocated in the CodeCache. |
472 // If the code buffer is created on each compile attempt | 474 // If the code buffer is created on each compile attempt |
473 // as in C2, then it must be freed. | 475 // as in C2, then it must be freed. |
474 //code_buffer->free_blob(); | 476 //code_buffer->free_blob(); |
475 return NULL; | 477 return GraalEnv::dependencies_failed; |
476 } | 478 } |
477 | 479 |
478 nm = nmethod::new_nmethod(method, | 480 nm = nmethod::new_nmethod(method, |
479 compile_id, | 481 compile_id, |
480 entry_bci, | 482 entry_bci, |
553 } | 555 } |
554 } | 556 } |
555 // JVMTI -- compiled method notification (must be done outside lock) | 557 // JVMTI -- compiled method notification (must be done outside lock) |
556 if (nm != NULL) { | 558 if (nm != NULL) { |
557 nm->post_compiled_method_load_event(); | 559 nm->post_compiled_method_load_event(); |
558 } | 560 return GraalEnv::ok; |
559 | 561 } |
560 return nm; | 562 |
561 } | 563 return GraalEnv::cache_full; |
562 | 564 } |
565 |