Interface MpTypedAccessGen
- All Superinterfaces:
TypedAccessGen
- All Known Implementing Classes:
MpIntReadGen,MpIntWriteGen
This depends on the generator for single integer types. Each will need to work out how to compose the leg generator given the stack ordering, byte order, and read/write operation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateCode(JitCodeGenerator gen, Varnode vn, org.objectweb.asm.MethodVisitor rv) Emit code to access a varnode.Get a generator for individual legs of this multi-precision access generator
-
Method Details
-
getLegGen
ExportsLegAccessGen getLegGen()Get a generator for individual legs of this multi-precision access generator- Returns:
- the leg generator
-
generateCode
Emit code to access a varnode.If reading, the result is placed on the JVM stack. If writing, the value is popped from the JVM stack.
If the varnode fits completely in the block (the common case), then this accesses the bytes from the one block, using the method chosen by size. If the varnode extends into the next block, then this will split the varnode into two portions according to machine byte order. Each portion is accessed using the method for the size of that portion. If reading, the results are reassembled into a single value and pushed onto the JVM stack.
This uses several JVM stack entries. The varnode must be too large to fit in a single JVM primitive, or else it does not require "multi-precision" handling. A leg that spans blocks is handled as in
ExportsLegAccessGen.generateMpCodeLeg(JitCodeGenerator, AddressSpace, long, int, int, MethodVisitor). The legs are ordered on the stack such that the least significant portion is on top.- Specified by:
generateCodein interfaceTypedAccessGen- Parameters:
gen- the code generatorvn- the varnoderv- the method visitor
-