Tracing JIT WASM Compiler for WebAssembly Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The overhead of Ahead-of-Time (AoT) compilation and translation of WebAssembly (WASM) code into native machine code burdens testing and debugging of WebAssembly applications, consuming additional computing time and resources.

Innovation Solution

A tracing JIT WASM compiler operates under the control of an interpreter to generate WebAssembly code for frequently-executed interpreter bytecodes, compiling them into a compact format that executes faster than interpreted opcodes, while maintaining a mixed-mode of execution.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If Ahead-of-Time (AoT) compilation is used to translate computer programs into WASM code, then the WASM executable can run fast in production environments, but the build and compilation phases consume additional computing time and resources that impede testing and debugging

Engineering Contradiction:
Improveexecution speedVSAvoidbuild and compilation time
Core Design Contradiction:
SpeedVSLoss of time

Solution Approach 1:

The system dynamically switches between interpreting and compiling execution modes based on runtime conditions. The interpreter can transition to JIT compilation when performance optimization is needed, and back to interpretation for rapid testing and debugging, making the execution model adaptive rather than static

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The execution process is segmented into two distinct paths: interpretation mode for rapid development and testing, and JIT compilation mode for production performance. This segmentation allows each mode to be optimized independently without compromising the other

Inventive Principle:
Principle #1Segmentation

2Speed

If all opcodes are compiled into WASM code, then execution speed is maximized, but the complexity of the compiler and the difficulty of debugging increase

Engineering Contradiction:
Improveexecution speedVSAvoidcompiler complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

Instead of uniformly compiling the entire program, the system applies compilation selectively to specific hot paths and frequently executed opcodes. This local optimization approach compiles only what is necessary for performance while keeping the overall system simpler and more manageable

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The system performs partial compilation of only the most critical code sections rather than complete compilation. This partial action achieves sufficient performance improvement without the excessive complexity of compiling everything, allowing for easier debugging and simpler compiler design

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS12333319B2Tracing just-in-time WASM compiler
Publication Date: 2025.06.17 MICROSOFT TECHNOLOGY LICENSING LLC
  • US12333319B2 patent drawing
  • US12333319B2 patent drawing
  • US12333319B2 patent drawing

AI summary

An interpreter interacts with a tracing Just-In-Time (JIT) WebAssembly (WASM) compiler to compile frequently-executed interpreter opcodes into WASM code. The interpreter monitors the frequency of the execution of targeted locations of the interpreter opcodes of a web application to determine the most frequently executed linear sequences of the interpreter opcodes. The execution of the WASM code is monitored for execution failure before replacing the linear sequence of opcodes with an entry point opcode that immediately executes the WASM code without monitoring the execution failure of the WASM code.