Next: objects codes reloc jump, Previous: objects codes reloc foreign, Up: objects codes reloc [Index]
These records are composed of 3 words: the second word contains a
fixnum which, unpacked to iksword_t
, represents a byte offset;
the third word contains the tagged pointer to a subordinate Scheme
object. When these records are processed: the tagged pointer is added
to the offset in bytes and the result is stored in the target word in
the data area of the subject code object:
meta data data area |.........|..........................| s_code p_data v v |---------|--------------|---|-------| code object |..............|...|target word ------->displacement ^ | | | ---------------- | | | off + obj |----|----|----| offset in object record 1st 2nd 3rd
Records of this type are used when the subject code object uses a pointer to a word in the code block of the subordinate Scheme object:
pointer --- | v |--------------|---|----------| subordinate Scheme object |..............|...| displacement word
the pointer to the word is the sum between:
the offset stored in the relocation vector is the sum between the latter two constants.
Every Scheme function makes use of some common machine code routines: to
validate the number of arguments, to validate the number of returned
values, as implementation of call-with-values
and other
operations. Such routines are compiled into code objects.
When the subject code object calls such routines, it does it by jumping directly to the entry point in the machine code; for each routine used by the subject code object, a relocation vector record is added containing:
iksword_t
, represents the constant
off_code_tag
.
adding off_code_tag
to the tagged pointer yields the address of
the machine code entry point.
Next: objects codes reloc jump, Previous: objects codes reloc foreign, Up: objects codes reloc [Index]