IP Library › Granted Patent US 10,719,362
Granted Patent B2
US 10,719,362 · App. 16/156,711 · Granted Jul 21, 2020

Managing multiple isolated execution contexts in a single process

Inventors: Christian Wimmer (Belmont, CA); Peter Hofer (Linz, AT); Vojin Jovanovic (Zurich, CH); Oleg A. Pliss (Santa Clara, CA)
Assignee: Oracle International Corporation
G06F9/5016G06F9/4843G06F9/5066
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,719,362
App. No.
16/156,711
Granted
Jul 21, 2020
Kind
B2
Abstract

A method may include generating, for a host application, an image including an image heap including objects and a writeable object partition including a subset of the objects. The method may further include initializing, by executing the image in a process of a computer system, a first isolate including a first address space and a first read-only map of the image heap. The first read-only map may designate the writeable object partition of the image heap as copy-on-write. The method may further include initializing, by executing the image in the process, a second isolate including a second address space and a second read-only map of the image heap. The method may further include performing, in the first isolate and using the first read-only map, a first task that accesses an object, and performing, in the second isolate and using the second read-only map, a second task that accesses the object.

Claims (112)

1. A method, comprising:

generating, for a host application, an image comprising an image heap comprising:

a plurality of objects, and

a writeable object partition comprising a first subset of the plurality of objects;

initializing, by executing the image in a process of a computer system, a first isolate comprising a first address space and a first read-only map of the image heap, wherein the first read-only map designates the writeable object partition of the image heap as copy-on-write;

initializing, by executing the image in the process, a second isolate comprising a second address space and a second read-only map of the image heap, wherein the second read-only map designates the writeable object partition of the image heap as copy-on-write;

performing, in the first isolate and using the first read-only map, a first task that accesses a first object of the plurality of objects; and

performing, in the second isolate and using the second read-only map, a second task that accesses the first object.

2. The method of claim 1 , further comprising:

encoding, in the image heap, each reference to the first object as an offset relative to a start address of the image heap;

prior to accessing the reference in the first isolate, adding the offset to a first base address of the image heap in the first address space; and

prior to accessing the reference in the second isolate, adding the offset to a second base address of the image heap in the second address space.

3. The method of claim 2 ,

wherein the computer system comprises an image heap base register,

wherein generating the first isolate comprises setting the value of the image heap base register to the first base address,

wherein adding the offset to the first base address comprises adding the offset to the value of the image heap base register in the first isolate,

wherein generating the second isolate comprises setting the value of the image heap base register to the second base address, and

wherein adding the offset to the second base address comprises adding the offset to the value of the image heap base register in the second isolate.

4. The method of claim 2 ,

wherein the reference to the first object is a compressed reference comprising a number of bits that is smaller than a word size of the computer system, and

wherein encoding the reference comprises shifting the bits of the reference by a predetermined number of bits based on an object allocation boundary of the computer system.

5. The method of claim 1 , wherein the image further comprises compiled code, and wherein generating the image comprises:

identifying, for the host application, reachable functions and reachable objects;

compiling the reachable functions into the compiled code; and

allocating the image heap by serializing the reachable objects.

6. The method of claim 1 , further comprising:

modifying the first object in the first isolate,

wherein the first object is in the writeable object partition of the image heap, and

wherein the modification to the first object is inaccessible to the second isolate.

7. The method of claim 1 ,

wherein the image further comprises compiled code,

wherein the image heap further comprises a code reference partition comprising a plurality of code references to the compiled code, wherein each of the plurality of code references accesses a function, and

wherein generating the first isolate further comprises:

determining that a code reference of the plurality of code references requires adjustment; and

in response to determining that the code reference requires adjustment, adjusting the code reference.

8. The method of claim 7 ,

wherein determining that the code reference requires adjustment comprises:

obtaining, from the first read-only image heap map, a first value of the code reference from the code reference partition of the image heap;

locating, within a memory of the computer system, the code reference partition of the image heap loaded by an operating system of the computer system;

obtaining a second value of the code reference from the code reference partition loaded by the operating system; and

determining that the first value and the second value are different, and

wherein adjusting the code reference comprises setting the value of the code reference in the first read-only image heap map to the second value.

9. A system, comprising:

a memory coupled to a processor;

a host application;

a process executing on the processor and using the memory, comprising:

an image comprising an image heap comprising:

a plurality of objects, and

a writeable object partition comprising a first subset of the plurality of objects,

a first isolate comprising a first address space and a first read-only map of the image heap, wherein the first read-only map designates the writeable object partition of the image heap as copy-on-write, wherein the first isolate is configured to perform, using the first read-only map, a first task that accesses a first object of the plurality of objects, and

a second isolate comprising a second address space and a second read-only map of the image heap, wherein the second read-only map designates the writeable object partition of the image heap as copy-on-write, wherein the second isolate is configured to perform, using the second read-only map, a second task that accesses the first object; and

