Hardware Verification of Dynamically Generated Code

    公开(公告)号:US20220137968A1

    公开(公告)日:2022-05-05

    申请号:US17348565

    申请日:2021-06-15

    Applicant: Apple Inc.

    Abstract: In an embodiment, dynamically-generated code may be supported in the system by ensuring that the code either remains executing within a predefined region of memory or exits to one of a set of valid exit addresses. Software embodiments are described in which the dynamically-generated code is scanned prior to permitting execution of the dynamically-generated code to ensure that various criteria are met including exclusion of certain disallowed instructions and control of branch target addresses. Hardware embodiments are described in which the dynamically-generated code is permitted to executed but is monitored to ensure that the execution criteria are met.

    Geometric 64-bit capability pointer

    公开(公告)号:US10713021B2

    公开(公告)日:2020-07-14

    申请号:US16147336

    申请日:2018-09-28

    Applicant: Apple Inc.

    Abstract: One embodiment provides for a computer-implemented method comprising receiving a request to compile a set of program instructions coded in a high-level language, the set of program instructions including a pointer to a virtual memory address, the pointer having a pointer encoding including a base address and a length; while compiling the set of program instructions, decoding the base address and length from the pointer, wherein the base address specifies a first boundary for a memory allocation, the length defines a second boundary for the memory allocation and the length is an encoding of a size of the memory allocation; and generating a set of compiled instructions which, when executed, enable access to a physical address associated with a virtual address between the first boundary and the second boundary.

    Concurrent accesses of dynamically typed object data
    13.
    发明授权
    Concurrent accesses of dynamically typed object data 有权
    动态类型对象数据的并发访问

    公开(公告)号:US09501409B2

    公开(公告)日:2016-11-22

    申请号:US14231464

    申请日:2014-03-31

    Applicant: Apple Inc.

    Inventor: Filip J. Pizlo

    Abstract: A method and an apparatus for an enhanced object model to allow concurrent execution for program code generated from dynamic programming languages, such as JavaScript, are described. An index structure may be introduced to an object model representing a dynamically typed object in addition to a type structure and a data payload storing property or field values of the object. Elements of the index structure may point at corresponding property values as an indirection for accessing the object.

    Abstract translation: 描述了用于允许从动态编程语言(例如JavaScript)生成的程序代码的并发执行的增强对象模型的方法和装置。 索引结构可以被引入到表示动态类型对象的对象模型,除了类型结构和数据有效载荷存储对象的属性或字段值之外。 索引结构的元素可以指向相应的属性值作为访问对象的间接。

    Runtime state based code re-optimization

    公开(公告)号:US11016743B2

    公开(公告)日:2021-05-25

    申请号:US15073500

    申请日:2016-03-17

    Applicant: Apple Inc.

    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.

    GEOMETRIC 64-BIT CAPABILITY POINTER
    16.
    发明申请

    公开(公告)号:US20190272159A1

    公开(公告)日:2019-09-05

    申请号:US16147336

    申请日:2018-09-28

    Applicant: Apple Inc.

    Abstract: One embodiment provides for a computer-implemented method comprising receiving a request to compile a set of program instructions coded in a high-level language, the set of program instructions including a pointer to a virtual memory address, the pointer having a pointer encoding including a base address and a length; while compiling the set of program instructions, decoding the base address and length from the pointer, wherein the base address specifies a first boundary for a memory allocation, the length defines a second boundary for the memory allocation and the length is an encoding of a size of the memory allocation; and generating a set of compiled instructions which, when executed, enable access to a physical address associated with a virtual address between the first boundary and the second boundary.

    RUNTIME STATE BASED CODE RE-OPTIMIZATION
    17.
    发明申请
    RUNTIME STATE BASED CODE RE-OPTIMIZATION 审中-公开
    基于运行状态的代码重新优化

    公开(公告)号:US20160321046A1

    公开(公告)日:2016-11-03

    申请号:US15073500

    申请日:2016-03-17

    Applicant: Apple Inc.

    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.

    Abstract translation: 描述了执行从源代码编译的代码以访问无类型变量的方法和装置。 优化的访问代码可以通过对类型预测的无类型变量的运行时值的推测优化来编译在代码中。 可以动态地检测类型预测的无效性,用于未类型化变量的未来运行时值。 可以使用针对访问编译的访问代码更新代码,而无需基于无效性检测的推测优化。 可以执行更新的代码来访问无类型的变量,而不执行优化的访问代码。

    Concurrent inline cache optimization in accessing dynamically typed objects
    18.
    发明授权
    Concurrent inline cache optimization in accessing dynamically typed objects 有权
    访问动态类型对象的同时内联缓存优化

    公开(公告)号:US09251071B2

    公开(公告)日:2016-02-02

    申请号:US14096912

    申请日:2013-12-04

    Applicant: Apple Inc.

    Inventor: Filip J. Pizlo

    Abstract: A method and an apparatus for concurrent accessing of dynamically type objects based on inline cache code are described. Inline cache initialization in a single thread may be off loaded to an interpreter without incurring unnecessary synchronization overhead. A thread bias mechanism may be provided to detect whether a code block is executed in a single thread. Further, the number of inline cache initializations performed via a compiler, such as baseline JIT compiler, can be reduced to improve processing performance.

    Abstract translation: 描述了一种基于内联高速缓存代码并行访问动态类型对象的方法和装置。 单线程中的内联缓存初始化可能会被卸载到解释器,而不会引起不必要的同步开销。 可以提供线偏置机构来检测在单个线程中是否执行代码块。 此外,可以减少通过编译器(如基准JIT编译器)执行的内联高速缓存初始化的数量,以提高处理性能。

    CONCURRENT INLINE CACHE OPTIMIZATION IN ACCESSING DYNAMICALLY TYPED OBJECTS
    19.
    发明申请
    CONCURRENT INLINE CACHE OPTIMIZATION IN ACCESSING DYNAMICALLY TYPED OBJECTS 有权
    访问动态类型对象的同步快速入门优化

    公开(公告)号:US20150067267A1

    公开(公告)日:2015-03-05

    申请号:US14096912

    申请日:2013-12-04

    Applicant: Apple Inc.

    Inventor: Filip J. Pizlo

    Abstract: A method and an apparatus for concurrent accessing of dynamically type objects based on inline cache code are described. Inline cache initialization in a single thread may be off loaded to an interpreter without incurring unnecessary synchronization overhead. A thread bias mechanism may be provided to detect whether a code block is executed in a single thread. Further, the number of inline cache initializations performed via a compiler, such as baseline JIT compiler, can be reduced to improve processing performance.

    Abstract translation: 描述了一种基于内联高速缓存代码并行访问动态类型对象的方法和装置。 单线程中的内联缓存初始化可能会被卸载到解释器,而不会引起不必要的同步开销。 可以提供线偏置机构来检测在单个线程中是否执行代码块。 此外,可以减少通过编译器(如基线JIT编译器)执行的内联高速缓存初始化的数量,以提高处理性能。

    Verifiable machine code
    20.
    发明授权

    公开(公告)号:US12259978B2

    公开(公告)日:2025-03-25

    申请号:US17694002

    申请日:2022-03-14

    Applicant: Apple Inc.

    Inventor: Filip J. Pizlo

    Abstract: Aspects and features include a structure for a program directed to a target computing device and metadata that can be used by a verifier in the target computing device. The verifier can quickly and efficiently apply verification rules to identified sections of the program to determine whether the program is safe to execute by the target computing device. In some examples, the target computing device uses the verifier to identify, using the metadata, verifiable sections of instructions that violate execution safety policies. The verifier can apply verification rules to the verifiable sections to determine whether to execute each verifiable section despite instructions in the verifiable section violating execution safety policies. The program and the metadata can be generated, as an example, by a compiler from source code, and transmitted or otherwise distributed to target computing devices.

Patent Agency Ranking