US 12,086,574 B1
Techniques to convert bytecode generated for a first execution environment to machine code for a second execution environment
Valere Joseph Vanderschaegen, Sequim, WA (US); Scott Henry, Minneapolis, MN (US); Scott Atkins, Lino Lakes, MN (US); John Sebastian Lyon-Smith, Kingston, WA (US); and Ryan Peters, Calgary (CA)
Assigned to Amazon Technologies, Inc., Seattle, WA (US)
Filed by Amazon Technologies, Inc., Seattle, WA (US)
Filed on Oct. 28, 2021, as Appl. No. 17/513,502.
Int. Cl. G06F 8/41 (2018.01); G06F 8/30 (2018.01)
CPC G06F 8/427 (2013.01) [G06F 8/315 (2013.01); G06F 8/434 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A computer-implemented method, comprising:
obtaining a bytecode file comprising a set of instructions that are executable in a first execution environment comprising a virtual machine;
parsing the bytecode file to determine a stack-based class object, wherein the stack-based class object comprises one or more non-static class variables and at least one class method;
determining, based on the one or more non-static class variables, a first portion of intermediate representation (IR) code that defines a data layout for an IR-based representation of the stack-based class object;
determining, based on the at least one class method, a second portion of the IR code that dereferences a pointer to an instance of the IR-based representation of the stack-based class object;
determining a second execution environment; and
translating, using an IR compiler, the IR code into machine code that is executable in the second execution environment.