8#ifndef RPNX_CORTADO_BUILDERS_HPP
9#define RPNX_CORTADO_BUILDERS_HPP
48 template < opcode Operation >
51 static constexpr opcode operation = Operation;
77 std::vector< labeled_lookup_switch_pair >
pairs;
122 template < opcode Operation >
125 static constexpr opcode operation = Operation;
136 template < opcode Operation >
139 static constexpr opcode operation = Operation;
157 template < opcode Operation >
160 static constexpr opcode operation = Operation;
173 using assembly_element = std::variant< instruction, label_binding, labeled_branch_instruction< opcode::ifeq >,
labeled_branch_instruction< opcode::ifne >,
labeled_branch_instruction< opcode::iflt >,
labeled_branch_instruction< opcode::ifge >,
labeled_branch_instruction< opcode::ifgt >,
labeled_branch_instruction< opcode::ifle >,
labeled_branch_instruction< opcode::if_icmpeq >,
labeled_branch_instruction< opcode::if_icmpne >,
labeled_branch_instruction< opcode::if_icmplt >,
labeled_branch_instruction< opcode::if_icmpge >,
labeled_branch_instruction< opcode::if_icmpgt >,
labeled_branch_instruction< opcode::if_icmple >,
labeled_branch_instruction< opcode::if_acmpeq >,
labeled_branch_instruction< opcode::if_acmpne >,
labeled_branch_instruction< opcode::goto_ >,
labeled_branch_instruction< opcode::jsr >,
labeled_branch_instruction< opcode::ifnull >,
labeled_branch_instruction< opcode::ifnonnull >,
labeled_tableswitch_instruction,
labeled_lookupswitch_instruction,
symbolic_field_instruction< opcode::getstatic >,
symbolic_field_instruction< opcode::putstatic >,
symbolic_field_instruction< opcode::getfield >,
symbolic_field_instruction< opcode::putfield >,
symbolic_method_instruction< opcode::invokevirtual >,
symbolic_method_instruction< opcode::invokespecial >,
symbolic_method_instruction< opcode::invokestatic >,
symbolic_invokeinterface_instruction,
symbolic_class_instruction< opcode::new_ >,
symbolic_class_instruction< opcode::anewarray >,
symbolic_class_instruction< opcode::checkcast >,
symbolic_class_instruction< opcode::instanceof_ >,
symbolic_string_instruction >;
267 [[nodiscard]] std::vector< constant_pool_entry >
const&
entries() const noexcept;
276 std::vector< std::
size_t > m_slot_to_entry{std::numeric_limits< std::size_t >::max()};
277 std::map< constant_pool_entry, constant_pool_index > m_indexes;
295 template <
typename Resolver >
299 [](
void*
object, std::string_view left, std::string_view right) -> std::string
309 [[nodiscard]]
explicit operator bool() const noexcept;
317 [[nodiscard]] std::
string common_superclass(std::string_view left, std::string_view right) const;
321 std::string (*m_resolve)(
void*, std::string_view, std::string_view){};
383 template < opcode Operation >
396 template < opcode Operation >
399 static_assert(Operation == opcode::ifeq || Operation == opcode::ifne || Operation == opcode::iflt || Operation == opcode::ifge || Operation == opcode::ifgt || Operation == opcode::ifle || Operation == opcode::if_icmpeq || Operation == opcode::if_icmpne || Operation == opcode::if_icmplt || Operation == opcode::if_icmpge || Operation == opcode::if_icmpgt || Operation == opcode::if_icmple || Operation == opcode::if_acmpeq || Operation == opcode::if_acmpne || Operation == opcode::goto_ || Operation == opcode::jsr || Operation == opcode::ifnull || Operation == opcode::ifnonnull,
"opcode does not have a labeled 16-bit branch form");
400 require_owned_label(target);
650 [[nodiscard]] std::vector< assembly_element >
const&
elements() const noexcept;
654 void require_owned_label(
label value) const;
663 std::
size_t m_next_label{};
Class-file serialization, deserialization, and iterator adapters.
auto fields() noexcept -> std::vector< field_info > &
Returns the mutable exact field sequence for transformations.
auto access_flags() noexcept -> class_access_flags &
Returns the mutable class access flags.
auto add_method(std::string_view name, std::string_view descriptor, method_access_flags flags, code_builder const &code, code_build_options const &options={}, class_hierarchy_resolver_ref hierarchy={}) -> method_info &
Adds a method with a symbolic Code body.
auto add_field(std::string_view name, std::string_view descriptor, field_access_flags flags) -> field_info &
Adds a field without attributes.
auto version() noexcept -> class_file_version &
Returns the mutable class-file version.
auto add_interface(std::string_view internal_name) -> class_file_builder &
Adds an implemented or extended interface by internal class name.
class_file_builder(std::string_view class_name, std::string_view super_class_name="java/lang/Object", class_file_version version={0, 70})
Creates a new class with the supplied internal names.
auto constant_pool() noexcept -> constant_pool_builder &
Returns the shared constant-pool interner.
class_file build() const
Returns a complete exact class-file model.
auto methods() noexcept -> std::vector< method_info > &
Returns the mutable exact method sequence for transformations.
auto attributes() noexcept -> std::vector< class_attribute > &
Returns the mutable typed class-attribute sequence for transformations.
class_file_builder(class_file value)
Initializes a builder from an exact parsed class model.
Non-owning type-erased class-hierarchy resolver used for reference merges.
std::string common_superclass(std::string_view left, std::string_view right) const
Resolves the least common superclass of two internal class names.
class_hierarchy_resolver_ref()=default
Constructs an empty resolver.
class_hierarchy_resolver_ref(Resolver &resolver) noexcept
Refers to an object exposing common_superclass(string_view, string_view).
An owning symbolic JVM code builder.
std::vector< assembly_element > const & elements() const noexcept
Returns the symbolic element sequence.
auto astore(local_variable_index index) -> code_builder &
Stores a reference into a local using the shortest valid encoding.
auto iload(local_variable_index index) -> code_builder &
Loads an int from a local using the shortest valid encoding.
auto bipush(std::int8_t value) -> code_builder &
Pushes a signed byte constant.
auto invokeinterface(std::string owner, std::string name, std::string descriptor) -> code_builder &
Emits a symbolic invokeinterface instruction.
auto aload(local_variable_index index) -> code_builder &
Loads a reference from a local using the shortest valid encoding.
auto fload(local_variable_index index) -> code_builder &
Loads a float from a local using the shortest valid encoding.
code_builder()
Constructs an empty builder with a unique label-ownership token.
auto append() -> code_builder &
Appends an operand-free instruction selected at compile time.
auto checkcast(std::string class_name) -> code_builder &
Emits a symbolic checkcast instruction.
auto iinc(local_variable_index index, std::int16_t amount) -> code_builder &
Increments an int local using compact or wide form as required.
auto bind(label value) -> code_builder &
Binds a label at the current instruction position.
auto istore(local_variable_index index) -> code_builder &
Stores an int into a local using the shortest valid encoding.
auto putfield(std::string owner, std::string name, std::string descriptor) -> code_builder &
Emits a symbolic putfield instruction.
auto dload(local_variable_index index) -> code_builder &
Loads a double from a local using the shortest valid encoding.
label new_label()
Creates a fresh label owned by this builder.
auto add_exception_handler(label start, label end, label handler, std::optional< std::string > catch_type=std::nullopt) -> code_builder &
Adds a symbolic exception-table range.
auto invokevirtual(std::string owner, std::string name, std::string descriptor) -> code_builder &
Emits a symbolic invokevirtual instruction.
auto add_local_variable(label start, label end, std::string name, std::string descriptor, local_variable_index index) -> code_builder &
Adds a symbolic LocalVariableTable scope.
auto anewarray(std::string class_name) -> code_builder &
Emits a symbolic anewarray instruction.
auto instanceof_(std::string class_name) -> code_builder &
Emits a symbolic instanceof instruction.
auto tableswitch(label default_target, std::int32_t low, std::vector< label > targets) -> code_builder &
Appends a symbolic tableswitch.
auto putstatic(std::string owner, std::string name, std::string descriptor) -> code_builder &
Emits a symbolic putstatic instruction.
auto branch(label target) -> code_builder &
Appends a compile-time-typed labeled branch.
auto fstore(local_variable_index index) -> code_builder &
Stores a float into a local using the shortest valid encoding.
auto lookupswitch(label default_target, std::vector< labeled_lookup_switch_pair > pairs) -> code_builder &
Appends a symbolic lookupswitch.
auto add_line_number(label start, std::uint16_t line_number) -> code_builder &
Associates a source line with a symbolic code position.
auto getstatic(std::string owner, std::string name, std::string descriptor) -> code_builder &
Emits a symbolic getstatic instruction.
auto invokestatic(std::string owner, std::string name, std::string descriptor, method_owner_kind owner_kind=method_owner_kind::class_) -> code_builder &
Emits a symbolic invokestatic instruction.
auto getfield(std::string owner, std::string name, std::string descriptor) -> code_builder &
Emits a symbolic getfield instruction.
auto set_stack_map_table(stack_map_table_attribute value) -> code_builder &
Supplies an exact StackMapTable and bypasses automatic frame generation.
auto add_local_variable_type(label start, label end, std::string name, std::string signature, local_variable_index index) -> code_builder &
Adds a symbolic LocalVariableTypeTable scope.
auto dstore(local_variable_index index) -> code_builder &
Stores a double into a local using the shortest valid encoding.
auto lload(local_variable_index index) -> code_builder &
Loads a long from a local using the shortest valid encoding.
auto invokespecial(std::string owner, std::string name, std::string descriptor, method_owner_kind owner_kind=method_owner_kind::class_) -> code_builder &
Emits a symbolic invokespecial instruction.
auto sipush(std::int16_t value) -> code_builder &
Pushes a signed short constant.
auto new_(std::string class_name) -> code_builder &
Emits a symbolic new instruction.
auto append(instruction value) -> code_builder &
Appends one exact instruction encoding.
code_attribute finish(code_build_context const &context, constant_pool_builder &constant_pool, class_hierarchy_resolver_ref hierarchy={}) const
Finalizes labels, widths, constant references, and Code metadata.
auto lstore(local_variable_index index) -> code_builder &
Stores a long into a local using the shortest valid encoding.
auto ldc_string(std::string value) -> code_builder &
Loads a string through an automatically interned ldc or ldc_w instruction.
Interns constant-pool entries while retaining deterministic first-insertion order.
constant_pool_index add_name_and_type(std::string_view name, std::string_view descriptor)
Interns a CONSTANT_NameAndType.
constant_pool_index add_interface_methodref(std::string_view owner, std::string_view name, std::string_view descriptor)
Interns a CONSTANT_InterfaceMethodref.
std::string_view utf8_at(constant_pool_index index) const
Returns modified-UTF-8 bytes by logical constant-pool index.
std::vector< constant_pool_entry > build() const
Copies the exact current entry sequence.
constant_pool_entry const & entry_at(constant_pool_index index) const
Returns an exact entry by logical constant-pool index.
constant_pool_index add_utf8(std::string_view bytes)
Interns a modified-UTF-8 byte sequence.
std::vector< constant_pool_entry > const & entries() const noexcept
Returns the exact current entry sequence.
constant_pool_index add_string(std::string_view bytes)
Interns a CONSTANT_String and its modified-UTF-8 payload.
constant_pool_index add_class(std::string_view internal_name)
Interns a CONSTANT_Class and its name.
constant_pool_index add_fieldref(std::string_view owner, std::string_view name, std::string_view descriptor)
Interns a CONSTANT_Fieldref.
constant_pool_index add_methodref(std::string_view owner, std::string_view name, std::string_view descriptor)
Interns a CONSTANT_Methodref.
constant_pool_index intern(constant_pool_entry entry)
Interns an exact constant-pool entry.
constant_pool_builder()=default
Constructs an empty constant pool.
constant_pool_builder(std::vector< constant_pool_entry > entries)
Initializes an interner from an exact existing pool.
Owning syntax trees and codecs for JVM field and method descriptors.
JVM class-file, bytecode, validation, generation, and JAR APIs.
processing_mode
Controls whether invalid-but-preservable tool input is accepted.
std::variant< simple_instruction< opcode::nop >, simple_instruction< opcode::aconst_null >, simple_instruction< opcode::iconst_m1 >, simple_instruction< opcode::iconst_0 >, simple_instruction< opcode::iconst_1 >, simple_instruction< opcode::iconst_2 >, simple_instruction< opcode::iconst_3 >, simple_instruction< opcode::iconst_4 >, simple_instruction< opcode::iconst_5 >, simple_instruction< opcode::lconst_0 >, simple_instruction< opcode::lconst_1 >, simple_instruction< opcode::fconst_0 >, simple_instruction< opcode::fconst_1 >, simple_instruction< opcode::fconst_2 >, simple_instruction< opcode::dconst_0 >, simple_instruction< opcode::dconst_1 >, signed_byte_instruction< opcode::bipush >, signed_short_instruction< opcode::sipush >, constant_pool_index8_instruction< opcode::ldc >, constant_pool_index16_instruction< opcode::ldc_w >, constant_pool_index16_instruction< opcode::ldc2_w >, local_instruction< opcode::iload >, local_instruction< opcode::lload >, local_instruction< opcode::fload >, local_instruction< opcode::dload >, local_instruction< opcode::aload >, simple_instruction< opcode::iload_0 >, simple_instruction< opcode::iload_1 >, simple_instruction< opcode::iload_2 >, simple_instruction< opcode::iload_3 >, simple_instruction< opcode::lload_0 >, simple_instruction< opcode::lload_1 >, simple_instruction< opcode::lload_2 >, simple_instruction< opcode::lload_3 >, simple_instruction< opcode::fload_0 >, simple_instruction< opcode::fload_1 >, simple_instruction< opcode::fload_2 >, simple_instruction< opcode::fload_3 >, simple_instruction< opcode::dload_0 >, simple_instruction< opcode::dload_1 >, simple_instruction< opcode::dload_2 >, simple_instruction< opcode::dload_3 >, simple_instruction< opcode::aload_0 >, simple_instruction< opcode::aload_1 >, simple_instruction< opcode::aload_2 >, simple_instruction< opcode::aload_3 >, simple_instruction< opcode::iaload >, simple_instruction< opcode::laload >, simple_instruction< opcode::faload >, simple_instruction< opcode::daload >, simple_instruction< opcode::aaload >, simple_instruction< opcode::baload >, simple_instruction< opcode::caload >, simple_instruction< opcode::saload >, local_instruction< opcode::istore >, local_instruction< opcode::lstore >, local_instruction< opcode::fstore >, local_instruction< opcode::dstore >, local_instruction< opcode::astore >, simple_instruction< opcode::istore_0 >, simple_instruction< opcode::istore_1 >, simple_instruction< opcode::istore_2 >, simple_instruction< opcode::istore_3 >, simple_instruction< opcode::lstore_0 >, simple_instruction< opcode::lstore_1 >, simple_instruction< opcode::lstore_2 >, simple_instruction< opcode::lstore_3 >, simple_instruction< opcode::fstore_0 >, simple_instruction< opcode::fstore_1 >, simple_instruction< opcode::fstore_2 >, simple_instruction< opcode::fstore_3 >, simple_instruction< opcode::dstore_0 >, simple_instruction< opcode::dstore_1 >, simple_instruction< opcode::dstore_2 >, simple_instruction< opcode::dstore_3 >, simple_instruction< opcode::astore_0 >, simple_instruction< opcode::astore_1 >, simple_instruction< opcode::astore_2 >, simple_instruction< opcode::astore_3 >, simple_instruction< opcode::iastore >, simple_instruction< opcode::lastore >, simple_instruction< opcode::fastore >, simple_instruction< opcode::dastore >, simple_instruction< opcode::aastore >, simple_instruction< opcode::bastore >, simple_instruction< opcode::castore >, simple_instruction< opcode::sastore >, simple_instruction< opcode::pop >, simple_instruction< opcode::pop2 >, simple_instruction< opcode::dup >, simple_instruction< opcode::dup_x1 >, simple_instruction< opcode::dup_x2 >, simple_instruction< opcode::dup2 >, simple_instruction< opcode::dup2_x1 >, simple_instruction< opcode::dup2_x2 >, simple_instruction< opcode::swap >, simple_instruction< opcode::iadd >, simple_instruction< opcode::ladd >, simple_instruction< opcode::fadd >, simple_instruction< opcode::dadd >, simple_instruction< opcode::isub >, simple_instruction< opcode::lsub >, simple_instruction< opcode::fsub >, simple_instruction< opcode::dsub >, simple_instruction< opcode::imul >, simple_instruction< opcode::lmul >, simple_instruction< opcode::fmul >, simple_instruction< opcode::dmul >, simple_instruction< opcode::idiv >, simple_instruction< opcode::ldiv >, simple_instruction< opcode::fdiv >, simple_instruction< opcode::ddiv >, simple_instruction< opcode::irem >, simple_instruction< opcode::lrem >, simple_instruction< opcode::frem >, simple_instruction< opcode::drem >, simple_instruction< opcode::ineg >, simple_instruction< opcode::lneg >, simple_instruction< opcode::fneg >, simple_instruction< opcode::dneg >, simple_instruction< opcode::ishl >, simple_instruction< opcode::lshl >, simple_instruction< opcode::ishr >, simple_instruction< opcode::lshr >, simple_instruction< opcode::iushr >, simple_instruction< opcode::lushr >, simple_instruction< opcode::iand >, simple_instruction< opcode::land >, simple_instruction< opcode::ior >, simple_instruction< opcode::lor >, simple_instruction< opcode::ixor >, simple_instruction< opcode::lxor >, iinc_instruction, simple_instruction< opcode::i2l >, simple_instruction< opcode::i2f >, simple_instruction< opcode::i2d >, simple_instruction< opcode::l2i >, simple_instruction< opcode::l2f >, simple_instruction< opcode::l2d >, simple_instruction< opcode::f2i >, simple_instruction< opcode::f2l >, simple_instruction< opcode::f2d >, simple_instruction< opcode::d2i >, simple_instruction< opcode::d2l >, simple_instruction< opcode::d2f >, simple_instruction< opcode::i2b >, simple_instruction< opcode::i2c >, simple_instruction< opcode::i2s >, simple_instruction< opcode::lcmp >, simple_instruction< opcode::fcmpl >, simple_instruction< opcode::fcmpg >, simple_instruction< opcode::dcmpl >, simple_instruction< opcode::dcmpg >, branch16_instruction< opcode::ifeq >, branch16_instruction< opcode::ifne >, branch16_instruction< opcode::iflt >, branch16_instruction< opcode::ifge >, branch16_instruction< opcode::ifgt >, branch16_instruction< opcode::ifle >, branch16_instruction< opcode::if_icmpeq >, branch16_instruction< opcode::if_icmpne >, branch16_instruction< opcode::if_icmplt >, branch16_instruction< opcode::if_icmpge >, branch16_instruction< opcode::if_icmpgt >, branch16_instruction< opcode::if_icmple >, branch16_instruction< opcode::if_acmpeq >, branch16_instruction< opcode::if_acmpne >, branch16_instruction< opcode::goto_ >, branch16_instruction< opcode::jsr >, local_instruction< opcode::ret >, tableswitch_instruction, lookupswitch_instruction, simple_instruction< opcode::ireturn >, simple_instruction< opcode::lreturn >, simple_instruction< opcode::freturn >, simple_instruction< opcode::dreturn >, simple_instruction< opcode::areturn >, simple_instruction< opcode::return_ >, constant_pool_index16_instruction< opcode::getstatic >, constant_pool_index16_instruction< opcode::putstatic >, constant_pool_index16_instruction< opcode::getfield >, constant_pool_index16_instruction< opcode::putfield >, constant_pool_index16_instruction< opcode::invokevirtual >, constant_pool_index16_instruction< opcode::invokespecial >, constant_pool_index16_instruction< opcode::invokestatic >, invokeinterface_instruction, invokedynamic_instruction, constant_pool_index16_instruction< opcode::new_ >, newarray_instruction, constant_pool_index16_instruction< opcode::anewarray >, simple_instruction< opcode::arraylength >, simple_instruction< opcode::athrow >, constant_pool_index16_instruction< opcode::checkcast >, constant_pool_index16_instruction< opcode::instanceof_ >, simple_instruction< opcode::monitorenter >, simple_instruction< opcode::monitorexit >, wide_instruction, multianewarray_instruction, branch16_instruction< opcode::ifnull >, branch16_instruction< opcode::ifnonnull >, branch32_instruction< opcode::goto_w >, branch32_instruction< opcode::jsr_w >, simple_instruction< opcode::breakpoint >, simple_instruction< opcode::impdep1 >, simple_instruction< opcode::impdep2 > > instruction
Every exact JVM instruction encoding supported by Java SE 26.
field_access_flags
JVM field access flags.
method_owner_kind
Selects the constant-pool owner kind for a symbolic method reference.
opcode
Every defined Java SE 26 opcode, plus the three permanently reserved opcodes.
std::variant< utf8_constant, integer_constant, float_constant, long_constant, double_constant, class_constant, string_constant, fieldref_constant, methodref_constant, interface_methodref_constant, name_and_type_constant, method_handle_constant, method_type_constant, dynamic_constant, invoke_dynamic_constant, module_constant, package_constant > constant_pool_entry
A typed JVM constant-pool entry.
class_access_flags
JVM class access flags.
std::variant< instruction, label_binding, labeled_branch_instruction< opcode::ifeq >, labeled_branch_instruction< opcode::ifne >, labeled_branch_instruction< opcode::iflt >, labeled_branch_instruction< opcode::ifge >, labeled_branch_instruction< opcode::ifgt >, labeled_branch_instruction< opcode::ifle >, labeled_branch_instruction< opcode::if_icmpeq >, labeled_branch_instruction< opcode::if_icmpne >, labeled_branch_instruction< opcode::if_icmplt >, labeled_branch_instruction< opcode::if_icmpge >, labeled_branch_instruction< opcode::if_icmpgt >, labeled_branch_instruction< opcode::if_icmple >, labeled_branch_instruction< opcode::if_acmpeq >, labeled_branch_instruction< opcode::if_acmpne >, labeled_branch_instruction< opcode::goto_ >, labeled_branch_instruction< opcode::jsr >, labeled_branch_instruction< opcode::ifnull >, labeled_branch_instruction< opcode::ifnonnull >, labeled_tableswitch_instruction, labeled_lookupswitch_instruction, symbolic_field_instruction< opcode::getstatic >, symbolic_field_instruction< opcode::putstatic >, symbolic_field_instruction< opcode::getfield >, symbolic_field_instruction< opcode::putfield >, symbolic_method_instruction< opcode::invokevirtual >, symbolic_method_instruction< opcode::invokespecial >, symbolic_method_instruction< opcode::invokestatic >, symbolic_invokeinterface_instruction, symbolic_class_instruction< opcode::new_ >, symbolic_class_instruction< opcode::anewarray >, symbolic_class_instruction< opcode::checkcast >, symbolic_class_instruction< opcode::instanceof_ >, symbolic_string_instruction > assembly_element
Every element accepted by code_builder before lowering.
method_access_flags
JVM method access 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.
A JVM class-file version pair.
An owning, typed representation of one JVM class file.
A fully typed Code attribute.
Method context needed to finalize symbolic code.
class_file_version version
Version of the class that will contain the method.
method_access_flags access_flags
Flags that determine the initial local frame.
method_descriptor descriptor
Parsed descriptor that determines parameters, return type, and slots.
std::string method_name
Method name used for constructor verification rules.
constant_pool_index super_class_index
Constant-pool index of its direct superclass, or zero for java/lang/Object.
constant_pool_index owner_class_index
Constant-pool index of the containing class.
code_build_options options
Analysis and metadata policy.
Controls automatic Code metadata generation.
std::optional< std::uint16_t > max_stack
Exact requested maximum, or no value to use the analyzed requirement.
bool generate_stack_map_table
Emit analyzed frames unless an exact table was supplied.
bool perform_dataflow_analysis
Compute stack/local requirements and verifier states.
processing_mode mode
Strictness used while encoding the assembled code.
std::optional< std::uint16_t > max_locals
Exact requested maximum, or no value to use the analyzed requirement.
A type-safe index into a JVM constant pool.
A JVM field_info structure.
A label binding in symbolic code.
label value
Label bound immediately before the following symbolic instruction.
Unique ownership token for labels created by one code_builder lineage.
std::uint64_t value
Process-local lineage identifier; clients must treat it as opaque.
A symbolic bytecode position owned by one code_builder.
label_owner owner
Builder lineage that created this label.
A branch whose target is a symbolic label.
label target
Symbolic branch destination owned by the containing builder.
A symbolic exception-table range.
label handler
First instruction of the handler.
label end
Exclusive protected-range end; may bind immediately after the final instruction.
label start
Inclusive protected-range start.
std::optional< std::string > catch_type
Internal exception class name, or no value for a catch-all handler.
A symbolic source line binding.
std::uint16_t line_number
Source-file line number.
label start
Instruction at which this source line begins.
A symbolic generic local-variable signature scope.
label start
Inclusive scope start.
std::string signature
Generic field signature for the local value.
label end
Exclusive scope end.
local_variable_index index
First local-variable-array slot occupied.
std::string name
Source variable name encoded into the constant pool.
A symbolic local-variable scope.
std::string descriptor
JVM field descriptor for the local value.
local_variable_index index
First local-variable-array slot occupied.
std::string name
Source variable name encoded into the constant pool.
label end
Exclusive scope end.
label start
Inclusive scope start.
One symbolic lookupswitch match and target.
std::int32_t match
Lookup key; pairs supplied to a builder must be strictly increasing.
label target
Symbolic destination for this key.
std::vector< labeled_lookup_switch_pair > pairs
Strictly increasing match/target pairs.
label default_target
Destination used when no pair matches.
std::int32_t low
Key corresponding to the first target.
label default_target
Destination for keys outside the table.
std::vector< label > targets
Consecutive targets beginning at low; must not be empty.
A JVM local-variable-array index.
A parsed JVM method descriptor.
A JVM method_info structure.
An instruction whose encoding contains only its opcode.
A StackMapTable attribute.
A symbolic class-reference instruction.
std::string internal_name
Slash-separated class name or array descriptor required by the opcode.
A symbolic field-access instruction.
std::string descriptor
JVM field descriptor.
std::string name
Field name.
std::string owner
Slash-separated declaring class internal name.
A symbolic interface-method invocation instruction.
std::string descriptor
JVM method descriptor used to derive the argument count.
std::string owner
Slash-separated declaring interface internal name.
std::string name
Interface method name.
A symbolic class or interface method invocation instruction.
std::string descriptor
JVM method descriptor.
std::string owner
Slash-separated declaring type internal name.
std::string name
Method name, including special JVM names where applicable.
method_owner_kind owner_kind
Constant-pool reference kind for the owner.
A symbolic string ldc instruction.
std::string value
Modified-UTF-8 string contents to intern and load.