IP Library Granted Patent US 9,201,797
Granted Patent B1
US 9,201,797 · App. 13/895,267 · Granted Dec 1, 2015

Per-selector dispatch

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 9,201,797
App. No.
13/895,267
Granted
Dec 1, 2015
Kind
B1
Abstract

Aspects of the subject technology relate to a computer-implemented process, including steps for compiling a first method call at a first call site in code of an object-oriented language, wherein the first call site is associated with a first selector, referencing a global cache comprising a plurality of per-selector caches, wherein each of the per-selector caches is indexed based on a corresponding selector identification and identifying a first per-selector cache, from among the plurality of per-selector caches, using the first selector. In certain aspects, the process can further include steps for invoking a method on a first object by performing a lookup in the first per-selector cache using a class associated with the first object to determine if a first target function exists in the first per-selector cache. Systems and computer readable media are also provided.

Claims (57)

1. A computer-implemented method, comprising:

compiling a first method call at a first call site in code of an object-oriented language, wherein the first call site is associated with a first method selector;

referencing a plurality of per-selector caches, each per-selector cache being associated with a respective method selector and available to multiple call sites that use the respective method selector, wherein each per-selector cache is configured to be searched based on a corresponding class identification when called from a respective call site;

identifying a first per-selector cache, from among the plurality of per-selector caches, using the first method selector; and

invoking a method on a first object by performing a lookup in the first per-selector cache using a class associated with the first object to determine if a first target function exists in the first per-selector cache.

2. The computer-implemented method of claim 1 , wherein the lookup in the first per-selector cache is performed using a hash lookup based on the class associated with the first object, and wherein the class comprises a unique integer identifier.

3. The computer-implemented method of claim 1 , further comprising:

invoking the first target function, if it is determined that the first target function exists in the first per-selector cache.

4. The computer-implemented method of claim 1 , further comprising:

performing a full lookup to locate the first target function, if the first target function is determined not to exist in the first per-selector cache; and

adding the first target function to the first per-selector cache.

5. The computer-implemented method of claim 1 , further comprising:

adjusting a size of the first per-selector cache based on a fill level of the first per-selector cache.

6. The computer-implemented method of claim 1 , further comprising:

invoking the method on a second object at the first call site, wherein the first call site is associated with the first per-selector cache; and

performing a lookup in the first per-selector cache using a second class associated with the second object to determine if a second target function exists in the first per-selector cache.

7. The computer-implemented method of claim 1 , further comprising:

invoking the method on a third object at a second call site, wherein the second call site is associated with the first per-selector cache; and

performing a lookup in the first per-selector cache using a third class associated with the third object to determine if a third target function exists in the first per-selector cache.

8. A system comprising:

one or more processors; and

a computer-readable medium comprising instructions stored therein, which when executed by the processors, cause the processors to perform operations comprising:

compiling a first method call at a first call site in code of an object-oriented language, wherein the first call site is associated with a first method selector;

referencing a plurality of per-selector caches, each per-selector cache being associated with a respective method selector and available to multiple call sites that use the respective method selector, wherein each per-selector cache is configured to be searched based on a corresponding class identification when called from a respective call site;

identifying a first per-selector cache, from among the plurality of per-selector caches, using the first method selector; and

invoking a method on a first object by performing a lookup in the first per-selector cache using a first class associated with the first object to determine if a first target function exists in the first per-selector cache, wherein the lookup is performed using a hash lookup based on the first class.

9. The system of claim 8 , wherein the first class associated with the first object comprises a unique integer identifier.

10. The system of claim 8 , wherein the processors are further configured to perform operations comprising:

invoking the first target function if it is determined that the first target function exists in the first per-selector cache.

11. The system of claim 8 , wherein the processors are further configured to perform operations comprising:

performing a full lookup to locate the first target function, if the first target function is determined not to exist in the first per-selector cache; and

adding the first target function to the first per-selector cache.

12. The system of claim 8 , wherein the processors are further configured to perform operations comprising:

adjusting a size of the first per-selector cache, based on a fill level of the first per-selector cache.

13. The system of claim 8 , wherein the processors are further configured to perform operations comprising:

invoking a method on a second object at the first call site, wherein the call site is associated with the first per-selector cache; and

performing a lookup in the first per-selector cache using a second class associated with the second object to determine if a second target function exists in the first per-selector cache.

14. The system of claim 8 , wherein the processors are further configured to perform operations comprising:

invoking a method on a third object at a second call site, wherein the second call site is associated with the first per-selector; and

performing a lookup in the first per-selector cache using a third class associated with the third object to determine if a third target function exists in the first per-selector cache.

15. A computer-readable storage medium comprising instructions stored therein, which when executed by a processor, cause the processor to perform operations comprising:

compiling a first method call at a first call site in code of an object-oriented language, wherein the first call site is associated with a first method selector;

referencing a plurality of per-selector caches, each per-selector cache being associated with a respective method selector and available to multiple call sites that use the respective method selector, wherein each per-selector cache is configured to be searched based on a corresponding class identification when called from a respective call site;

identifying a first per-selector cache, from among the plurality of per-selector caches, using the first method selector; and

invoking a first method on a first object by performing a lookup in the first per-selector cache using a first class associated with the first object to determine if a first target function exists in the first per-selector cache, wherein the lookup is performed using a hash lookup based on the first class, and wherein the first class comprises a unique integer identifier.

16. The computer-readable storage medium of claim 15 , the operations further comprising:

invoking the first target function if it is determined that the first target function exists in the first per-selector cache.

17. The computer-readable storage medium of claim 15 , the operations further comprising:

performing a full lookup to locate the first target function, if the first target function is determined not to exist in the first per-selector cache; and

adding the first target function to the first per-selector cache.

18. The computer-readable storage medium of claim 15 , the operations further comprising: adjusting a size of the first per-selector cache, based on a fill level of the first per-selector cache.

19. The computer-readable storage medium of claim 15 , the operations further comprising:

invoking a method on a second object at the first call site, wherein the first call site is associated with the first per-selector cache; and

performing a lookup in the first per-selector cache using a second class associated with the second object to determine if a second target function exists in the first per-selector cache.

20. The computer-readable storage medium of claim 15 , the operations further comprising:

invoking a method on a third object at a second call site, wherein the second call site is associated with the first per-selector cache; and

performing a lookup in the first per-selector cache using a third class associated with the third object to determine if a third target function exists in the first per-selector cache.

Assignments (2)
CHANGE OF NAME Recorded Oct 2, 2017
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 044334/0466 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 17, 2013
From: EGOROV, VYACHESLAV; MILLIKIN, KEVIN; MITROVIC, SRDJAN; POSVA, IVAN; SCHNEIDER, FLORIAN
To: GOOGLE INC.
Reel/Frame 030438/0130 →