@@ -625,7 +625,7 @@ static jlong add_method_info(JfrBigEndianWriter& writer,
625
625
DEBUG_ONLY (assert (start_offset + 8 == writer.current_offset (), " invariant" );)
626
626
// Code attribute
627
627
writer.write (code_index); // "Code"
628
- writer.bytes (code, code_len);
628
+ writer.write_bytes (code, code_len);
629
629
DEBUG_ONLY (assert ((start_offset + 8 + 2 + (jlong)code_len) == writer.current_offset (), " invariant" );)
630
630
return writer.current_offset ();
631
631
}
@@ -768,8 +768,8 @@ static u2 position_stream_after_methods(JfrBigEndianWriter& writer,
768
768
// We will need to re-create a new <clinit> in a later step.
769
769
// For now, ensure that this method is excluded from the methods
770
770
// being copied.
771
- writer.bytes (stream->buffer () + orig_method_len_offset,
772
- method_offset - orig_method_len_offset);
771
+ writer.write_bytes (stream->buffer () + orig_method_len_offset,
772
+ method_offset - orig_method_len_offset);
773
773
assert (writer.is_valid (), " invariant" );
774
774
775
775
// Update copy position to skip copy of <clinit> method
@@ -1091,7 +1091,7 @@ static jlong insert_clinit_method(const InstanceKlass* ik,
1091
1091
writer.write <u1>((u1)Bytecodes::_nop);
1092
1092
writer.write <u1>((u1)Bytecodes::_nop);
1093
1093
// insert original clinit code
1094
- writer.bytes (orig_bytecodes, orig_bytecodes_length);
1094
+ writer.write_bytes (orig_bytecodes, orig_bytecodes_length);
1095
1095
}
1096
1096
1097
1097
/* END CLINIT CODE */
@@ -1290,7 +1290,7 @@ static u1* new_bytes_for_lazy_instrumentation(const InstanceKlass* ik,
1290
1290
const u4 orig_access_flag_offset = orig_stream->current_offset ();
1291
1291
// Copy original stream from the beginning up to AccessFlags
1292
1292
// This means the original constant pool contents are copied unmodified
1293
- writer.bytes (orig_stream->buffer (), orig_access_flag_offset);
1293
+ writer.write_bytes (orig_stream->buffer (), orig_access_flag_offset);
1294
1294
assert (writer.is_valid (), " invariant" );
1295
1295
assert (writer.current_offset () == (intptr_t )orig_access_flag_offset, " invariant" ); // same positions
1296
1296
// Our writer now sits just after the last original constant pool entry.
@@ -1324,14 +1324,14 @@ static u1* new_bytes_for_lazy_instrumentation(const InstanceKlass* ik,
1324
1324
orig_stream->skip_u2_fast (iface_len);
1325
1325
const u4 orig_fields_len_offset = orig_stream->current_offset ();
1326
1326
// Copy from AccessFlags up to and including interfaces
1327
- writer.bytes (orig_stream->buffer () + orig_access_flag_offset,
1328
- orig_fields_len_offset - orig_access_flag_offset);
1327
+ writer.write_bytes (orig_stream->buffer () + orig_access_flag_offset,
1328
+ orig_fields_len_offset - orig_access_flag_offset);
1329
1329
assert (writer.is_valid (), " invariant" );
1330
1330
const jlong new_fields_len_offset = writer.current_offset ();
1331
1331
const u2 orig_fields_len = position_stream_after_fields (orig_stream);
1332
1332
u4 orig_method_len_offset = orig_stream->current_offset ();
1333
1333
// Copy up to and including fields
1334
- writer.bytes (orig_stream->buffer () + orig_fields_len_offset, orig_method_len_offset - orig_fields_len_offset);
1334
+ writer.write_bytes (orig_stream->buffer () + orig_fields_len_offset, orig_method_len_offset - orig_fields_len_offset);
1335
1335
assert (writer.is_valid (), " invariant" );
1336
1336
// We are sitting just after the original number of field_infos
1337
1337
// so this is a position where we can add (append) new field_infos
@@ -1350,7 +1350,7 @@ static u1* new_bytes_for_lazy_instrumentation(const InstanceKlass* ik,
1350
1350
orig_method_len_offset);
1351
1351
const u4 orig_attributes_count_offset = orig_stream->current_offset ();
1352
1352
// Copy existing methods
1353
- writer.bytes (orig_stream->buffer () + orig_method_len_offset, orig_attributes_count_offset - orig_method_len_offset);
1353
+ writer.write_bytes (orig_stream->buffer () + orig_method_len_offset, orig_attributes_count_offset - orig_method_len_offset);
1354
1354
assert (writer.is_valid (), " invariant" );
1355
1355
// We are sitting just after the original number of method_infos
1356
1356
// so this is a position where we can add (append) new method_infos
@@ -1372,7 +1372,7 @@ static u1* new_bytes_for_lazy_instrumentation(const InstanceKlass* ik,
1372
1372
writer.write_at_offset <u2>(orig_methods_len + number_of_new_methods, new_method_len_offset);
1373
1373
assert (writer.is_valid (), " invariant" );
1374
1374
// Copy last remaining bytes
1375
- writer.bytes (orig_stream->buffer () + orig_attributes_count_offset, orig_stream_size - orig_attributes_count_offset);
1375
+ writer.write_bytes (orig_stream->buffer () + orig_attributes_count_offset, orig_stream_size - orig_attributes_count_offset);
1376
1376
assert (writer.is_valid (), " invariant" );
1377
1377
assert (writer.current_offset () > orig_stream->length (), " invariant" );
1378
1378
size_of_new_bytes = (jint)writer.current_offset ();
0 commit comments