an image/isolate manager, executing on the processor and using the memory, configured to:

generate the image for the host application; and

initialize, by executing the image in the process, the first isolate and the second isolate.

10. The system of claim 9 , wherein the image/isolate manager is further configured to:

encode, in the image heap, each reference to the first object as an offset relative to a start address of the image heap;

prior to accessing the reference in the first isolate, add the offset to a first base address of the image heap in the first address space; and

prior to accessing the reference in the second isolate, add the offset to a second base address of the image heap in the second address space.

11. The system of claim 10 ,

wherein the processor comprises an image heap base register,

wherein generating the first isolate comprises setting the value of the image heap base register to the first base address,

wherein adding the offset to the first base address comprises adding the offset to the value of the image heap base register in the first isolate,

wherein generating the second isolate comprises setting the value of the image heap base register to the second base address, and

wherein adding the offset to the second base address comprises adding the offset to the value of the image heap base register in the second isolate.

12. The system of claim 10 ,

wherein the reference to the first object is a compressed reference comprising a number of bits that is smaller than a word size of the system, and

wherein encoding the reference comprises shifting the bits of the reference by a predetermined number of bits based on an object allocation boundary of the system.

13. The system of claim 9 , further comprising a compiler executing on the processor and using the memory,

wherein the image further comprises compiled code,

wherein the image/isolate manager is further configured to:

identify, for the host application, reachable functions and reachable objects; and

allocate the image heap by serializing the reachable objects, and

wherein the compiler is configured to compile the reachable functions into the compiled code.

14. The system of claim 9 , wherein the image/isolate manager is further configured to:

modify the first object in the first isolate,

wherein the first object is in the writeable object partition of the image heap, and

wherein the modification to the first object is inaccessible to the second isolate.

15. The system of claim 9 ,

wherein the image further comprises compiled code,

wherein the image heap further comprises a code reference partition comprising a plurality of code references to the compiled code, wherein each of the plurality of code references accesses a function, and

wherein generating the first isolate further comprises:

determining that a code reference of the plurality of code references requires adjustment; and

in response to determining that the code reference requires adjustment, adjusting the code reference.

16. The system of claim 15 , further comprising an operating system executing on the processor and using the memory,

wherein the operating system is configured to load, into the memory, the code reference partition of the image heap,

wherein determining that the code reference requires adjustment comprises:

obtaining, from the first read-only image heap map, a first value of the code reference from the code reference partition of the image heap;

locating, within the memory, the code reference partition of the image heap loaded by the operating system;

obtaining a second value of the code reference from the code reference partition loaded by the operating system; and

determining that the first value and the second value are different, and

wherein adjusting the code reference comprises setting the value of the code reference in the first read-only image heap map to the second value.

17. A non-transitory computer readable medium comprising instructions that, when executed by a processor, perform:

generating, for a host application, an image comprising an image heap comprising:

a plurality of objects, and

a writeable object partition comprising a first subset of the plurality of objects;

initializing, by executing the image in a process of a computer system, a first isolate comprising a first address space and a first read-only map of the image heap, wherein the first read-only map designates the writeable object partition of the image heap as copy-on-write;

initializing, by executing the image in the process, a second isolate comprising a second address space and a second read-only map of the image heap, wherein the second read-only map designates the writeable object partition of the image heap as copy-on-write;

performing, in the first isolate and using the first read-only map, a first task that accesses a first object of the plurality of objects; and

performing, in the second isolate and using the second read-only map, a second task that accesses the first object.

18. The non-transitory computer readable medium of claim 17 , further comprising instructions that perform:

encoding, in the image heap, each reference to the first object as an offset relative to a start address of the image heap;

prior to accessing the reference in the first isolate, adding the offset to a first base address of the image heap in the first address space; and

prior to accessing the reference in the second isolate, adding the offset to a second base address of the image heap in the second address space.

19. The non-transitory computer readable medium of claim 18 ,

wherein the computer system comprises an image heap base register,

wherein generating the first isolate comprises setting the value of the image heap base register to the first base address,

wherein adding the offset to the first base address comprises adding the offset to the value of the image heap base register in the first isolate,

wherein generating the second isolate comprises setting the value of the image heap base register to the second base address, and

wherein adding the offset to the second base address comprises adding the offset to the value of the image heap base register in the second isolate.

20. The non-transitory computer readable medium of claim 18 ,

wherein the reference to the first object is a compressed reference comprising a number of bits that is smaller than a word size of the computer system, and

wherein encoding the reference comprises shifting the bits of the reference by a predetermined number of bits based on an object allocation boundary of the computer system.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 11, 2018
From: WIMMER, CHRISTIAN; HOFER, PETER; JOVANOVIC, VOJIN; PLISS, OLEG A.
To: ORACLE INTERNATIONAL CORPORATION
Reel/Frame 047138/0543 →
Continuity (1)
Related Publication 20200117509A1 · Apr 16, 2020