Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Optimization method of stack variable-containing function

An optimization method and stack variable technology, applied in the optimization field including stack variable functions, can solve problems such as large running overhead, and achieve the effect of reducing overhead

Active Publication Date: 2010-09-29
INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF0 Cites 15 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] The purpose of the present invention is to overcome the problem of high operating overhead when using alias checking instructions in the prior art to overcome the memory alias problem, thereby providing a function optimization method with small operating overhead

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
  • Optimization method of stack variable-containing function
  • Optimization method of stack variable-containing function
  • Optimization method of stack variable-containing function

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0047] The present invention will be described below in conjunction with the accompanying drawings and specific embodiments.

[0048] Before describing the present invention, firstly, the concepts involved in the present invention will be introduced uniformly.

[0049] Page protection mechanism: In an operating system that uses page memory management, read and write access control is performed on memory pages, which have three attributes: readable, writable, and executable. The page protection mechanism is to protect the data security and the correctness of the program running results by setting different page access attributes.

[0050] After the relevant concepts are explained, how the present invention realizes the optimization of the existing application program on the new processor will be described in detail below.

[0051] Since the application program uses a function as a basic unit, the optimization of the function will be used as an example below to illustrate the o...

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 an optimization method of a stack variable-containing function. The method comprises the steps of: applying a section of physical memory space used as a mapping stack of a function to be optimized, and then applying a section of virtual memory space used as a shadow stack of the function to be optimized; selecting a stack variable to be lifted to an idle register from the function to be optimized; inserting an instruction for switching a function stack of the function to be optimized from a system stack to the mapping stack, an instruction for lifting the content of thestack variable to the registers and an instruction for setting a virtual storage page in the mapping stack to be in a protected mode; replacing all the instructions containing operations on the lifted stack variable to be instructions for operating corresponding registers, and replacing all the operations on the non-lifted stack variables to be operations on corresponding virtual storage addresses on the shadow stack; and inserting an instruction for removing the protected mode on the virtual storage page in the mapping stack, an instruction for storing the content of the lifted stack variable back to an internal memory from the registers, and an instruction for switching a function stack frame from the mapping stack back to the system stack.

Description

technical field [0001] The invention relates to a function optimization method, in particular to an optimization method for a function containing stack variables. Background technique [0002] The CPU (Central Processing Unit) plays a central role in a computer. With the continuous advancement of technology, processor technology is also developing. For example, according to the word length of information processed by the CPU, the CPU has experienced the development of four-bit microprocessors, eight-bit microprocessors, sixteen-bit microprocessors, thirty-two-bit microprocessors, and sixty-four-bit microprocessors. . Generally speaking, compared with old processors, new processors will introduce some new features, such as increasing the number of registers, adding new instructions, increasing cache capacity, and so on. [0003] For the convenience of users, the new processor will be compatible with software developed based on the old processor, but existing applications (t...

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/44
Inventor 李建军武成岗
Owner INST OF COMPUTING TECH CHINESE ACAD OF SCI
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products