Minor additions to comments around amd64 aot
authorAndi McClure <andi.mcclure@xamarin.com>
Wed, 3 Feb 2016 22:16:01 +0000 (17:16 -0500)
committerAndi McClure <andi.mcclure@xamarin.com>
Wed, 3 Feb 2016 22:16:01 +0000 (17:16 -0500)
mono/arch/amd64/amd64-codegen.h
mono/mini/mini-amd64.c
mono/mini/mini-amd64.h

index d3c1b42993c0a735c2a253fc2773cfff48c50364..181913f5751c9b68b459919dc5c911dc96f1a0da 100644 (file)
 #ifndef AMD64_H
 #define AMD64_H
 
+// Conventions in this file:
+
+// body: implementation. other macros call this one
+// disp: displacement
+// inst: instruction
+// is_half: short if true, byte if false (then why is it named is_half...?)
+// imm: immediate
+// mem: read from (immediate-supplied address?)
+// membase: read from address in a base register plus a displacement
+// memindex: SIP addressing: (address in base register) + (displacement in index register)<<(shift)
+// reg: register, encode modR/M bits 00
+// regp: register, encode modR/M bits 11
+// size: Expected 1,2,4 or 8
+// widen: extends from 1 or 2 bytes
+
 #include <glib.h>
 
 typedef enum {
index 58204230c6d549326944f5db3f3e77b730d42a40..6c22860efa9fa468b93b0a46a3f2652de0176db5 100644 (file)
@@ -501,11 +501,11 @@ typedef struct {
        /* Only if storage == ArgValuetypeInReg */
        ArgStorage pair_storage [2];
        gint8 pair_regs [2];
-       /* The size of each pair */
+       /* The size of each pair (bytes) */
        int pair_size [2];
        int nregs;
        /* Only if storage == ArgOnStack */
-       int arg_size;
+       int arg_size; // Bytes, will always be rounded up/aligned to 8 byte boundary
 } ArgInfo;
 
 typedef struct {
index fbea7e0de5d04a9c2d472713b4432bbd75c31ed1..e409a025c55d42af4e11c8ff9a2efdb7a1b2266c 100644 (file)
@@ -224,9 +224,10 @@ typedef struct {
        gpointer addr;
        /* The trampoline reads this, so keep the size explicit */
        int ret_marshal;
-       /* If ret_marshal != NONE, this is the reg of the vret arg, else -1 */
+       /* If ret_marshal != NONE, this is the reg of the vret arg, else -1 (used in out case) */
+       /* Equivalent of vret_arg_slot in the x86 implementation. */
        int vret_arg_reg;
-       /* The stack slot where the return value will be stored */
+       /* The stack slot where the return value will be stored (used in in case) */
        int vret_slot;
        int stack_usage, map_count;
        /* If not -1, then make a virtual call using this vtable offset */