# US 11,030,105 B2 · Variable handles

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,030,105 B2
- Document ID: US11030105B2
- Status: Granted
- Kind: B2
- Application number: 14/681,003
- Filed: 2015-04-07
- Published: 2016-01-14
- Granted: 2021-06-08
- Earliest claimed: 2014-07-14
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Paul Sandoz; Brian Goetz; John Robert Rose
- Web page: https://patentgrep.com/patent/US11030105B2

## CPC

- G06F 12/0875: with dedicated cache, e.g. instruction or stack
- G06F 3/0622: {in relation to access}
- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 3/0671: {In-line storage system}
- G06F 9/30145: {Instruction analysis, e.g. decoding, instruction word fields}
- G06F 9/45504: {Abstract machines for program code execution, e.g. Java virtual machine [JVM], interpreters or emulators}
- G06F 12/1458: {by checking the subject access rights}
- G06F 2212/1052: Security improvement
- G06F 2212/452: Instruction code
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

According to one technique, a virtual machine generates an object configured to provide secure access to memory through one or more memory fencing operations. Through the object, the virtual machine receives a call that indicates a memory location and specifies a particular memory fencing operation of the one or more memory fencing operations to perform with respect to the memory location. The virtual machine causes performance of the particular memory fencing operation with respect to the memory location.

## Claims

### Claim 1

A method comprising:
generating a first receiver configured to provide secure access to memory that represents a first variable type through a plurality of distinct memory fencing operations;
generating a second receiver configured to provide secure access to memory that represents a second variable type through the plurality of distinct memory fencing operations, wherein the first variable type is not the second variable type;
a particular receiver receiving a call to a function that specifies a particular memory fencing operation of the plurality of distinct memory fencing operations to perform with respect to a memory location, wherein the function has a signature that is polymorphic to indicate that the function can return all types and accept all numbers and types of arguments, wherein the particular receiver is:
selected from the group consisting of the first receiver and the second receiver, and
related to a class that declares the plurality of distinct memory fencing operations for a plurality of different variable types, but without including an implementation of the plurality of distinct memory fencing operations for at least one particular variable type of the plurality of different variable types;
the particular receiver causing, responsive to receiving said call, performance of the particular memory fencing operation with respect to the memory location; and
wherein the method is performed by one or more processors.

### Claim 2 (depends on 1)

The method of claim 1, wherein the class includes an implementation of at least one of the plurality of distinct memory fencing operations for a variable that refers to an unmanaged memory location.

### Claim 3 (depends on 1)

The method of claim 1, wherein the particular receiver is an instance of a sub-class that extends from the class and implements the plurality of distinct memory fencing operations with respect to a particular variable type of the plurality of different variable types.

### Claim 4 (depends on 1)

The method of claim 1, wherein
the particular receiver is an instance of the class and contains a reference to the memory location.

### Claim 5 (depends on 4)

The method of claim 4, wherein either the first variable type or the second variable type is long integer.

### Claim 6 (depends on 1)

The method of claim 1, wherein generating the particular receiver binds the particular receiver to a first variable type, wherein the call specifies to access the memory location to perform the particular memory fencing operation based on a second variable type, and the method further comprising:
determining whether the first variable type matches the second variable type, wherein causing performance of the particular memory fencing operation with respect to the memory location is performed in response to determining that the first variable type matches the second variable type;
in response to determining that the first variable type does not match the second variable type performing one or more selected from the group consisting of: generating an error and conforming the first variable type to the second variable type then causing performance of the particular memory fencing operation with respect to the memory location.

### Claim 7 (depends on 1)

The method claim 1, wherein generating the particular receiver comprises performing a check to determine whether access to the memory location is permissible, and the method further comprising receiving multiple calls through the particular receiver to perform memory fencing operations without repeating the check.

### Claim 8 (depends on 1)

The method claim 1, wherein the particular memory fencing operation is performed by at least issuing one or more memory barrier instructions natively supported by the one or more processors in addition to one or more load or store instructions to the memory location.

### Claim 9 (depends on 8)

The method of claim 8, wherein the particular memory fencing operation is performed by combining two or more of the one or more memory barrier instructions natively supported by the one or more processors.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
receiving a second call through the particular receiver that specifies a second memory fencing operation that is different than the particular memory fencing operation to perform with respect to the memory location; and
causing performance of the second memory fencing operation with respect to the memory location.

### Claim 11 (depends on 1)

