Check patentability & draft patents in minutes with Patsnap Eureka AI!

High-efficiency dynamic type conversion implementation method

A technology of dynamic type and implementation method, which is applied in the field of program compilation and can solve performance problems and other problems

Inactive Publication Date: 2015-03-04
PEKING UNIV
View PDF1 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Existing dynamic_cast implementations, such as those adopted by Microsoft's Visual C++ Compiler (VC for short) and the GNU C++ Compiler (GCC), face serious performance problems

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
  • High-efficiency dynamic type conversion implementation method
  • High-efficiency dynamic type conversion implementation method
  • High-efficiency dynamic type conversion implementation method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0068] The present invention will be further described below through the embodiments and in conjunction with the accompanying drawings.

[0069] The invention is an efficient dynamic type conversion method oriented to C++ language. figure 1 It is a piece of C++ sample code, which describes all the classes (19 in total) in the sample program and their mutual inheritance relationship. This code snippet is a simplified version, omitting the internal member functions and member variable information of each class. In its full version code, each class contains a virtual function and an integer member variable, for example, class D2 contains a virtual function void fooD2() and an integer member variable int intD2.

[0070] figure 2 It shows the memory layout diagram of a class A object at runtime after the sample code is compiled by GCC. The RTTI information used for dynamic type conversion is the typeinfo of the class. The C++ standard stipulates that typeinfo must conta...

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 invention provides a high-efficiency dynamic type conversion implementation method. The method comprises a complier parsing source codes and constructing a class hierarchy chart, a first base class chart and a first base class chain; constructing a cross conversion domain according to the class hierarchy chart; dividing a downlink conversion domain according to the first base class chain; creating a thread table for each class, and storing to complied binary program; adding a pointer pointing to the thread table, a private table point for processing non-public inheritance and a conversion domain table in a virtual function table of each class, and storing the expanded virtual function table to the complied binary program; and the complier generating a runtime code for each dynamic cast sentence, and completing dynamic type conversion by looking up the thread table, the private table and the conversion domain table. The high-efficiency dynamic type conversion implementation method is used in equipment of the complier and the like to generate high-efficiency executable program and improve the runtime performance of the program.

Description

technical field [0001] The invention belongs to the technical field of program compilation, and in particular relates to an efficient implementation of dynamic type conversion in C++ language, which can be used in devices such as compilers to generate efficient executable programs and improve the runtime performance of the programs. Background technique [0002] Compilation is the process of translating a source program written in a source language (such as C++, etc.) into a target program (ie, a binary program that can be directly executed on a machine) using a compiler (ie, a compiler). It is the most important aspect of modern software development. of cornerstone [0003] The C++ language implements the dynamic type features provided by other dynamic languages ​​(such as JavaScript, Python, etc.) by providing runtime type information (RTTI), which allows a variable to be interpreted as multiple types during execution. The C++ program variable obtains its own type informa...

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
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/44
Inventor 张超韦韬黎斯达丁羽陈兆丰段镭张利华赵晓濛徐先栋李坤
Owner PEKING UNIV
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More