potion  0.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
asm.h File Reference

some assembler macros More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PNJumps
 record labels to be patched More...
 

Macros

#define ASM_UNIT   512
 
#define ASM_TPL_IMM   1024
 
#define MAKE_TARGET(arch)
 
#define PN_HAS_UPVALS(v)
 
#define ASM(ins)   *asmp = potion_asm_put(P, *asmp, (PN)(ins), sizeof(u8))
 
#define ASM2(pn)   *asmp = potion_asm_put(P, *asmp, (PN)(pn), 2)
 
#define ASMI(pn)   *asmp = potion_asm_put(P, *asmp, (PN)(pn), sizeof(int))
 
#define ASMN(pn)   *asmp = potion_asm_put(P, *asmp, (PN)(pn), sizeof(PN))
 
#define ASMS(cstr)   *asmp = potion_asm_write(P, *asmp, cstr, sizeof(cstr)-1)
 

Functions

PNAsmpotion_asm_new (Potion *)
 
PNAsmpotion_asm_clear (Potion *, PNAsm *)
 
PNAsmpotion_asm_put (Potion *, PNAsm *, PN, size_t)
 
PNAsmpotion_asm_op (Potion *, PNAsm *, u8, int, int)
 
PNAsmpotion_asm_write (Potion *, PNAsm *, char *, size_t)
 

Detailed Description

some assembler macros

(c) 2008 why the lucky stiff, the freelance professor (c) 2014 perl11.org

PNAsm(vt = PN_TUSER, siz, ptr, len) -> PNFlex(vt = PN_TUSER, siz, ...) overhead of 6 words on x86, but don't have to do constant forwarding tricks.

Definition in file asm.h.

Macro Definition Documentation

#define ASM_UNIT   512

Definition at line 16 of file asm.h.

#define ASM_TPL_IMM   1024

Definition at line 17 of file asm.h.

#define MAKE_TARGET (   arch)

Definition at line 25 of file asm.h.

#define PN_HAS_UPVALS (   v)
Value:
int v = 0; \
if (PN_TUPLE_LEN(f->protos) > 0) { \
PN_TUPLE_EACH(f->protos, i, proto2, { \
if (PN_TUPLE_LEN(PN_PROTO(proto2)->upvals) > 0) { \
v = 1; \
} \
}); \
}
#define PN_TUPLE_LEN(t)
Definition: potion.h:268
#define PN_TUPLE_EACH(T, I, V, B)
Definition: potion.h:279

Definition at line 88 of file asm.h.

#define ASM (   ins)    *asmp = potion_asm_put(P, *asmp, (PN)(ins), sizeof(u8))

Definition at line 98 of file asm.h.

#define ASM2 (   pn)    *asmp = potion_asm_put(P, *asmp, (PN)(pn), 2)

Definition at line 99 of file asm.h.

#define ASMI (   pn)    *asmp = potion_asm_put(P, *asmp, (PN)(pn), sizeof(int))

Definition at line 100 of file asm.h.

#define ASMN (   pn)    *asmp = potion_asm_put(P, *asmp, (PN)(pn), sizeof(PN))

Definition at line 101 of file asm.h.

#define ASMS (   cstr)    *asmp = potion_asm_write(P, *asmp, cstr, sizeof(cstr)-1)

Definition at line 102 of file asm.h.

Function Documentation

PNAsm* potion_asm_new ( Potion )

Definition at line 13 of file asm.c.

PNAsm* potion_asm_clear ( Potion ,
PNAsm  
)

Definition at line 19 of file asm.c.

PNAsm* potion_asm_put ( Potion ,
PNAsm ,
PN  ,
size_t   
)

Definition at line 25 of file asm.c.

PNAsm* potion_asm_op ( Potion ,
PNAsm ,
u8  ,
int  ,
int   
)

Definition at line 43 of file asm.c.

PNAsm* potion_asm_write ( Potion ,
PNAsm ,
char *  ,
size_t   
)

Definition at line 56 of file asm.c.