--- a/src/hotspot/share/c1/c1_CodeStubs.hpp Thu Oct 31 17:16:36 2019 +0100
+++ b/src/hotspot/share/c1/c1_CodeStubs.hpp Tue Nov 05 11:53:46 2019 +0100
@@ -409,7 +409,7 @@
if (_id == PatchingStub::access_field_id) {
// embed a fixed offset to handle long patches which need to be offset by a word.
// the patching code will just add the field offset field to this offset so
- // that we can refernce either the high or low word of a double word field.
+ // that we can reference either the high or low word of a double word field.
int field_offset = 0;
switch (patch_code) {
case lir_patch_low: field_offset = lo_word_offset_in_bytes; break;
@@ -419,6 +419,8 @@
}
NativeMovRegMem* n_move = nativeMovRegMem_at(pc_start());
n_move->set_offset(field_offset);
+ // Copy will never get executed, so only copy the part which is required for patching.
+ _bytes_to_copy = MAX2(n_move->num_bytes_to_end_of_patch(), (int)NativeGeneralJump::instruction_size);
} else if (_id == load_klass_id || _id == load_mirror_id || _id == load_appendix_id) {
assert(_obj != noreg, "must have register object for load_klass/load_mirror");
#ifdef ASSERT