Next: , Previous: , Up: objects codes   [Index]


13.23.2 Operations on code objects

Preprocessor Symbol: code_primary_mask

A bitmask that can be used to extract the primary tag of code objects from tagged pointers.

Preprocessor Symbol: code_primary_tag

The tag of ikptr_t values used as references to code objects. The primary tag of code objects is equal to the vector tag.

Preprocessor Symbol: code_tag

The tag of ikptr_t values used as first words in pointer memory blocks.

We can determine if a ikptr_t references a code object as follows:

ikptr_t  s_obj = ...;

if ((code_primary_tag == (code_primary_mask & s_obj)) && \
    (code_tag         == IK_REF(s_obj, off_code_tag)))
  is_code_object();
else
  it_is_not();
Preprocessor Symbol: disp_code_tag
Preprocessor Symbol: disp_code_code_size
Preprocessor Symbol: disp_code_reloc_vector
Preprocessor Symbol: disp_code_freevars
Preprocessor Symbol: disp_code_annotation
Preprocessor Symbol: disp_code_unused

Displacement of fields. The number of bytes to add to an untagged pointer to code to get the pointer to the first byte in the word of the code’s field.

Preprocessor Symbol: off_code_tag
Preprocessor Symbol: off_code_code_size
Preprocessor Symbol: off_code_reloc_vector
Preprocessor Symbol: off_code_freevars
Preprocessor Symbol: off_code_annotation
Preprocessor Symbol: off_code_unused

An integer to add to a tagged ikptr_t reference to retrieve the pointer to the first byte of the word in the code’s field.

Preprocessor Macro: int IK_IS_CODE (ikptr_t X)

Evaluate to true if X is a reference to code object.

Preprocessor Macro: ikptr_t IK_CODE_ENTRY_POINT (ikptr_t code)

Given a tagged pointer to code object: evaluate to a pointer to the first octet in the data area. This pointer is the entry point in the machine code.


Next: , Previous: , Up: objects codes   [Index]