Skip to content

Commit 56b1db3

Browse files
committed
1 parent 6086363 commit 56b1db3

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

mmtk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ lto = true
1717
[package.metadata.openjdk]
1818
# Our CI matches the following line and extract mmtk/openjdk. If this line is updated, please check ci yaml files and make sure it works.
1919
openjdk_repo = "https://github.com/caizixian/jdk-mmtk.git"
20-
openjdk_version = "9efdbe4fe8cc1b7e5dc6afc157bcbe11f295af44"
20+
openjdk_version = "76137004ff56ee00198a9fc9a060dee72464e39b"
2121

2222
[dependencies]
2323
libc = "0.2"

openjdk/share/mmtkBarrierSetC2.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ void MMTkBarrierSetC2::expand_allocate(PhaseMacroExpand* x,
4747
AllocateNode* alloc, // allocation node to be expanded
4848
Node* length, // array length for an array allocation
4949
const TypeFunc* slow_call_type, // Type of slow call
50-
address slow_call_address) { // Address of slow call
50+
address slow_call_address,
51+
Node* valid_length_test) { // Address of slow call
5152
Node* ctrl = alloc->in(TypeFunc::Control);
5253
Node* mem = alloc->in(TypeFunc::Memory);
5354
Node* i_o = alloc->in(TypeFunc::I_O);
@@ -465,6 +466,12 @@ void MMTkBarrierSetC2::expand_allocate(PhaseMacroExpand* x,
465466
// Copy debug information and adjust JVMState information, then replace
466467
// allocate node with the call
467468
call->copy_call_debug_info(&(x->_igvn), (SafePointNode*) alloc);
469+
// For array allocations, copy the valid length check to the call node so Compile::final_graph_reshaping() can verify
470+
// that the call has the expected number of CatchProj nodes (in case the allocation always fails and the fallthrough
471+
// path dies).
472+
if (valid_length_test != NULL) {
473+
call->add_req(valid_length_test);
474+
}
468475
if (!always_slow) {
469476
call->set_cnt(PROB_UNLIKELY_MAG(4)); // Same effect as RC_UNCOMMON.
470477
} else {

openjdk/share/mmtkBarrierSetC2.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ class MMTkBarrierSetC2: public BarrierSetC2 {
101101
AllocateNode* alloc, // allocation node to be expanded
102102
Node* length, // array length for an array allocation
103103
const TypeFunc* slow_call_type, // Type of slow call
104-
address slow_call_address); // Address of slow call
104+
address slow_call_address, // Address of slow call
105+
Node* valid_length_test); // whether length is valid or not
105106
};
106107

107108
class MMTkIdealKit: public IdealKit {

0 commit comments

Comments
 (0)