JavaScript Intermediate Representation for Cross-Device Execution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Interpreted programming languages like JavaScript execute slowly at runtime due to interpretation, whereas compiled languages execute faster since they generate machine code beforehand, leading to a performance gap.

Innovation Solution

Converting JavaScript code into an intermediate representation, caching it, and generating device-specific machine code upon synchronization, allowing for pre-compilation and efficient execution on various devices.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of manufacture

If JavaScript code is executed by interpretation at runtime, then the code can be easily written and deployed, but the execution speed is slow

Engineering Contradiction:
ImproveEase of code deploymentVSAvoidExecution speed
Core Design Contradiction:
Ease of manufactureVSSpeed

Solution Approach 1:

The patent applies pre-compilation by converting JavaScript code into device-independent intermediate representation before runtime execution. This preliminary action transforms the code into an optimized form that can be efficiently executed on target devices, resolving the contradiction between ease of deployment and execution speed by preparing the code in advance without requiring full compilation to machine code.

Inventive Principle:
Principle #10Preliminary action

2Speed

If JavaScript code is precompiled to machine code, then execution speed improves, but the code becomes device-specific and less adaptable

Engineering Contradiction:
ImproveExecution speedVSAvoidDevice compatibility
Core Design Contradiction:
SpeedVSAdaptability or versatility

Solution Approach 1:

The patent introduces a device-independent intermediate representation as an intermediary between JavaScript source code and device-specific machine code. This intermediate form preserves execution speed benefits of pre-compilation while maintaining adaptability, as it can be efficiently executed on various devices without requiring full machine code compilation for each specific device architecture.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If device-specific machine code is generated for each device, then execution is optimized for that device, but the complexity of code management increases

Engineering Contradiction:
ImproveExecution efficiencyVSAvoidCode management complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent creates a universal device-independent intermediate representation that can serve multiple devices simultaneously. This single intermediate form can be executed on various device types without requiring separate machine code versions, reducing code management complexity while maintaining execution efficiency through pre-compilation optimization.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS8752016B2Converting JavaScript into a device-independent representation
Publication Date: 2014.06.10 APPLE INC
  • US8752016B2 patent drawing
  • US8752016B2 patent drawing
  • US8752016B2 patent drawing

AI summary

A device-independent intermediate representation of a source code is generated and stored, e.g., in a memory or other storage mechanism. The stored intermediate representation of the source code is used to generate a device-specific machine code corresponding to the source code. The stored intermediate representation may be updated, e.g., periodically, for example by obtaining an updated version of the source code and compiling the updated source code to generate an updated intermediate representation. The stored intermediate representation may be based on source code received from a device that is synchronized with which a compiling device that generates the device-specific machine code. In some cases, the stored intermediate representation may be used to generate for each of a plurality of devices a corresponding device-specific machine code.