Static Compilation Metadata Mapping for Dynamic Behavior
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current computer programming environments face challenges in balancing dynamic and static features, particularly in supporting reflection without relying on Just-in-time (JIT) compilation and reducing runtime requirements, especially in resource-constrained devices like smartphones and tablets.
Innovation Solution
The approach involves static ahead-of-time compilation that generates metadata mappings and trampoline code to support dynamic behavior in a reduced runtime environment, distinguishing between metadata for inspection and method invocation, and using directives to manage runtime behavior characteristics, thereby eliminating the need for JIT compilation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If JIT compilation is used to support dynamic behavior, then dynamic features such as reflection and dynamic dispatch are enabled, but runtime size and complexity increase
Solution Approach 1:
The patent extracts dynamic behavior support from the runtime environment and relocates it to compile-time processing. Specifically, dynamic dispatch tables and type information are generated during ahead-of-time compilation rather than being provided by the runtime, thereby reducing runtime complexity while maintaining dynamic features
Solution Approach 2:
The patent performs preliminary generation of dynamic dispatch tables and type metadata during ahead-of-time compilation. This preliminary action prepares all necessary dynamic behavior information before execution, eliminating the need for complex runtime compilation mechanisms
2Adaptability or versatility
If JIT compilation is used to support dynamic behavior, then flexibility and power are provided, but runtime size increases
Solution Approach 1:
The patent extracts dynamic behavior support from the runtime environment and relocates it to compile-time processing. Specifically, dynamic dispatch tables and type information are generated during ahead-of-time compilation rather than being provided by the runtime, thereby reducing runtime complexity while maintaining dynamic features
Solution Approach 2:
The patent performs preliminary generation of dynamic dispatch tables and type metadata during ahead-of-time compilation. This preliminary action prepares all necessary dynamic behavior information before execution, eliminating the need for complex runtime compilation mechanisms
3Quantity of substance
If static compilation is used, then runtime size is reduced, but dynamic behavior support is limited
Solution Approach 1:
The patent performs preliminary generation of dynamic dispatch tables and type metadata during ahead-of-time compilation. This preliminary action prepares all necessary dynamic behavior information before execution, eliminating the need for complex runtime compilation mechanisms
Solution Approach 2:
The patent introduces dynamic dispatch tables as an intermediary data structure that bridges static compilation and dynamic behavior. These tables contain pre-computed type information and method resolutions that enable dynamic dispatch without requiring JIT compilation or large runtime support
4Adaptability or versatility
If reflection metadata is included for all types, then complete introspection is enabled, but processing workload and memory usage increase
Solution Approach 1:
The patent applies local quality by making reflection metadata availability type-specific rather than universal. The compiler analyzes each type and includes reflection metadata only for types that are actually reflected upon at runtime, using heuristics based on type usage patterns, namespace characteristics, and explicit annotations
Solution Approach 2:
The patent implements partial action by selectively including reflection metadata for only the subset of types that require introspection. This partial inclusion reduces processing workload and memory usage while maintaining complete introspection capability for the necessary types
Data Source
Figure 1~2
Figure 3~5
Figure 6
AI summary
Support for dynamic behavior is provided during static compilation while reducing reliance on JIT compilation and large runtimes. A mapping is created between metadata and native code runtime artifacts, such as between type definition metadata and a runtime type description, or between method definition metadata, a runtime type description, and a native code method location, or field definition metadata, a runtime type description, and a field location. A mapping between runtime artifacts may also be created. Some compilation results include trampoline code to support a reflection invocation of an artifact in the reduced runtime support environment, for virtual method calls, call-time bounds checking, calling convention conversion, or compiler-intrinsic methods. Some results support runtime diagnostics by including certain metadata even when full dynamic behavior is not supported.