Runtime State Based Code Re-Optimization

a runtime state and code technology, applied in the direction of source code generation, error detection/correction, instruments, etc., can solve the problems of requiring significant overhead to execute the runtime of dynamic language based code, preventing optimal compilation, and lack of type information

Inactive Publication Date: 2014-02-13
APPLE INC
View PDF29 Cites 22 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, runtime of dynamic language based code may require significant overhead to execute.
For example, lack of type information may prohibit optimal compilation to avoid dynamic type conversion for a variable.
Typical runtime profiling, however, relies on recording types of values encountered and requires complicated data structures and extensive profiling operations.
As a result, effectiveness of the compilation is adversely affected for overall performance improvement.
Further, when current runtime values encountered no longer match the previous profiling results, optimally compiled code based on the previous profiling results may cost more processing cycles to execute than a corresponding non-optimally compiled code.
Such discrepancies between current runtime values and previous profiling results can severely tax execution performance.
As a result, runtime performance may be degraded with the overhead incurred by data loading / updating through the interface layer.
Therefore, existing runtime compilation and execution for dynamically typed code tends to introduce performance cost which may be unnecessary, wasteful and avoidable.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Runtime State Based Code Re-Optimization
  • Runtime State Based Code Re-Optimization
  • Runtime State Based Code Re-Optimization

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0027]In the following description, numerous specific details are set forth to provide thorough explanation of embodiments of the present invention. It will be apparent, however, to one skilled in the art, that embodiments of the present invention may be practiced without these specific details. In other instances, well-known components, structures, and techniques have not been shown in detail in order not to obscure the understanding of this description.

[0028]Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the invention. The appearances of the phrase “in one embodiment” in various places in the specification do not necessarily all refer to the same embodiment.

[0029]The processes depicted in the figures that follow, are performed by processing logic that comprises hardware (e.g., circuitry, dedicated logic, etc....

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

A method and an apparatus to execute a code compiled from a source code to access an untyped variable are described. An optimized access code may be compiled in the code with speculative optimization via a type prediction of runtime value of the untyped variable. Invalidity of the type prediction may be dynamically detected for future runtime values of the untyped variable. The code may be updated with an access code compiled for the access without the speculative optimization based on the invalidity detection. The updated code can be executed for the access to the untyped variable without executing the optimized access code.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS[0001]This application is related to, and claims the benefits of U.S. Provisional Patent Application No. 61 / 681,530, filed Aug. 9, 2012, entitled “DYNAMIC CODE OPTIMIZATION”, by Filip Pizlo et al., which is hereby incorporated by reference herein in its entirety.FIELD OF INVENTION[0002]The present invention relates generally to optimized runtime compilation. More particularly, this invention relates to timely re-optimization of dynamic language based code based on runtime state.BACKGROUND[0003]Dynamic languages that lack type annotations of any kind are increasingly popular. For example, JavaScript has become the lingua franca of the World Wide Web, while Ruby, Python, Perl, and PHP have become standard languages for server-side infrastructure. However, runtime of dynamic language based code may require significant overhead to execute.[0004]For example, lack of type information may prohibit optimal compilation to avoid dynamic type conversion f...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(United States)
IPC IPC(8): G06F9/45
CPCG06F8/443G06F11/3409G06F11/3466G06F2201/865G06F2201/88G06F8/31G06F8/315G06F8/437G06F11/3452
Inventor PIZLO, FILIP J.BARRACLOUGH, GAVIN
Owner APPLE INC
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products