@@ -1383,7 +1383,12 @@ class StubGenerator: public StubCodeGenerator {
13831383 // save regs before copy_memory
13841384 __ push (RegSet::of (d, count), sp);
13851385 }
1386- copy_memory (aligned, s, d, count, rscratch1, size);
1386+ {
1387+ // UnsafeCopyMemory page error: continue after ucm
1388+ bool add_entry = !is_oop && (!aligned || sizeof (jlong) == size);
1389+ UnsafeCopyMemoryMark ucmm (this , add_entry, true );
1390+ copy_memory (aligned, s, d, count, rscratch1, size);
1391+ }
13871392
13881393 if (is_oop) {
13891394 __ pop (RegSet::of (d, count), sp);
@@ -1455,7 +1460,12 @@ class StubGenerator: public StubCodeGenerator {
14551460 // save regs before copy_memory
14561461 __ push (RegSet::of (d, count), sp);
14571462 }
1458- copy_memory (aligned, s, d, count, rscratch1, -size);
1463+ {
1464+ // UnsafeCopyMemory page error: continue after ucm
1465+ bool add_entry = !is_oop && (!aligned || sizeof (jlong) == size);
1466+ UnsafeCopyMemoryMark ucmm (this , add_entry, true );
1467+ copy_memory (aligned, s, d, count, rscratch1, -size);
1468+ }
14591469 if (is_oop) {
14601470 __ pop (RegSet::of (d, count), sp);
14611471 if (VerifyOops)
@@ -5816,6 +5826,10 @@ class StubGenerator: public StubCodeGenerator {
58165826 }
58175827}; // end class declaration
58185828
5829+ #define UCM_TABLE_MAX_ENTRIES 8
58195830void StubGenerator_generate (CodeBuffer* code, bool all) {
5831+ if (UnsafeCopyMemory::_table == NULL ) {
5832+ UnsafeCopyMemory::create_table (UCM_TABLE_MAX_ENTRIES);
5833+ }
58205834 StubGenerator g (code, all);
58215835}
0 commit comments