RPNXCortado
C++23 JVM class-file, bytecode, validation, and JAR toolkit
Loading...
Searching...
No Matches
attributes.hpp
Go to the documentation of this file.
1// AI Generated 2026 Ryan P. Nicholl <rnicholl@protonmail.com>
2// SPDX-License-Identifier: Apache-2.0
3
15
16#ifndef RPNX_CORTADO_ATTRIBUTES_HPP
17#define RPNX_CORTADO_ATTRIBUTES_HPP
18
19#include <cstddef>
20#include <cstdint>
23#include <rpnx/variant.hpp>
24#include <utility>
25#include <variant>
26#include <vector>
27
29{
32 {
34 std::vector< std::byte > info;
35 RPNX_MEMBER_METADATA(unknown_attribute, name_index, info);
36 };
37
45
48 {
49 RPNX_EMPTY_METADATA(top_variable_info);
50 };
51
54 {
55 RPNX_EMPTY_METADATA(integer_variable_info);
56 };
57
60 {
61 RPNX_EMPTY_METADATA(float_variable_info);
62 };
63
66 {
67 RPNX_EMPTY_METADATA(double_variable_info);
68 };
69
72 {
73 RPNX_EMPTY_METADATA(long_variable_info);
74 };
75
78 {
79 RPNX_EMPTY_METADATA(null_variable_info);
80 };
81
84 {
85 RPNX_EMPTY_METADATA(uninitialized_this_variable_info);
86 };
87
94
101
103 using verification_type_info = std::variant< top_variable_info, integer_variable_info, float_variable_info, double_variable_info, long_variable_info, null_variable_info, uninitialized_this_variable_info, object_variable_info, uninitialized_variable_info >;
104
107 {
108 std::uint8_t frame_type{};
109 RPNX_MEMBER_METADATA(same_frame, frame_type);
110 };
111
119
127
130 {
131 std::uint8_t frame_type{248};
132 std::uint16_t offset_delta{};
133 RPNX_MEMBER_METADATA(chop_frame, frame_type, offset_delta);
134 };
135
138 {
139 std::uint16_t offset_delta{};
140 RPNX_MEMBER_METADATA(same_frame_extended, offset_delta);
141 };
142
145 {
146 std::uint8_t frame_type{252};
147 std::uint16_t offset_delta{};
148 std::vector< verification_type_info > locals;
149 RPNX_MEMBER_METADATA(append_frame, frame_type, offset_delta, locals);
150 };
151
154 {
155 std::uint16_t offset_delta{};
156 std::vector< verification_type_info > locals;
157 std::vector< verification_type_info > stack;
158 RPNX_MEMBER_METADATA(full_frame, offset_delta, locals, stack);
159 };
160
162 using stack_map_frame = std::variant< same_frame, same_locals_one_stack_item_frame, same_locals_one_stack_item_frame_extended, chop_frame, same_frame_extended, append_frame, full_frame >;
163
166 {
168 std::vector< stack_map_frame > entries;
169 RPNX_MEMBER_METADATA(stack_map_table_attribute, name_index, entries);
170 };
171
174 {
176 std::vector< constant_pool_index > exception_indexes;
177 RPNX_MEMBER_METADATA(exceptions_attribute, name_index, exception_indexes);
178 };
179
182 {
183 constant_pool_index inner_class_info_index;
184 constant_pool_index outer_class_info_index;
185 constant_pool_index inner_name_index;
186 class_access_flags access_flags{class_access_flags::none};
187 RPNX_MEMBER_METADATA(inner_class_info, inner_class_info_index, outer_class_info_index, inner_name_index, access_flags);
188 };
189
192 {
193 constant_pool_index name_index;
194 std::vector< inner_class_info > classes;
195 RPNX_MEMBER_METADATA(inner_classes_attribute, name_index, classes);
196 };
197
200 {
201 constant_pool_index name_index;
202 constant_pool_index class_index;
203 constant_pool_index method_index;
204 RPNX_MEMBER_METADATA(enclosing_method_attribute, name_index, class_index, method_index);
205 };
206
209 {
210 constant_pool_index name_index;
211 RPNX_MEMBER_METADATA(synthetic_attribute, name_index);
212 };
213
216 {
217 constant_pool_index name_index;
218 constant_pool_index signature_index;
219 RPNX_MEMBER_METADATA(signature_attribute, name_index, signature_index);
220 };
221
224 {
225 constant_pool_index name_index;
226 constant_pool_index source_file_index;
227 RPNX_MEMBER_METADATA(source_file_attribute, name_index, source_file_index);
228 };
229
232 {
233 constant_pool_index name_index;
234 std::vector< std::byte > debug_extension;
235 RPNX_MEMBER_METADATA(source_debug_extension_attribute, name_index, debug_extension);
236 };
237
240 {
242 std::uint16_t line_number{};
243 RPNX_MEMBER_METADATA(line_number_info, start, line_number);
244 };
245
248 {
249 constant_pool_index name_index;
250 std::vector< line_number_info > lines;
251 RPNX_MEMBER_METADATA(line_number_table_attribute, name_index, lines);
252 };
253
264
267 {
268 constant_pool_index name_index;
269 std::vector< local_variable_info > variables;
270 RPNX_MEMBER_METADATA(local_variable_table_attribute, name_index, variables);
271 };
272
275 {
276 code_offset start;
277 std::uint16_t length{};
278 constant_pool_index name_index;
279 constant_pool_index signature_index;
281 RPNX_MEMBER_METADATA(local_variable_type_info, start, length, name_index, signature_index, index);
282 };
283
286 {
287 constant_pool_index name_index;
288 std::vector< local_variable_type_info > variables;
289 RPNX_MEMBER_METADATA(local_variable_type_table_attribute, name_index, variables);
290 };
291
294 {
295 constant_pool_index name_index;
296 RPNX_MEMBER_METADATA(deprecated_attribute, name_index);
297 };
298
300 enum class annotation_constant_kind : std::uint8_t { byte = 'B', character = 'C', double_precision = 'D', floating_point = 'F', integer = 'I', long_integer = 'J', short_integer = 'S', boolean = 'Z', string = 's' };
301
303 template < annotation_constant_kind Kind >
305 {
306 static constexpr annotation_constant_kind kind = Kind;
307 constant_pool_index constant_value_index;
308 RPNX_MEMBER_METADATA(annotation_constant_value, constant_value_index);
309 };
310
313 {
314 constant_pool_index type_name_index;
315 constant_pool_index constant_name_index;
316 RPNX_MEMBER_METADATA(annotation_enum_value, type_name_index, constant_name_index);
317 };
318
321 {
322 constant_pool_index class_info_index;
323 RPNX_MEMBER_METADATA(annotation_class_value, class_info_index);
324 };
325
326 struct annotation;
328
337
340 {
341 constant_pool_index element_name_index;
342 annotation_value value;
343 RPNX_MEMBER_METADATA(annotation_element, element_name_index, value);
344 };
345
348 {
349 constant_pool_index type_index;
350 std::vector< annotation_element > elements;
351 RPNX_MEMBER_METADATA(annotation, type_index, elements);
352 };
353
356 {
357 std::vector< annotation_value > values;
358 RPNX_MEMBER_METADATA(annotation_array_value, values);
359 };
360
363 {
364 constant_pool_index name_index;
365 std::vector< annotation > annotations;
366 RPNX_MEMBER_METADATA(runtime_visible_annotations_attribute, name_index, annotations);
367 };
368
371 {
372 constant_pool_index name_index;
373 std::vector< annotation > annotations;
374 RPNX_MEMBER_METADATA(runtime_invisible_annotations_attribute, name_index, annotations);
375 };
376
379 {
380 constant_pool_index name_index;
381 std::vector< std::vector< annotation > > parameters;
382 RPNX_MEMBER_METADATA(runtime_visible_parameter_annotations_attribute, name_index, parameters);
383 };
384
387 {
388 constant_pool_index name_index;
389 std::vector< std::vector< annotation > > parameters;
390 RPNX_MEMBER_METADATA(runtime_invisible_parameter_annotations_attribute, name_index, parameters);
391 };
392
394 enum class type_annotation_target_type : std::uint8_t { class_type_parameter = 0x00, method_type_parameter = 0x01, class_extends = 0x10, class_type_parameter_bound = 0x11, method_type_parameter_bound = 0x12, field = 0x13, method_return = 0x14, method_receiver = 0x15, method_formal_parameter = 0x16, throws_ = 0x17, local_variable = 0x40, resource_variable = 0x41, exception_parameter = 0x42, instanceof_ = 0x43, new_ = 0x44, constructor_reference = 0x45, method_reference = 0x46, cast = 0x47, constructor_invocation_type_argument = 0x48, method_invocation_type_argument = 0x49, constructor_reference_type_argument = 0x4A, method_reference_type_argument = 0x4B };
395
398 {
399 std::uint8_t type_parameter_index{};
400 RPNX_MEMBER_METADATA(type_parameter_target_info, type_parameter_index);
401 };
402
405 {
406 std::uint16_t supertype_index{};
407 RPNX_MEMBER_METADATA(supertype_target_info, supertype_index);
408 };
409
412 {
413 std::uint8_t type_parameter_index{};
414 std::uint8_t bound_index{};
415 RPNX_MEMBER_METADATA(type_parameter_bound_target_info, type_parameter_index, bound_index);
416 };
417
420 {
421 RPNX_EMPTY_METADATA(empty_target_info);
422 };
423
426 {
427 std::uint8_t formal_parameter_index{};
428 RPNX_MEMBER_METADATA(formal_parameter_target_info, formal_parameter_index);
429 };
430
433 {
434 std::uint16_t throws_type_index{};
435 RPNX_MEMBER_METADATA(throws_target_info, throws_type_index);
436 };
437
440 {
441 code_offset start;
442 std::uint16_t length{};
444 RPNX_MEMBER_METADATA(local_variable_target_range, start, length, index);
445 };
446
449 {
450 std::vector< local_variable_target_range > ranges;
451 RPNX_MEMBER_METADATA(local_variable_target_info, ranges);
452 };
453
456 {
457 std::uint16_t exception_table_index{};
458 RPNX_MEMBER_METADATA(catch_target_info, exception_table_index);
459 };
460
463 {
464 code_offset offset;
465 RPNX_MEMBER_METADATA(offset_target_info, offset);
466 };
467
470 {
471 code_offset offset;
472 std::uint8_t type_argument_index{};
473 RPNX_MEMBER_METADATA(type_argument_target_info, offset, type_argument_index);
474 };
475
477 template < type_annotation_target_type Type, typename Info >
479 {
480 static constexpr type_annotation_target_type type = Type;
481 Info info;
482 RPNX_MEMBER_METADATA(type_annotation_target, info);
483 };
484
486 using type_annotation_target_info = std::variant< type_annotation_target< type_annotation_target_type::class_type_parameter, type_parameter_target_info >, type_annotation_target< type_annotation_target_type::method_type_parameter, type_parameter_target_info >, type_annotation_target< type_annotation_target_type::class_extends, supertype_target_info >, type_annotation_target< type_annotation_target_type::class_type_parameter_bound, type_parameter_bound_target_info >, type_annotation_target< type_annotation_target_type::method_type_parameter_bound, type_parameter_bound_target_info >, type_annotation_target< type_annotation_target_type::field, empty_target_info >, type_annotation_target< type_annotation_target_type::method_return, empty_target_info >, type_annotation_target< type_annotation_target_type::method_receiver, empty_target_info >, type_annotation_target< type_annotation_target_type::method_formal_parameter, formal_parameter_target_info >, type_annotation_target< type_annotation_target_type::throws_, throws_target_info >, type_annotation_target< type_annotation_target_type::local_variable, local_variable_target_info >, type_annotation_target< type_annotation_target_type::resource_variable, local_variable_target_info >, type_annotation_target< type_annotation_target_type::exception_parameter, catch_target_info >, type_annotation_target< type_annotation_target_type::instanceof_, offset_target_info >, type_annotation_target< type_annotation_target_type::new_, offset_target_info >, type_annotation_target< type_annotation_target_type::constructor_reference, offset_target_info >, type_annotation_target< type_annotation_target_type::method_reference, offset_target_info >, type_annotation_target< type_annotation_target_type::cast, type_argument_target_info >, type_annotation_target< type_annotation_target_type::constructor_invocation_type_argument, type_argument_target_info >, type_annotation_target< type_annotation_target_type::method_invocation_type_argument, type_argument_target_info >, type_annotation_target< type_annotation_target_type::constructor_reference_type_argument, type_argument_target_info >, type_annotation_target< type_annotation_target_type::method_reference_type_argument, type_argument_target_info > >;
487
489 enum class type_path_kind : std::uint8_t { array = 0, nested = 1, wildcard_bound = 2, type_argument = 3 };
490
493 {
494 type_path_kind kind{type_path_kind::array};
495 std::uint8_t type_argument_index{};
496 RPNX_MEMBER_METADATA(type_path_entry, kind, type_argument_index);
497 };
498
501 {
503 std::vector< type_path_entry > path;
504 constant_pool_index type_index;
505 std::vector< annotation_element > elements;
506 RPNX_MEMBER_METADATA(type_annotation, target, path, type_index, elements);
507 };
508
511 {
512 constant_pool_index name_index;
513 std::vector< type_annotation > annotations;
514 RPNX_MEMBER_METADATA(runtime_visible_type_annotations_attribute, name_index, annotations);
515 };
516
519 {
520 constant_pool_index name_index;
521 std::vector< type_annotation > annotations;
522 RPNX_MEMBER_METADATA(runtime_invisible_type_annotations_attribute, name_index, annotations);
523 };
524
527 {
528 constant_pool_index name_index;
529 annotation_value default_value;
530 RPNX_MEMBER_METADATA(annotation_default_attribute, name_index, default_value);
531 };
532
535 {
536 constant_pool_index method_ref;
537 std::vector< constant_pool_index > arguments;
538 RPNX_MEMBER_METADATA(bootstrap_method, method_ref, arguments);
539 };
540
543 {
544 constant_pool_index name_index;
545 std::vector< bootstrap_method > methods;
546 RPNX_MEMBER_METADATA(bootstrap_methods_attribute, name_index, methods);
547 };
548
550 enum class method_parameter_access_flags : std::uint16_t { none = 0, is_final = 0x0010, is_synthetic = 0x1000, is_mandated = 0x8000 };
551
554 {
555 constant_pool_index name_index;
556 method_parameter_access_flags access_flags{method_parameter_access_flags::none};
557 RPNX_MEMBER_METADATA(method_parameter, name_index, access_flags);
558 };
559
562 {
563 constant_pool_index name_index;
564 std::vector< method_parameter > parameters;
565 RPNX_MEMBER_METADATA(method_parameters_attribute, name_index, parameters);
566 };
567
569 enum class module_access_flags : std::uint16_t { none = 0, is_open = 0x0020, is_synthetic = 0x1000, is_mandated = 0x8000 };
570
572 enum class module_requires_flags : std::uint16_t { none = 0, is_transitive = 0x0020, is_static_phase = 0x0040, is_synthetic = 0x1000, is_mandated = 0x8000 };
573
575 enum class module_exports_opens_flags : std::uint16_t { none = 0, is_synthetic = 0x1000, is_mandated = 0x8000 };
576
579 {
580 constant_pool_index requires_index;
581 module_requires_flags flags{module_requires_flags::none};
582 constant_pool_index version_index;
583 RPNX_MEMBER_METADATA(module_requires_info, requires_index, flags, version_index);
584 };
585
588 {
589 constant_pool_index exports_index;
590 module_exports_opens_flags flags{module_exports_opens_flags::none};
591 std::vector< constant_pool_index > exports_to_indexes;
592 RPNX_MEMBER_METADATA(module_exports_info, exports_index, flags, exports_to_indexes);
593 };
594
597 {
598 constant_pool_index opens_index;
599 module_exports_opens_flags flags{module_exports_opens_flags::none};
600 std::vector< constant_pool_index > opens_to_indexes;
601 RPNX_MEMBER_METADATA(module_opens_info, opens_index, flags, opens_to_indexes);
602 };
603
606 {
607 constant_pool_index provides_index;
608 std::vector< constant_pool_index > provides_with_indexes;
609 RPNX_MEMBER_METADATA(module_provides_info, provides_index, provides_with_indexes);
610 };
611
614 {
615 constant_pool_index name_index;
616 constant_pool_index module_name_index;
617 module_access_flags flags{module_access_flags::none};
618 constant_pool_index version_index;
619 std::vector< module_requires_info > requires_entries;
620 std::vector< module_exports_info > exports;
621 std::vector< module_opens_info > opens;
622 std::vector< constant_pool_index > uses_indexes;
623 std::vector< module_provides_info > provides;
624 RPNX_MEMBER_METADATA(module_attribute, name_index, module_name_index, flags, version_index, requires_entries, exports, opens, uses_indexes, provides);
625 };
626
629 {
630 constant_pool_index name_index;
631 std::vector< constant_pool_index > package_indexes;
632 RPNX_MEMBER_METADATA(module_packages_attribute, name_index, package_indexes);
633 };
634
637 {
638 constant_pool_index name_index;
639 constant_pool_index main_class_index;
640 RPNX_MEMBER_METADATA(module_main_class_attribute, name_index, main_class_index);
641 };
642
645 {
646 constant_pool_index name_index;
647 constant_pool_index host_class_index;
648 RPNX_MEMBER_METADATA(nest_host_attribute, name_index, host_class_index);
649 };
650
653 {
654 constant_pool_index name_index;
655 std::vector< constant_pool_index > class_indexes;
656 RPNX_MEMBER_METADATA(nest_members_attribute, name_index, class_indexes);
657 };
658
661 {
662 constant_pool_index name_index;
663 std::vector< constant_pool_index > class_indexes;
664 RPNX_MEMBER_METADATA(permitted_subclasses_attribute, name_index, class_indexes);
665 };
666
668 using record_component_attribute = std::variant< signature_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, unknown_attribute >;
669
672 {
673 constant_pool_index name_index;
674 constant_pool_index descriptor_index;
675 std::vector< record_component_attribute > attributes;
676 RPNX_MEMBER_METADATA(record_component_info, name_index, descriptor_index, attributes);
677 };
678
681 {
682 constant_pool_index name_index;
683 std::vector< record_component_info > components;
684 RPNX_MEMBER_METADATA(record_attribute, name_index, components);
685 };
686
688 using code_nested_attribute = std::variant< stack_map_table_attribute, line_number_table_attribute, local_variable_table_attribute, local_variable_type_table_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, unknown_attribute >;
689
699
707 {
709 std::uint16_t max_stack{};
710 std::uint16_t max_locals{};
712 std::vector< exception_handler > exception_table;
713 std::vector< code_nested_attribute > attributes;
715 };
716
718 using field_attribute = std::variant< constant_value_attribute, synthetic_attribute, signature_attribute, deprecated_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, unknown_attribute >;
719
721 using method_attribute = std::variant< code_attribute, exceptions_attribute, synthetic_attribute, signature_attribute, deprecated_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_parameter_annotations_attribute, runtime_invisible_parameter_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, annotation_default_attribute, method_parameters_attribute, unknown_attribute >;
722
724 using class_attribute = std::variant< inner_classes_attribute, enclosing_method_attribute, synthetic_attribute, signature_attribute, source_file_attribute, source_debug_extension_attribute, deprecated_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, bootstrap_methods_attribute, module_attribute, module_packages_attribute, module_main_class_attribute, nest_host_attribute, nest_members_attribute, record_attribute, permitted_subclasses_attribute, unknown_attribute >;
725
735
745
753 {
755 std::vector< constant_pool_entry > constant_pool;
756 class_access_flags access_flags{class_access_flags::none};
759 std::vector< constant_pool_index > interfaces;
760 std::vector< field_info > fields;
761 std::vector< method_info > methods;
762 std::vector< class_attribute > attributes;
764 };
765} // namespace rpnx::cortado
766
767#endif // RPNX_CORTADO_ATTRIBUTES_HPP
Exact JVM instruction types and code-array serialization APIs.
JVM class-file, bytecode, validation, generation, and JAR APIs.
annotation_constant_kind
Constant-valued annotation element tags.
std::variant< instruction_sequence, raw_code > code_body
Either a decoded instruction sequence or an exact raw tooling payload.
Definition bytecode.hpp:317
type_path_kind
A type_path component kind.
std::variant< same_frame, same_locals_one_stack_item_frame, same_locals_one_stack_item_frame_extended, chop_frame, same_frame_extended, append_frame, full_frame > stack_map_frame
Any valid StackMapTable frame encoding.
std::variant< signature_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, unknown_attribute > record_component_attribute
Attributes valid in a record_component_info structure.
std::variant< constant_value_attribute, synthetic_attribute, signature_attribute, deprecated_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, unknown_attribute > field_attribute
Attributes valid on a field_info structure.
field_access_flags
JVM field access flags.
Definition types.hpp:67
module_exports_opens_flags
JVM module exports and opens flags.
std::variant< type_annotation_target< type_annotation_target_type::class_type_parameter, type_parameter_target_info >, type_annotation_target< type_annotation_target_type::method_type_parameter, type_parameter_target_info >, type_annotation_target< type_annotation_target_type::class_extends, supertype_target_info >, type_annotation_target< type_annotation_target_type::class_type_parameter_bound, type_parameter_bound_target_info >, type_annotation_target< type_annotation_target_type::method_type_parameter_bound, type_parameter_bound_target_info >, type_annotation_target< type_annotation_target_type::field, empty_target_info >, type_annotation_target< type_annotation_target_type::method_return, empty_target_info >, type_annotation_target< type_annotation_target_type::method_receiver, empty_target_info >, type_annotation_target< type_annotation_target_type::method_formal_parameter, formal_parameter_target_info >, type_annotation_target< type_annotation_target_type::throws_, throws_target_info >, type_annotation_target< type_annotation_target_type::local_variable, local_variable_target_info >, type_annotation_target< type_annotation_target_type::resource_variable, local_variable_target_info >, type_annotation_target< type_annotation_target_type::exception_parameter, catch_target_info >, type_annotation_target< type_annotation_target_type::instanceof_, offset_target_info >, type_annotation_target< type_annotation_target_type::new_, offset_target_info >, type_annotation_target< type_annotation_target_type::constructor_reference, offset_target_info >, type_annotation_target< type_annotation_target_type::method_reference, offset_target_info >, type_annotation_target< type_annotation_target_type::cast, type_argument_target_info >, type_annotation_target< type_annotation_target_type::constructor_invocation_type_argument, type_argument_target_info >, type_annotation_target< type_annotation_target_type::method_invocation_type_argument, type_argument_target_info >, type_annotation_target< type_annotation_target_type::constructor_reference_type_argument, type_argument_target_info >, type_annotation_target< type_annotation_target_type::method_reference_type_argument, type_argument_target_info > > type_annotation_target_info
Any valid type-annotation target_info structure.
module_requires_flags
JVM module requires flags.
method_parameter_access_flags
JVM MethodParameters access flags.
std::variant< stack_map_table_attribute, line_number_table_attribute, local_variable_table_attribute, local_variable_type_table_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, unknown_attribute > code_nested_attribute
Attributes valid within a Code attribute.
std::variant< any_type_argument, exact_type_argument, extends_type_argument, super_type_argument > type_argument
One generic class type argument.
class_access_flags
JVM class access flags.
Definition types.hpp:58
method_access_flags
JVM method access flags.
Definition types.hpp:76
type_annotation_target_type
A type-annotation target discriminator.
std::variant< code_attribute, exceptions_attribute, synthetic_attribute, signature_attribute, deprecated_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_parameter_annotations_attribute, runtime_invisible_parameter_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, annotation_default_attribute, method_parameters_attribute, unknown_attribute > method_attribute
Attributes valid on a method_info structure.
std::variant< top_variable_info, integer_variable_info, float_variable_info, double_variable_info, long_variable_info, null_variable_info, uninitialized_this_variable_info, object_variable_info, uninitialized_variable_info > verification_type_info
A StackMapTable verification_type_info structure.
module_access_flags
JVM module declaration flags.
std::variant< inner_classes_attribute, enclosing_method_attribute, synthetic_attribute, signature_attribute, source_file_attribute, source_debug_extension_attribute, deprecated_attribute, runtime_visible_annotations_attribute, runtime_invisible_annotations_attribute, runtime_visible_type_annotations_attribute, runtime_invisible_type_annotations_attribute, bootstrap_methods_attribute, module_attribute, module_packages_attribute, module_main_class_attribute, nest_host_attribute, nest_members_attribute, record_attribute, permitted_subclasses_attribute, unknown_attribute > class_attribute
Attributes valid on a ClassFile structure.
An array-valued annotation element.
A class-valued annotation element.
A constant-valued annotation element.
An AnnotationDefault attribute.
One named annotation element.
An enum-valued annotation element.
Any annotation element_value structure.
A JVM annotation structure.
An append_frame entry retaining its exact frame type.
std::uint8_t frame_type
Exact frame type 252 through 254; must agree with locals.size().
std::uint16_t offset_delta
Encoded offset delta from the preceding frame.
std::vector< verification_type_info > locals
One through three locals appended to the preceding frame.
One BootstrapMethods attribute entry.
A BootstrapMethods attribute.
An exception-parameter annotation target.
A chop_frame entry retaining its exact frame type.
std::uint16_t offset_delta
Encoded offset delta from the preceding frame.
std::uint8_t frame_type
Exact frame type 248 through 250; determines the number of removed locals.
A JVM class-file version pair.
Definition types.hpp:48
An owning, typed representation of one JVM class file.
constant_pool_index this_class
CONSTANT_Class naming this class or interface.
std::vector< method_info > methods
Declared methods in encoded order.
std::vector< constant_pool_index > interfaces
Direct superinterface CONSTANT_Class indexes in encoded order.
std::vector< constant_pool_entry > constant_pool
Entries in logical order, excluding slot zero and reserved second slots.
constant_pool_index super_class
Direct superclass CONSTANT_Class, or zero only where the format permits.
class_access_flags access_flags
Class, interface, annotation, module, and property flags.
std::vector< field_info > fields
Declared fields in encoded order.
class_file_version version
Minor and major version written after the magic value.
std::vector< class_attribute > attributes
Context-valid class attributes in encoded order.
A fully typed Code attribute.
std::uint16_t max_stack
Maximum operand-stack depth in JVM slots.
std::uint16_t max_locals
Size of the local-variable array in JVM slots.
std::vector< exception_handler > exception_table
Handlers in encoded search order.
std::vector< code_nested_attribute > attributes
Typed nested attributes in encoded order.
code_body code
Exact decoded instructions or a tooling-mode raw payload.
constant_pool_index name_index
UTF-8 constant containing Code.
A byte offset within the code array of a Code attribute.
Definition bytecode.hpp:37
A type-safe index into a JVM constant pool.
Definition types.hpp:34
constant_pool_index constant_value_index
Compatible integer, float, long, double, or string constant.
constant_pool_index name_index
UTF-8 constant containing ConstantValue.
A Deprecated marker attribute.
A double verification type.
An empty annotation target.
An EnclosingMethod attribute.
One Code exception-table entry.
code_offset end
Exclusive protected-range end; the code length itself is permitted.
code_offset handler
Handler entry instruction offset.
code_offset start
Inclusive protected-range start at an instruction boundary.
constant_pool_index catch_type
Caught CONSTANT_Class, or zero for a catch-all handler.
constant_pool_index name_index
UTF-8 constant containing Exceptions.
std::vector< constant_pool_index > exception_indexes
Declared exception CONSTANT_Class indexes.
A JVM field_info structure.
std::vector< field_attribute > attributes
Context-valid attributes in encoded order.
constant_pool_index name_index
UTF-8 constant containing the unqualified field name.
constant_pool_index descriptor_index
UTF-8 constant containing a field descriptor.
field_access_flags access_flags
Format-defined field access and property bits.
A float verification type.
A formal-parameter annotation target.
A full_frame entry.
std::vector< verification_type_info > locals
Complete local verification state.
std::vector< verification_type_info > stack
Complete operand-stack verification state.
std::uint16_t offset_delta
Encoded offset delta from the preceding frame.
One InnerClasses attribute entry.
An integer verification type.
One LineNumberTable entry.
code_offset start
Instruction offset at which this source line begins.
std::uint16_t line_number
Source-file line number.
A JVM local-variable-array index.
Definition bytecode.hpp:30
One LocalVariableTable entry.
constant_pool_index descriptor_index
UTF-8 constant containing the field descriptor.
local_variable_index index
First local-variable-array slot occupied by the value.
code_offset start
Inclusive scope start offset.
constant_pool_index name_index
UTF-8 constant containing the source variable name.
std::uint16_t length
Scope length in code-array bytes; start + length is exclusive.
A LocalVariableTable attribute.
A local-variable annotation target.
One local-variable annotation range.
One LocalVariableTypeTable entry.
A LocalVariableTypeTable attribute.
A long verification type.
A JVM method_info structure.
method_access_flags access_flags
Format-defined method access and property bits.
std::vector< method_attribute > attributes
Context-valid attributes in encoded order.
constant_pool_index name_index
UTF-8 constant containing the method name.
constant_pool_index descriptor_index
UTF-8 constant containing a method descriptor.
One MethodParameters entry.
A MethodParameters attribute.
One exports entry in a Module attribute.
One opens entry in a Module attribute.
One provides entry in a Module attribute.
One requires entry in a Module attribute.
A null verification type.
An object or array verification type.
constant_pool_index class_index
CONSTANT_Class for the represented class or array type.
A bytecode-offset annotation target.
A PermittedSubclasses attribute.
One component in a Record attribute.
A RuntimeInvisibleAnnotations attribute.
A RuntimeInvisibleParameterAnnotations attribute.
A RuntimeInvisibleTypeAnnotations attribute.
A RuntimeVisibleAnnotations attribute.
A RuntimeVisibleParameterAnnotations attribute.
A RuntimeVisibleTypeAnnotations attribute.
A same_frame_extended entry.
std::uint16_t offset_delta
Encoded offset delta from the preceding frame.
A same_frame entry retaining its exact compact frame type.
std::uint8_t frame_type
Exact compact frame type in the inclusive range 0 through 63.
A same_locals_1_stack_item_frame_extended entry.
verification_type_info stack
Sole operand-stack entry.
std::uint16_t offset_delta
Encoded offset delta from the preceding frame.
A same_locals_1_stack_item_frame entry.
std::uint8_t frame_type
Exact compact frame type in the inclusive range 64 through 127.
verification_type_info stack
Sole operand-stack entry.
A SourceDebugExtension attribute whose bytes are not modified UTF-8.
constant_pool_index name_index
UTF-8 constant containing StackMapTable.
std::vector< stack_map_frame > entries
Frames in strictly increasing effective bytecode-offset order.
A supertype annotation target.
A Synthetic marker attribute.
A throws annotation target.
A top verification type.
A target_info paired with its compile-time target_type discriminator.
A JVM type_annotation structure.
A bytecode-offset and type-argument annotation target.
A type-parameter-bound annotation target.
A type-parameter annotation target.
One type_path component.
An uninitialized-this verification type.
An uninitialized value created by a new instruction.
code_offset new_instruction_offset
Offset of the new instruction that created the value.
An unknown standard-extension or vendor attribute retained verbatim.
std::vector< std::byte > info
Exact payload bytes following attribute_length.
constant_pool_index name_index
Attribute-name UTF-8 constant; arbitrary nonstandard names are retained.
Fundamental class-file, constant-pool, and JAR value types.