Mercurial > hg > truffle
comparison src/cpu/x86/vm/c1_LIRAssembler_x86.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 | ac637b7220d1 |
children | ec8c74742417 |
comparison
equal
deleted
inserted
replaced
2006:bbefa3ca1543 | 2007:5ddfcf4b079e |
---|---|
1714 | 1714 |
1715 if (op->should_profile()) { | 1715 if (op->should_profile()) { |
1716 ciMethod* method = op->profiled_method(); | 1716 ciMethod* method = op->profiled_method(); |
1717 assert(method != NULL, "Should have method"); | 1717 assert(method != NULL, "Should have method"); |
1718 int bci = op->profiled_bci(); | 1718 int bci = op->profiled_bci(); |
1719 md = method->method_data(); | 1719 md = method->method_data_or_null(); |
1720 if (md == NULL) { | 1720 assert(md != NULL, "Sanity"); |
1721 bailout("out of memory building methodDataOop"); | |
1722 return; | |
1723 } | |
1724 data = md->bci_to_data(bci); | 1721 data = md->bci_to_data(bci); |
1725 assert(data != NULL, "need data for type check"); | 1722 assert(data != NULL, "need data for type check"); |
1726 assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); | 1723 assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); |
1727 } | 1724 } |
1728 Label profile_cast_success, profile_cast_failure; | 1725 Label profile_cast_success, profile_cast_failure; |
1877 | 1874 |
1878 if (op->should_profile()) { | 1875 if (op->should_profile()) { |
1879 ciMethod* method = op->profiled_method(); | 1876 ciMethod* method = op->profiled_method(); |
1880 assert(method != NULL, "Should have method"); | 1877 assert(method != NULL, "Should have method"); |
1881 int bci = op->profiled_bci(); | 1878 int bci = op->profiled_bci(); |
1882 md = method->method_data(); | 1879 md = method->method_data_or_null(); |
1883 if (md == NULL) { | 1880 assert(md != NULL, "Sanity"); |
1884 bailout("out of memory building methodDataOop"); | |
1885 return; | |
1886 } | |
1887 data = md->bci_to_data(bci); | 1881 data = md->bci_to_data(bci); |
1888 assert(data != NULL, "need data for type check"); | 1882 assert(data != NULL, "need data for type check"); |
1889 assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); | 1883 assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); |
1890 } | 1884 } |
1891 Label profile_cast_success, profile_cast_failure, done; | 1885 Label profile_cast_success, profile_cast_failure, done; |
3371 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { | 3365 void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { |
3372 ciMethod* method = op->profiled_method(); | 3366 ciMethod* method = op->profiled_method(); |
3373 int bci = op->profiled_bci(); | 3367 int bci = op->profiled_bci(); |
3374 | 3368 |
3375 // Update counter for all call types | 3369 // Update counter for all call types |
3376 ciMethodData* md = method->method_data(); | 3370 ciMethodData* md = method->method_data_or_null(); |
3377 if (md == NULL) { | 3371 assert(md != NULL, "Sanity"); |
3378 bailout("out of memory building methodDataOop"); | |
3379 return; | |
3380 } | |
3381 ciProfileData* data = md->bci_to_data(bci); | 3372 ciProfileData* data = md->bci_to_data(bci); |
3382 assert(data->is_CounterData(), "need CounterData for calls"); | 3373 assert(data->is_CounterData(), "need CounterData for calls"); |
3383 assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); | 3374 assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); |
3384 Register mdo = op->mdo()->as_register(); | 3375 Register mdo = op->mdo()->as_register(); |
3385 __ movoop(mdo, md->constant_encoding()); | 3376 __ movoop(mdo, md->constant_encoding()); |