The method of claim 1, wherein causing performance of the particular memory fencing operation involves invoking code associated with the particular receiver that performs one or more safety checks including determining whether an array index passed into the call is valid.

### Claim 12 (depends on 1)

The method of claim 1, wherein the particular memory fencing operation includes one or more selected from the group consisting of: volatile read and volatile write.

### Claim 13 (depends on 1)

The method of claim 1 further comprising reading and writing the memory location in a same bus operation.

### Claim 14 (depends on 1)

The method of claim 1, wherein:
the particular memory fencing operation comprises one selected from the group consisting of an atomic write and an atomic update;
the method further includes accessing the memory location by a same thread as the particular memory fencing operation.

### Claim 15 (depends on 1)

The method of claim 1, wherein the particular memory fencing operation includes one or more native instructions selected from the group consisting of: volatile read, volatile write, atomic read, atomic write, and atomic update.

### Claim 16 (depends on 1)

The method of claim 1 wherein the particular receiver is selected from the group consisting of a data type and an instance of the data type.

### Claim 17

A non-transitory computer-readable storage medium storing one or more instructions which, when executed by one or more processors, cause:
generating a first receiver configured to provide secure access to memory that represents a first variable type through a plurality of distinct memory fencing operations;
generating a second receiver configured to provide secure access to memory that represents a second variable type through the plurality of distinct memory fencing operations, wherein the first variable type is not the second variable type;
a particular receiver receiving a call to a function that specifies a particular memory fencing operation of the plurality of distinct memory fencing operations to perform with respect to a memory location, wherein the function has a signature that is polymorphic to indicate that the function can return all types and accept all numbers and types of arguments, wherein the particular receiver is:
selected from the group consisting of the first receiver and the second receiver, and
related to a class that declares the plurality of distinct memory fencing operations for a plurality of different variable types, but without including an implementation of the plurality of distinct memory fencing operations for at least one particular variable type of the plurality of different variable types;
the particular receiver causing, responsive to receiving said call, performance of the particular memory fencing operation with respect to the memory location.

### Claim 18 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein the class includes an implementation of at least one of the plurality of distinct memory fencing operations for a variable that refers to an unmanaged memory location.

### Claim 19 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein the particular receiver is an instance of a sub-class that extends from the class and implements the plurality of distinct memory fencing operations with respect to a particular variable type of the plurality of different variable types.

### Claim 20 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein
the particular receiver is an instance of the class and contains a reference to the memory location.

### Claim 21 (depends on 20)

The non-transitory computer-readable storage medium of claim 20, wherein either the first variable type or the second variable type is long integer.

### Claim 22 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein generating the particular receiver binds the particular receiver to a first variable type, wherein the call specifies to access the memory location to perform the particular memory fencing operation based on a second variable type, wherein the one or more instructions further cause:
determining whether the first variable type matches the second variable type, wherein causing performance of the particular memory fencing operation with respect to the memory location is performed in response to determining that the first variable type matches the second variable type;
in response to determining that the first variable type does not match the second variable type performing one or more selected from the group consisting of: generating an error and conforming the first variable type to the second variable type then causing performance of the particular memory fencing operation with respect to the memory location.

### Claim 23 (depends on 17)

The non-transitory computer-readable storage medium claim 17, wherein generating the particular receiver comprises performing a check to determine whether access to the memory location is permissible, and the one or more instructions further cause receiving multiple calls through the particular receiver to perform memory fencing operations without repeating the check.

### Claim 24 (depends on 17)

The non-transitory computer-readable storage medium claim 17, wherein the particular memory fencing operation is performed by at least issuing one or more memory barrier instructions natively supported by the one or more processors in addition to one or more load or store instructions to the memory location.

### Claim 25 (depends on 24)

The non-transitory computer-readable storage medium of claim 24, wherein the particular memory fencing operation is performed by combining two or more of the one or more memory barrier instructions natively supported by the one or more processors.

### Claim 26 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein the one or more instructions further cause:
receiving a second call through the particular receiver that specifies a second memory fencing operation that is different than the particular memory fencing operation to perform with respect to the memory location; and
causing performance of the second memory fencing operation with respect to the memory location.

### Claim 27 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein causing performance of the particular memory fencing operation involves invoking code associated with the particular receiver that performs one or more safety checks including determining whether an array index passed into the call is valid.

### Claim 28 (depends on 17)

The non-transitory computer-readable storage medium of claim 17, wherein the particular memory fencing operation includes one or more selected from the group consisting of: volatile read and volatile write.
