substitute more macros for the slot field access.

simplified code by getting rid of SET_ACTIVE_METHOD_CODE() and making related changes
This commit is contained in:
hyunghwan.chung
2018-12-23 08:33:52 +00:00
parent 981882de7e
commit b13892d586
7 changed files with 52 additions and 37 deletions

View File

@ -661,14 +661,6 @@ struct moo_compiler_t
};
#endif
#if defined(MOO_USE_METHOD_TRAILER)
/* let it point to the trailer of the method */
# define SET_ACTIVE_METHOD_CODE(moo) ((moo)->active_code = (moo_oob_t*)&(moo)->active_method->literal_frame[MOO_OBJ_GET_SIZE((moo)->active_method) + 1 - MOO_METHOD_NAMED_INSTVARS])
#else
/* let it point to the payload of the code byte array */
# define SET_ACTIVE_METHOD_CODE(moo) ((moo)->active_code = (moo)->active_method->code->slot)
#endif
#if defined(MOO_BCODE_LONG_PARAM_SIZE) && (MOO_BCODE_LONG_PARAM_SIZE == 1)
# define MAX_CODE_INDEX (0xFFu)
# define MAX_CODE_NTMPRS (0xFFu)