e576bb2002-10-11Martin Nilsson /* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. */
dd6bca2001-07-20Henrik Grubbström (Grubba)  #define UPDATE_PC()
ece7262001-07-20Henrik Grubbström (Grubba) 
ebccff2002-05-10Henrik Grubbström (Grubba) #define ins_pointer(PTR) add_relocated_int_to_program((PTR))
ece7262001-07-20Henrik Grubbström (Grubba) #define read_pointer(OFF) read_int(OFF) #define upd_pointer(OFF, PTR) upd_int((OFF), (PTR)) #define ins_align(ALIGN) do { \ while (Pike_compiler->new_program->num_program % (ALIGN)) { \ add_to_program(0); \ } \ } while(0) #define ins_byte(VAL) add_to_program((VAL))
ebccff2002-05-10Henrik Grubbström (Grubba) #define ins_data(VAL) add_relocated_int_to_program((VAL))
cd93cc2017-07-20Martin Nilsson #define read_program_data(PTR, OFF) (INT32)get_unaligned32((PTR) + (sizeof(INT32)*(OFF)))
0e0cd72001-07-20Henrik Grubbström (Grubba) 
606fc22002-05-11Martin Stjernholm #define PROG_COUNTER pc
0e0cd72001-07-20Henrik Grubbström (Grubba) #define READ_INCR_BYTE(PC) EXTRACT_UCHAR((PC)++)
ebccff2002-05-10Henrik Grubbström (Grubba)  #define CHECK_RELOC(REL, PROG_SIZE) \ do { \
1df7d62003-06-03Martin Stjernholm  if ((REL) > (PROG_SIZE)-4) { \
2d76f22005-05-20Martin Stjernholm  Pike_error("Bad relocation: %"PRINTSIZET"d > %"PRINTSIZET"d\n", \
ebccff2002-05-10Henrik Grubbström (Grubba)  (REL), (PROG_SIZE)-4); \ } \ } while(0) /* FIXME: Uses internal variable 'byteorder'. */ #define DECODE_PROGRAM(P) \ do { \ struct program *p_ = (P); \ int num_reloc = (int)p_->num_relocations; \ if (byteorder != PIKE_BYTEORDER) { \ int e; \ /* NOTE: Only 1234 <==> 4321 byte-order relocation supported. */ \ for (e=0; e<num_reloc; e++) { \ size_t reloc = p_->relocations[e]; \ unsigned INT8 tmp1; \ unsigned INT8 tmp2; \ tmp1 = p_->program[reloc]; \ tmp2 = p_->program[reloc+1]; \ p_->program[reloc] = p_->program[reloc+3]; \ p_->program[reloc+1] = p_->program[reloc+2]; \ p_->program[reloc+3] = tmp1; \ p_->program[reloc+2] = tmp2; \ } \ } \ } while(0)