Mercurial > hg > graal-compiler
comparison src/share/vm/c1/c1_Compilation.cpp @ 2007:5ddfcf4b079e
7003554: (tiered) assert(is_null_object() || handle() != NULL) failed: cannot embed null pointer
Summary: C1 with profiling doesn't check whether the MDO has been really allocated, which can silently fail if the perm gen is full. The solution is to check if the allocation failed and bailout out of inlining or compilation.
Reviewed-by: kvn, never
author | iveresov |
---|---|
date | Thu, 02 Dec 2010 17:21:12 -0800 |
parents | f95d63e2154a |
children | 2f9d59b0fa5c |
comparison
equal
deleted
inserted
replaced
2006:bbefa3ca1543 | 2007:5ddfcf4b079e |
---|---|
296 } | 296 } |
297 } | 297 } |
298 | 298 |
299 CHECK_BAILOUT_(no_frame_size); | 299 CHECK_BAILOUT_(no_frame_size); |
300 | 300 |
301 if (is_profiling()) { | 301 if (is_profiling() && !method()->ensure_method_data()) { |
302 method()->build_method_data(); | 302 BAILOUT_("mdo allocation failed", no_frame_size); |
303 } | 303 } |
304 | 304 |
305 { | 305 { |
306 PhaseTraceTime timeit(_t_buildIR); | 306 PhaseTraceTime timeit(_t_buildIR); |
307 build_hir(); | 307 build_hir(); |
482 if (bailed_out()) { | 482 if (bailed_out()) { |
483 _env->record_method_not_compilable(bailout_msg(), !TieredCompilation); | 483 _env->record_method_not_compilable(bailout_msg(), !TieredCompilation); |
484 if (is_profiling()) { | 484 if (is_profiling()) { |
485 // Compilation failed, create MDO, which would signal the interpreter | 485 // Compilation failed, create MDO, which would signal the interpreter |
486 // to start profiling on its own. | 486 // to start profiling on its own. |
487 _method->build_method_data(); | 487 _method->ensure_method_data(); |
488 } | 488 } |
489 } else if (is_profiling() && _would_profile) { | 489 } else if (is_profiling() && _would_profile) { |
490 ciMethodData *md = method->method_data(); | 490 ciMethodData *md = method->method_data_or_null(); |
491 assert (md != NULL, "Should have MDO"); | 491 assert(md != NULL, "Sanity"); |
492 md->set_would_profile(_would_profile); | 492 md->set_would_profile(_would_profile); |
493 } | 493 } |
494 } | 494 } |
495 | 495 |
496 Compilation::~Compilation() { | 496 Compilation::~Compilation() { |