Interface method table generation method and device and function pointer query method and device

A technology of interface functions and function pointers, which is applied in the field of computers, can solve the problems of different types and quantities of interface functions, decreased query efficiency of function pointers, and small number of function pointers, so as to save storage space, reduce hash conflicts, and reduce storage space Effect

Pending Publication Date: 2020-09-08
HUAWEI TECH CO LTD
View PDF0 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] However, the inventor found in the research process of this application that in the prior art, when creating Itabs for different Java classes, the size of the hash table set is the same fixed value, that is, the hash table of each Java class The size of table is all the same, but, the category and the quantity of the interface function that different Java classes can realize are usually different, therefore, the Itab that generates according to prior art often exists to some Java classes too big, to other Java classes. too small problem
In this case, when the hash table of the Java class is large, it will cause a waste of storage space, and when the hash table of the Java class is small, the number of function pointers stored in the hash table will be small, correspondingly The number of function pointers stored in the conflict resolution table is relatively large. During the query process of function pointers, the required function pointers can only be queried when the conflict resolution table is queried, which further reduces the query efficiency of function pointers.

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
  • Interface method table generation method and device and function pointer query method and device
  • Interface method table generation method and device and function pointer query method and device
  • Interface method table generation method and device and function pointer query method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0072] When the interface method table Itab is generated for different Java classes through the prior art, the size of the set hash table is the same fixed value, that is, the size of the hash table of each Java class is all the same, but different Java classes The types and quantities of interface functions that can be realized are usually different. Therefore, the Itab generated according to the prior art often has the problem that it is too large for some Java classes and too small for other Java classes. When the hash table of a Java class is large, it will cause a waste of storage space, and when the hash table of the Java class is small, the number of function pointers stored in the hash table will be small, and the corresponding conflicts will be eliminated. The number of function pointers stored in the table is large, which further reduces the query efficiency of function pointers. In order to solve this problem, the present application discloses a method for generatin...

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

The embodiment of the invention discloses an interface method table generation method and device and a function pointer query method and device. The interface method table generation method comprisesthe following steps of based on the number of interface functions realized by a target Java class, generating a hash table of the target Java class, then, based on a hash algorithm of the target Javaclass and function signatures of all interface functions; determining a hash value of the interface function; determining an index of a function pointer of the first interface function in a hash table, storing a function pointer of the first interface function to a position indicated by the index, wherein the first interface function is an interface function having no hash conflict with other interface functions, storing a function signature and a function pointer of a second interface function in a conflict elimination table, and the second interface function is an interface function having hash conflict with other interface functions. According to the scheme, when the hash table is generated, the size of the hash table is determined according to the product of the number of the interfacefunctions which can be realized by the target Java class and the preset coefficient, so that the problem that the hash table is too large or too small is avoided.

Description

technical field [0001] The present application relates to the field of computer technology, in particular to a method for generating an interface method table, a method and a device for querying function pointers. Background technique [0002] Java classes support the interface mechanism of multiple inheritance, that is to say, a Java class can often implement multiple interface functions. In this case, in order to facilitate the Java class to query the function pointer of the interface function, it is usually necessary to create a corresponding interface method table (interface method table, Itab) for the Java class. [0003] Among them, the Itab of each Java class includes a hash table and a conflict elimination table. In the process of creating an Itab for a Java class, firstly, determine each interface function that the Java class can realize, and determine the size of the hash table and the hash algorithm; then, through the determined hash algorithm and each interface ...

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
IPC IPC(8): G06F9/448
CPCG06F9/4488
Inventor 张超蒋奕张必红陈永健包斌
Owner HUAWEI TECH CO LTD
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