literal pool
   HOME

TheInfoList



OR:

In
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includi ...
, and specifically in
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
and
assembler Assembler may refer to: Arts and media * Nobukazu Takemura, avant-garde electronic musician, stage name Assembler * Assemblers, a fictional race in the ''Star Wars'' universe * Assemblers, an alternative name of the superhero group Champions of ...
design, a literal pool is a lookup table used to hold literals during assembly and
execution Capital punishment, also known as the death penalty, is the state-sanctioned practice of deliberately killing a person as a punishment for an actual or supposed crime, usually following an authorized, rule-governed process to conclude that ...
. Multiple (local) literal pools are typically used only for
computer architecture In computer engineering, computer architecture is a description of the structure of a computer system made from component parts. It can sometimes be a high-level description that ignores details of the implementation. At a more detailed level, the ...
s that lack branch instructions for long jumps, or have a set of instructions optimized for shorter jumps. Examples of such architectures include the IBM System/360 and its successors, which had a number of instructions which took 12-bit address offsets. In this case, the compiler would create a literal table on every 4K page; any branches whose target was less than 4K bytes away could be taken immediately; longer branches required an address lookup via the literal table. The entries in the literal pool are placed into the
object Object may refer to: General meanings * Object (philosophy), a thing, being, or concept ** Object (abstract), an object which does not exist at any particular time or place ** Physical object, an identifiable collection of matter * Goal, an ...
relocation table during assembly, and are then resolved at link edit time. The ARM architecture also makes use of multiple local pools, as does
AArch64 AArch64 or ARM64 is the 64-bit extension of the ARM architecture family. It was first introduced with the Armv8-A architecture. Arm releases a new extension every year. ARMv8.x and ARMv9.x extensions and features Announced in October 2011, AR ...
, the 64-bit extension to the original ARM. Another architecture making use of multiple local pools is C-SKY, a 32-bit architecture designed for embedded
SoCs SOCS (suppressor of cytokine signaling proteins) refers to a family of genes involved in inhibiting the JAK-STAT signaling pathway. Genes * CISH * SOCS1 * SOCS2 * SOCS3 * SOCS4 * SOCS5 * SOCS6 * SOCS7 Suppressor of cytokine signaling 7 is a pro ...
. In certain ways, a literal pool resembles a TOC or a global offset table (GOT), except that the implementation is considerably simpler, and there may be multiple literal tables per object. Perhaps the most common type of literal pool are the literal pools used by the LDR Rd,=const pseudo-instruction in ARM assembly language and similar instructions in IBM System/360 assembly language, which are compiled to a LOAD with a PC-relative
addressing mode Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs. The various addressing modes that are defined in a given instruction set architecture define how the machine language instructions i ...
and the constant stored in the literal pool. On the IBM S/390 and
zSeries IBM Z is a family name used by IBM for all of its z/Architecture mainframe computers. In July 2017, with another generation of products, the official family was changed to IBM Z from IBM z Systems; the IBM Z family now includes the newest mod ...
architecture, the GNU assembler, "as" (which is invoked during the gcc build process) will use general-purpose register R13 to store a pointer to the literal pool. Often some particular constant value will be used multiple times in a program. Many linkers, by default, store each unique constant once, in a single combined literal pool; that improves code size. The Java virtual machine has a "string literal pool" and a "class constant pool". Jacquie Barker
"Beginning Java Objects: From Concepts to Code": "literal pool"


References

Compiler construction {{Prog-lang-stub