Commits

Dean Hall  committed a4cc561

Big Rewrite: Eliminated all PM_FEATURES except HAVE_FLOAT and HAVE_DEBUG_INFO.

  • Participants
  • Parent commits 8529fe9
  • Branches v10

Comments (0)

Files changed (29)

File src/lib/sys.py

 def gc():
     """__NATIVE__
     PmReturn_t retval = PM_RET_OK;
-#ifdef HAVE_GC
+
     /* If wrong number of args, raise TypeError */
     if (NATIVE_GET_NUM_ARGS() != 0)
     {
     }
 
     retval = heap_gcRun();
-#endif
+
     NATIVE_SET_TOS(PM_NONE);
-
     return retval;
     """
     pass

File src/platform/posix/pmfeatures.py

 # is seen in the file COPYING up one directory from this.
 
 PM_FEATURES = {
-    "HAVE_PRINT": True,
-    "HAVE_GC": True,
     "HAVE_FLOAT": True,
-    "HAVE_DEL": True,
-    "HAVE_IMPORTS": True,
-    "HAVE_REPLICATION": True,
-    "HAVE_ASSERT": True,
-    "HAVE_BACKTICK": True,
-    "HAVE_STRING_FORMAT": True,
-    "HAVE_CLOSURES": True,
-    "HAVE_BYTEARRAY": False,
     "HAVE_DEBUG_INFO": True,
 }

File src/tests/unit/ut_codeobj.c

  */
 uint8_t const test_code_image0[] =
 {
-#if !defined(HAVE_CLOSURES) && !defined(HAVE_DEBUG_INFO)
-    0x0A, 0xFD, 0x00, 0x00, 0x40, 0x01, 0x00, 0x04, 
-    0x02, 0x03, 0x04, 0x00, 0x6D, 0x61, 0x69, 0x6E, 
-    0x03, 0x04, 0x00, 0x74, 0x65, 0x73, 0x74, 0x04, 
-    0x02, 0x0A, 0xCF, 0x00, 0x00, 0x43, 0x09, 0x05, 
-    0x04, 0x01, 0x03, 0x04, 0x00, 0x6D, 0x61, 0x69, 
-    0x6E, 0x04, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 
-    0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x02, 
-    0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 
-    0x04, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 
-    0x01, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 
-    0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 
-    0x01, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 
-    0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 
-    0x00, 0x00, 0x00, 0x00, 0x64, 0x01, 0x00, 0x7D, 
-    0x00, 0x00, 0x64, 0x05, 0x00, 0x7D, 0x01, 0x00, 
-    0x64, 0x06, 0x00, 0x7D, 0x02, 0x00, 0x78, 0x18, 
-    0x00, 0x7C, 0x01, 0x00, 0x44, 0x5D, 0x10, 0x00, 
-    0x7D, 0x03, 0x00, 0x7C, 0x00, 0x00, 0x7C, 0x03, 
-    0x00, 0x37, 0x7D, 0x00, 0x00, 0x71, 0x19, 0x00, 
-    0x57, 0x78, 0x18, 0x00, 0x7C, 0x02, 0x00, 0x44, 
-    0x5D, 0x10, 0x00, 0x7D, 0x03, 0x00, 0x7C, 0x00, 
-    0x00, 0x7C, 0x03, 0x00, 0x38, 0x7D, 0x00, 0x00, 
-    0x71, 0x34, 0x00, 0x57, 0x78, 0x2D, 0x00, 0x7C, 
-    0x01, 0x00, 0x44, 0x5D, 0x25, 0x00, 0x7D, 0x03, 
-    0x00, 0x78, 0x1C, 0x00, 0x7C, 0x02, 0x00, 0x44, 
-    0x5D, 0x14, 0x00, 0x7D, 0x04, 0x00, 0x7C, 0x00, 
-    0x00, 0x7C, 0x03, 0x00, 0x7C, 0x04, 0x00, 0x14, 
-    0x37, 0x7D, 0x00, 0x00, 0x71, 0x5C, 0x00, 0x57, 
-    0x71, 0x4F, 0x00, 0x57, 0x7C, 0x00, 0x00, 0x53, 
-    0x00, 0x64, 0x00, 0x00, 0x84, 0x00, 0x00, 0x5A, 
-    0x00, 0x00, 0x65, 0x00, 0x00, 0x83, 0x00, 0x00, 
-    0x01, 0x64, 0x01, 0x00, 0x53, 
-#endif
-#if defined(HAVE_CLOSURES) && !defined(HAVE_DEBUG_INFO)
+#if !defined(HAVE_DEBUG_INFO)
 /* utco.py */
     0x0A, 0x03, 0x01, 0x00, 0x40, 0x01, 0x00, 0x00, 
     0x04, 0x02, 0x03, 0x04, 0x00, 0x6D, 0x61, 0x69, 
     0x00, 0x00, 0x84, 0x00, 0x00, 0x5A, 0x00, 0x00, 
     0x65, 0x00, 0x00, 0x83, 0x00, 0x00, 0x01, 0x64, 
     0x01, 0x00, 0x53, 
-#endif
-#if !defined(HAVE_CLOSURES) && defined(HAVE_DEBUG_INFO)
-/* utco.py */
-    0x0A, 0x3D, 0x01, 0x00, 0x40, 0x01, 0x00, 0x01, 
-    0x00, 0x04, 0x02, 0x03, 0x04, 0x00, 0x6D, 0x61, 
-    0x69, 0x6E, 0x03, 0x04, 0x00, 0x75, 0x74, 0x63, 
-    0x6F, 0x03, 0x02, 0x00, 0x09, 0x12, 0x03, 0x08, 
-    0x00, 0x75, 0x74, 0x63, 0x6F, 0x2E, 0x70, 0x79, 
-    0x00, 0x04, 0x02, 0x0A, 0xFD, 0x00, 0x00, 0x43, 
-    0x09, 0x05, 0x01, 0x00, 0x04, 0x01, 0x03, 0x04, 
-    0x00, 0x6D, 0x61, 0x69, 0x6E, 0x03, 0x1E, 0x00, 
-    0x00, 0x02, 0x06, 0x01, 0x06, 0x01, 0x06, 0x02, 
-    0x07, 0x00, 0x06, 0x01, 0x0E, 0x02, 0x07, 0x00, 
-    0x06, 0x01, 0x0E, 0x02, 0x07, 0x00, 0x06, 0x01, 
-    0x07, 0x00, 0x06, 0x01, 0x16, 0x02, 0x03, 0x08, 
-    0x00, 0x75, 0x74, 0x63, 0x6F, 0x2E, 0x70, 0x79, 
-    0x00, 0x04, 0x07, 0x00, 0x01, 0x00, 0x00, 0x00, 
-    0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x02, 
-    0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 
-    0x04, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 
-    0x01, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 
-    0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 
-    0x01, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 
-    0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 
-    0x00, 0x00, 0x00, 0x00, 0x64, 0x01, 0x00, 0x7D, 
-    0x00, 0x00, 0x64, 0x05, 0x00, 0x7D, 0x01, 0x00, 
-    0x64, 0x06, 0x00, 0x7D, 0x02, 0x00, 0x78, 0x18, 
-    0x00, 0x7C, 0x01, 0x00, 0x44, 0x5D, 0x10, 0x00, 
-    0x7D, 0x03, 0x00, 0x7C, 0x00, 0x00, 0x7C, 0x03, 
-    0x00, 0x37, 0x7D, 0x00, 0x00, 0x71, 0x19, 0x00, 
-    0x57, 0x78, 0x18, 0x00, 0x7C, 0x02, 0x00, 0x44, 
-    0x5D, 0x10, 0x00, 0x7D, 0x03, 0x00, 0x7C, 0x00, 
-    0x00, 0x7C, 0x03, 0x00, 0x38, 0x7D, 0x00, 0x00, 
-    0x71, 0x34, 0x00, 0x57, 0x78, 0x2D, 0x00, 0x7C, 
-    0x01, 0x00, 0x44, 0x5D, 0x25, 0x00, 0x7D, 0x03, 
-    0x00, 0x78, 0x1C, 0x00, 0x7C, 0x02, 0x00, 0x44, 
-    0x5D, 0x14, 0x00, 0x7D, 0x04, 0x00, 0x7C, 0x00, 
-    0x00, 0x7C, 0x03, 0x00, 0x7C, 0x04, 0x00, 0x14, 
-    0x37, 0x7D, 0x00, 0x00, 0x71, 0x5C, 0x00, 0x57, 
-    0x71, 0x4F, 0x00, 0x57, 0x7C, 0x00, 0x00, 0x53, 
-    0x00, 0x64, 0x00, 0x00, 0x84, 0x00, 0x00, 0x5A, 
-    0x00, 0x00, 0x65, 0x00, 0x00, 0x83, 0x00, 0x00, 
-    0x01, 0x64, 0x01, 0x00, 0x53, 
-#endif
-#if defined(HAVE_CLOSURES) && defined(HAVE_DEBUG_INFO)
+#else
 /* utco.py */
     0x0A, 0x43, 0x01, 0x00, 0x40, 0x01, 0x00, 0x00, 
     0x01, 0x00, 0x04, 0x02, 0x03, 0x04, 0x00, 0x6D, 

File src/tools/pmCoFilter.py

     # Modify some globals based on the platform features
     global UNIMPLEMENTED_BCODES
 
-    if not PM_FEATURES["HAVE_DEL"]:
-        UNIMPLEMENTED_BCODES.extend([
-            "DELETE_SUBSCR",
-            "DELETE_NAME",
-            "DELETE_GLOBAL",
-            "DELETE_ATTR",
-            "DELETE_FAST",
-            ])
-
-    if not PM_FEATURES["HAVE_IMPORTS"]:
-        UNIMPLEMENTED_BCODES.extend([
-            "IMPORT_STAR",
-            "IMPORT_FROM",
-            ])
-
-    if not PM_FEATURES["HAVE_ASSERT"]:
-        UNIMPLEMENTED_BCODES.extend([
-            "RAISE_VARARGS",
-            ])
-
-    # Issue #44: Add support for the backtick operation (UNARY_CONVERT)
-    if not PM_FEATURES["HAVE_BACKTICK"]:
-        UNIMPLEMENTED_BCODES.extend([
-            "UNARY_CONVERT",
-            ])
-
     # Issue #13: Add support for Python 2.6 bytecodes.
     # The *_TRUE_DIVIDE bytecodes require support for float type
     if not PM_FEATURES["HAVE_FLOAT"]:
             "INPLACE_TRUE_DIVIDE",
             ])
 
-    # Issue #56: Add support for decorators
-    if not PM_FEATURES["HAVE_CLOSURES"]:
-        UNIMPLEMENTED_BCODES.extend([
-            "MAKE_CLOSURE",
-            "LOAD_CLOSURE",
-            "LOAD_DEREF",
-            "STORE_DEREF",
-            ])
-
     # Set invalid and unimplemented bcodes to None
     clear_invalid = lambda x: None if x[0] == '<' or x in UNIMPLEMENTED_BCODES \
                               else x

File src/vm/bytearray.c

  */
 
 #include "pm.h"
-#ifdef HAVE_BYTEARRAY
 
 
 #define ROUND_UP_TO_MUL_OF_FOUR(n) n = (((n) + 3) & ~3)
     plat_putByte(')');
     return retval;
 }
-#endif /* HAVE_BYTEARRAY */

File src/vm/dict.c

 }
 
 
-#ifdef HAVE_DEL
 PmReturn_t
 dict_delItem(pPmObj_t pdict, pPmObj_t pkey)
 {
 
     return retval;
 }
-#endif /* HAVE_DEL */
 
 
-#ifdef HAVE_PRINT
 PmReturn_t
 dict_print(pPmObj_t pdict)
 {
 
     return plat_putByte('}');
 }
-#endif /* HAVE_PRINT */
 
 
 PmReturn_t

File src/vm/dict.h

  */
 PmReturn_t dict_getItem(pPmObj_t pdict, pPmObj_t pkey, pPmObj_t *r_pobj);
 
-#ifdef HAVE_DEL
 /**
  * Removes a key and value from the dict.
  * Throws TypeError if pdict is not a dict.
  * @return  Return status
  */
 PmReturn_t dict_delItem(pPmObj_t pdict, pPmObj_t pkey);
-#endif /* HAVE_DEL */
 
 /**
  * Allocates space for a new Dict.
  */
 PmReturn_t dict_setItem(pPmObj_t pdict, pPmObj_t pkey, pPmObj_t pval);
 
-#ifdef HAVE_PRINT
 /**
  * Prints out a dict. Uses obj_print() to print elements.
  *
  * @return Return status
  */
 PmReturn_t dict_print(pPmObj_t pdict);
-#endif /* HAVE_PRINT */
 
 /**
  * Updates the destination dict with the key,value pairs from the source dict

File src/vm/float.c

 }
 
 
-#ifdef HAVE_PRINT
 PmReturn_t
 float_print(pPmObj_t pf)
 {
     return float_new(-((pPmFloat_t) pf)->val, r_pf);
 }
 
-#endif /* HAVE_PRINT */
-
 
 PmReturn_t
 float_op(pPmObj_t px, pPmObj_t py, pPmObj_t *r_pn, int8_t op)

File src/vm/float.h

 PmReturn_t float_compare(pPmObj_t px, pPmObj_t py, pPmObj_t *r_pobj,
                          PmCompare_t cmp);
 
-#ifdef HAVE_PRINT
 /**
  * Sends out a float object.
  * The number is preceded with a "-" when necessary.
  */
 PmReturn_t float_print(pPmObj_t pf);
 
-#endif /* HAVE_PRINT */
-
 #endif /* HAVE_FLOAT */
 
 #endif /* __FLOAT_H__ */

File src/vm/frame.c

     /* #207: Initializing a Generator using CALL_FUNC needs extra stack slot */
     fsize = sizeof(PmFrame_t) + (pco->co_stacksize + pco->co_nlocals + 2) * sizeof(pPmObj_t);
 
-#ifdef HAVE_CLOSURES
     /* #256: Add support for closures */
     fsize = fsize + pco->co_nfreevars
             + ((pco->co_cellvars == C_NULL) ? 0 : pco->co_cellvars->length);
-#endif /* HAVE_CLOSURES */
 
     /* Allocate a frame */
     retval = heap_getChunk(fsize, &pchunk);
     pframe->fo_globals = ((pPmFunc_t)pfunc)->f_globals;
     pframe->fo_attrs = ((pPmFunc_t)pfunc)->f_attrs;
 
-#ifndef HAVE_CLOSURES
-    /* Empty stack points to one past locals */
-    pframe->fo_sp = &(pframe->fo_locals[pco->co_nlocals]);
-#else
     /* #256: Add support for closures */
     pframe->fo_sp = &(pframe->fo_locals[pco->co_nlocals + pco->co_nfreevars
         + ((pco->co_cellvars == C_NULL) ? 0 : pco->co_cellvars->length)]);
-#endif /* HAVE_CLOSURES */
 
     /* By default, this is a normal frame, not an import or __init__ one */
     pframe->fo_isImport = 0;

File src/vm/func.c

     pfunc->f_globals = C_NULL;
     pfunc->f_attrs = C_NULL;
     pfunc->f_defaultargs = C_NULL;
-
-#ifdef HAVE_CLOSURES
-    /* Clear field for closure tuple */
     pfunc->f_closure = C_NULL;
-#endif /* HAVE_CLOSURES */
 
     /* Create attrs dict for regular func (not native) */
     if (OBJ_GET_TYPE(pco) == OBJ_TYPE_COB)

File src/vm/func.h

     /** Ptr to tuple holding default args */
     pPmTuple_t f_defaultargs;
 
-#ifdef HAVE_CLOSURES
     /** Ptr to tuple of cell values */
     pPmTuple_t f_closure;
-#endif /* HAVE_CLOSURES */
-
 } PmFunc_t,
  *pPmFunc_t;
 

File src/vm/global.c

     /* Create empty threadList */
     retval = list_new(&pobj);
     gVmGlobal.threadList = (pPmList_t)pobj;
-
-#ifdef HAVE_PRINT
     gVmGlobal.needSoftSpace = C_FALSE;
     gVmGlobal.somethingPrinted = C_FALSE;
-#endif /* HAVE_PRINT */
 
     return retval;
 }

File src/vm/global.h

 /** The global string "next" */
 #define PM_NEXT_STR (pPmObj_t)&pm_global_string_next
 
-#ifdef HAVE_ASSERT
 /** The global string "Exception" */
 #define PM_EXCEPTION_STR (pPmObj_t)&pm_global_string_exception
-#endif /* HAVE_ASSERT */
 
-#ifdef HAVE_BYTEARRAY
 /** The global string "bytearray" */
 #define PM_BYTEARRAY_STR (pPmObj_t)&pm_global_string_bytearray
-#endif /* HAVE_BYTEARRAY */
 
 /** The global string "__md" */
 #define PM_MD_STR (pPmObj_t)&pm_global_string_md
     /** Ptr to current thread */
     pPmThread_t pthread;
 
-#ifdef HAVE_PRINT
     /** Remembers when a space is needed before printing the next object */
     uint8_t needSoftSpace;
+
     /** Remembers when something has printed since the last newline */
     uint8_t somethingPrinted;
-#endif /* HAVE_PRINT */
 
     /** Flag to trigger rescheduling */
     uint8_t reschedule;

File src/vm/heap.c

  * Sets the GC's mark bit for the object
  * This MUST NOT be called on objects that are free.
  */
-#ifdef HAVE_GC
 #define OBJ_SET_GCVAL(pobj, gcval) \
     do \
     { \
                                        : ((pPmObj_t)pobj)->od & ~OD_MARK_MASK;\
     } \
     while (0)
-#else
-#define OBJ_SET_GCVAL(pobj, gcval)
-#endif /* HAVE_GC */
 
 #define CHUNK_GET_SIZE(pchunk) (((pPmHeapDesc_t)pchunk)->hd & HD_SIZE_MASK)
 
     /** The amount of heap space available in free list */
     uint32_t avail;
 
-#ifdef HAVE_GC
     /** Garbage collection mark value */
     uint8_t gcval;
 
     pPmObj_t temp_roots[HEAP_NUM_TEMP_ROOTS];
 
     uint8_t temp_root_index;
-#endif                          /* HAVE_GC */
 
 } PmHeap_t,
  *pPmHeap_t;
     s |= 1<<0;
 #endif
     s |= 1<<1;
-#ifdef HAVE_CLOSURES
     s |= 1<<2;
-#endif
     s |= 1<<3;
     fwrite(&s, sizeof(uint16_t), 1, fp);
 
     /* Init heap globals */
     pmHeap.pfreelist = C_NULL;
     pmHeap.avail = 0;
-#ifdef HAVE_GC
     pmHeap.gcval = (uint8_t)0;
     pmHeap.temp_root_index = (uint8_t)0;
     heap_gcSetAuto(C_TRUE);
-#endif /* HAVE_GC */
 
     pchunk = (pPmHeapDesc_t)pmHeap.base;
     hs = pmHeap.size;
     /* Attempt to get a chunk */
     retval = heap_getChunkImpl(adjustedsize, r_pchunk);
 
-#ifdef HAVE_GC
     /* Perform GC if out of memory, gc is enabled and not in native session */
     if ((retval == PM_RET_EX_MEM) && (pmHeap.auto_gc == C_TRUE)
         && (gVmGlobal.nativeframe.nf_active == C_FALSE))
         /* Attempt to get a chunk */
         retval = heap_getChunkImpl(adjustedsize, r_pchunk);
     }
-#endif /* HAVE_GC */
 
     /* Ensure that the pointer is 4-byte aligned */
     if (retval == PM_RET_OK)
 }
 
 
-#ifdef HAVE_GC
 /*
  * Marks the given object and the objects it references.
  *
             }
 */
 
-#ifdef HAVE_CLOSURES
             /* #256: Add support for closures */
             /* Mark the cellvars tuple */
             retval = heap_gcMarkObj((pPmObj_t)((pPmCo_t)pobj)->co_cellvars);
-#endif /* HAVE_CLOSURES */
             break;
 
         case OBJ_TYPE_MOD:
             retval = heap_gcMarkObj((pPmObj_t)((pPmFunc_t)pobj)->f_defaultargs);
             PM_RETURN_IF_ERROR(retval);
 
-#ifdef HAVE_CLOSURES
             /* #256: Mark the closure tuple */
             retval = heap_gcMarkObj((pPmObj_t)((pPmFunc_t)pobj)->f_closure);
-#endif /* HAVE_CLOSURES */
             break;
 
         case OBJ_TYPE_CLI:
             }
             break;
 
-#ifdef HAVE_BYTEARRAY
         case OBJ_TYPE_BYA:
             OBJ_SET_GCVAL(pobj, pmHeap.gcval);
 
         case OBJ_TYPE_BYS:
             OBJ_SET_GCVAL(pobj, pmHeap.gcval);
             break;
-#endif /* HAVE_BYTEARRAY */
 
         default:
             /* There should be no invalid types */
 {
     pmHeap.temp_root_index = objid;
 }
-
-#else
-
-void heap_gcPushTempRoot(pPmObj_t pobj, uint8_t *r_objid) {}
-void heap_gcPopTempRoot(uint8_t objid) {}
-
-#endif /* HAVE_GC */

File src/vm/heap.h

 /** @return  Return the size of the heap in bytes */
 uint32_t heap_getSize(void);
 
-#ifdef HAVE_GC
 /**
  * Runs the mark-sweep garbage collector
  *
  */
 PmReturn_t heap_gcSetAuto(uint8_t auto_gc);
 
-#endif /* HAVE_GC */
-
 /**
  * Pushes an object onto the temporary roots stack if there is room
  * to protect the objects from a potential garbage collection

File src/vm/int.c

 }
 
 
-#ifdef HAVE_PRINT
 PmReturn_t
 int_print(pPmObj_t pint)
 {
     /* Print the integer object */
     return _int_printHex(((pPmInt_t)pint)->val);
 }
-#endif /* HAVE_PRINT */
 
 
 PmReturn_t

File src/vm/int.h

  */
 PmReturn_t int_bitInvert(pPmObj_t pobj, pPmObj_t *r_pint);
 
-#ifdef HAVE_PRINT
 /**
  * Sends out an integer object in decimal notation with MSB first.
  * The number is preceded with a "-" when necessary.
  * @param pint Pointer to Int object
  */
 PmReturn_t int_printHex(pPmObj_t pint);
-#endif /* HAVE_PRINT */
 
 /**
  * Returns by reference an integer that is x raised to the power of y.

File src/vm/interp.c

                 }
                 continue;
 
-#ifdef HAVE_BACKTICK
             /* #244 Add support for the backtick operation (UNARY_CONVERT) */
             case UNARY_CONVERT:
                 retval = obj_repr(TOS, &pobj3);
                 PM_BREAK_IF_ERROR(retval);
                 TOS = pobj3;
                 continue;
-#endif /* HAVE_BACKTICK */
 
             case UNARY_INVERT:
                 /* Raise TypeError if it's not an int */
                 }
 #endif /* HAVE_FLOAT */
 
-#ifdef HAVE_REPLICATION
                 /* If it's a list replication operation */
                 else if ((OBJ_GET_TYPE(TOS) == OBJ_TYPE_INT)
                          && (OBJ_GET_TYPE(TOS1) == OBJ_TYPE_LST))
                     TOS = pobj3;
                     continue;
                 }
-#endif /* HAVE_REPLICATION */
 
                 /* Otherwise raise a TypeError */
                 PM_RAISE(retval, PM_RET_EX_TYPE);
             case BINARY_MODULO:
             case INPLACE_MODULO:
 
-#ifdef HAVE_STRING_FORMAT
                 /* If it's a string, perform string format */
                 if (OBJ_GET_TYPE(TOS1) == OBJ_TYPE_STR)
                 {
                     TOS = pobj3;
                     continue;
                 }
-#endif /* HAVE_STRING_FORMAT */
 
 #ifdef HAVE_FLOAT
                 if ((OBJ_GET_TYPE(TOS) == OBJ_TYPE_FLT)
                     }
 
                     pobj1 = TOS1;
-#ifdef HAVE_BYTEARRAY
+
                     /* If object is an instance, get the thing it contains */
                     if (OBJ_GET_TYPE(pobj1) == OBJ_TYPE_CLI)
                     {
                         PM_RETURN_IF_ERROR(retval);
                         pobj1 = pobj2;
                     }
-#endif /* HAVE_BYTEARRAY */
 
                     /* Ensure the index doesn't overflow */
                     C_ASSERT(((pPmInt_t)TOS)->val <= 0x0000FFFF);
                     continue;
                 }
 
-#ifdef HAVE_BYTEARRAY
                 /* If object is an instance, get the thing it contains */
                 if (OBJ_GET_TYPE(TOS1) == OBJ_TYPE_CLI)
                 {
                     PM_SP -= 3;
                     continue;
                 }
-#endif /* HAVE_BYTEARRAY */
 
                 /* TypeError for all else */
                 PM_RAISE(retval, PM_RET_EX_TYPE);
                 break;
 
-#ifdef HAVE_DEL
             case DELETE_SUBSCR:
 
                 if ((OBJ_GET_TYPE(TOS1) == OBJ_TYPE_LST)
                 PM_BREAK_IF_ERROR(retval);
                 PM_SP -= 2;
                 continue;
-#endif /* HAVE_DEL */
 
             case BINARY_LSHIFT:
             case INPLACE_LSHIFT:
                 PM_RAISE(retval, PM_RET_EX_TYPE);
                 break;
 
-#ifdef HAVE_PRINT
             case PRINT_EXPR:
                 /* Print interactive expression */
                 /* Fallthrough */
                 }
                 PM_BREAK_IF_ERROR(retval);
                 continue;
-#endif /* HAVE_PRINT */
 
             case BREAK_LOOP:
             {
                 PM_BREAK_IF_ERROR(heap_freeChunk(pobj1));
                 continue;
 
-#ifdef HAVE_IMPORTS
             case IMPORT_STAR:
                 /* #102: Implement the remaining IMPORT_ bytecodes */
                 /* Expect a module on the top of the stack */
                 PM_BREAK_IF_ERROR(retval);
                 PM_SP--;
                 continue;
-#endif /* HAVE_IMPORTS */
 
             case YIELD_VALUE:
                 /* #207: Add support for the yield keyword */
                 PM_SP--;
                 continue;
 
-#ifdef HAVE_DEL
             case DELETE_NAME:
                 /* Get key */
                 PUT_BC_ARG_INTO(t16);
                 retval = dict_delItem((pPmObj_t)PM_FP->fo_attrs, pobj2);
                 PM_BREAK_IF_ERROR(retval);
                 continue;
-#endif /* HAVE_DEL */
 
             case UNPACK_SEQUENCE:
                 /* Get ptr to sequence */
                 pobj1 = PM_POP();
 
-#ifdef HAVE_BYTEARRAY
                 /* If object is an instance, get the thing it contains */
                 if (OBJ_GET_TYPE(pobj1) == OBJ_TYPE_CLI)
                 {
                     PM_RETURN_IF_ERROR(retval);
                     pobj1 = pobj2;
                 }
-#endif /* HAVE_BYTEARRAY */
 
                 /*
                  * Get the length of the sequence; this will
                 PM_SP -= 2;
                 continue;
 
-#ifdef HAVE_DEL
             case DELETE_ATTR:
                 /* del TOS.name */
                 /* Get names index */
                 PM_BREAK_IF_ERROR(retval);
                 PM_SP--;
                 continue;
-#endif /* HAVE_DEL */
 
             case STORE_GLOBAL:
                 /* Get name index */
                 PM_SP--;
                 continue;
 
-#ifdef HAVE_DEL
             case DELETE_GLOBAL:
                 /* Get name index */
                 PUT_BC_ARG_INTO(t16);
                 retval = dict_delItem((pPmObj_t)PM_FP->fo_globals, pobj2);
                 PM_BREAK_IF_ERROR(retval);
                 continue;
-#endif /* HAVE_DEL */
 
             case DUP_TOPX:
                 PUT_BC_ARG_INTO(t16);
                 PM_FP = (pPmFrame_t)pobj3;
                 continue;
 
-#ifdef HAVE_IMPORTS
             case IMPORT_FROM:
                 /* #102: Implement the remaining IMPORT_ bytecodes */
                 /* Expect the module on the top of the stack */
                 /* Push the object onto the top of the stack */
                 PM_PUSH(pobj3);
                 continue;
-#endif /* HAVE_IMPORTS */
 
             case JUMP_FORWARD:
                 PUT_BC_ARG_INTO(t16);
                 PM_FP->fo_locals[t16] = PM_POP();
                 continue;
 
-#ifdef HAVE_DEL
             case DELETE_FAST:
                 PUT_BC_ARG_INTO(t16);
                 PM_FP->fo_locals[t16] = PM_NONE;
                 continue;
-#endif /* HAVE_DEL */
 
-#ifdef HAVE_ASSERT
             case RAISE_VARARGS:
                 PUT_BC_ARG_INTO(t16);
 
                 /* Raise exception by breaking with retval set to code */
                 PM_RAISE(retval, (PmReturn_t)(((pPmInt_t)pobj2)->val & 0xFF));
                 break;
-#endif /* HAVE_ASSERT */
 
             case CALL_FUNCTION:
                 /* Get num args */
                         ((pPmFrame_t)pobj2)->fo_locals[t16] = PM_POP();
                     }
 
-#ifdef HAVE_CLOSURES
                     /* #256: Add support for closures */
                     /* Copy arguments that become cellvars */
                     if (((pPmFunc_t)pobj1)->f_co->co_cellvars != C_NULL)
                             + ((((pPmFunc_t)pobj1)->f_co->co_cellvars == C_NULL) ? 0 : ((pPmFunc_t)pobj1)->f_co->co_cellvars->length)
                             + t8] = ((pPmFunc_t)pobj1)->f_closure->val[t8];
                     }
-#endif /* HAVE_CLOSURES */
 
                     /* Pop func obj */
                     pobj3 = PM_POP();
                         gVmGlobal.nativeframe.nf_locals[t16] = PM_POP();
                     }
 
-#ifdef HAVE_GC
                     /* If the heap is low on memory, run the GC */
                     if (heap_getAvail() < HEAP_GC_NF_THRESHOLD)
                     {
                         retval = heap_gcRun();
                         PM_GOTO_IF_ERROR(retval, CALL_FUNC_CLEANUP);
                     }
-#endif /* HAVE_GC */
 
                     /* Pop the function object */
                     PM_SP--;
                 PM_PUSH(pobj2);
                 continue;
 
-#ifdef HAVE_CLOSURES
             case MAKE_CLOSURE:
                 /* Get number of default args */
                 PUT_BC_ARG_INTO(t16);
                 PM_BREAK_IF_ERROR(retval);
                 PM_FP->fo_locals[t8 + t16] = PM_POP();
                 continue;
-#endif /* HAVE_CLOSURES */
 
 
             default:

File src/vm/list.c

 }
 
 
-#ifdef HAVE_PRINT
 PmReturn_t
 list_print(pPmObj_t plist)
 {
 
     return plat_putByte(']');
 }
-#endif /* HAVE_PRINT */
 
 
 PmReturn_t

File src/vm/list.h

  */
 PmReturn_t list_delItem(pPmObj_t plist, int16_t index);
 
-#ifdef HAVE_PRINT
 /**
  * Prints out a list. Uses obj_print() to print elements.
  *
  * @return Return status
  */
 PmReturn_t list_print(pPmObj_t pobj);
-#endif /* HAVE_PRINT */
 
 /**
  * Removes all items from the list and zeroes the length.

File src/vm/module.c

     ((pPmFunc_t)*pmod)->f_attrs = C_NULL;
     ((pPmFunc_t)*pmod)->f_globals = C_NULL;
     ((pPmFunc_t)*pmod)->f_defaultargs = C_NULL;
-
-#ifdef HAVE_CLOSURES
-    /* Clear field for closure tuple */
     ((pPmFunc_t)*pmod)->f_closure = C_NULL;
-#endif /* HAVE_CLOSURES */
 
     /* Alloc and init attrs dict */
     heap_gcPushTempRoot(*pmod, &objid);

File src/vm/obj.c

 int8_t
 obj_compare(pPmObj_t pobj1, pPmObj_t pobj2)
 {
-#ifdef HAVE_BYTEARRAY
     PmReturn_t retval;
     pPmObj_t pobj;
-#endif /* HAVE_BYTEARRAY */
 
     C_ASSERT(pobj1 != C_NULL);
     C_ASSERT(pobj2 != C_NULL);
         return C_DIFFER;
     }
 
-#ifdef HAVE_BYTEARRAY
     /* If object is an instance, get the thing it contains */
     if (OBJ_GET_TYPE(pobj1) == OBJ_TYPE_CLI)
     {
     {
         return C_DIFFER;
     }
-#endif /* HAVE_BYTEARRAY */
 
     /* Otherwise handle types individually */
     switch (OBJ_GET_TYPE(pobj1))
 
         case OBJ_TYPE_TUP:
         case OBJ_TYPE_LST:
-#ifdef HAVE_BYTEARRAY
         case OBJ_TYPE_BYA:
-#endif /* HAVE_BYTEARRAY */
             return seq_compare(pobj1, pobj2);
 
         case OBJ_TYPE_DIC:
 }
 
 
-#ifdef HAVE_PRINT
 PmReturn_t
 obj_print(pPmObj_t pobj, uint8_t is_expr_repr, uint8_t is_nested)
 {
             break;
 
         case OBJ_TYPE_CLI:
-#ifdef HAVE_BYTEARRAY
             {
                 pPmObj_t pobj2;
 
                     break;
                 }
             }
-#endif /* HAVE_BYTEARRAY */
 
         case OBJ_TYPE_COB:
         case OBJ_TYPE_MOD:
     }
     return retval;
 }
-#endif /* HAVE_PRINT */
 
 
-#ifdef HAVE_BACKTICK
 PmReturn_t
 obj_repr(pPmObj_t pobj, pPmObj_t *r_pstr)
 {
 
     return retval;
 }
-#endif /* HAVE_BACKTICK */

File src/vm/obj.h

     /** Dictionary (hash table) */
     OBJ_TYPE_DIC = 0x13,
 
-#ifdef HAVE_BYTEARRAY
     /** Bytearray (mutable) */
     OBJ_TYPE_BYA = 0x14,
-#endif /* HAVE_BYTEARRAY */
 
     /* All types after this are not accessible to the user */
     OBJ_TYPE_ACCESSIBLE_MAX = 0x18,
 
-#ifdef HAVE_BYTEARRAY
     /** Bytes (mutable container for Bytearray type) */
     OBJ_TYPE_BYS = 0x18,
-#endif /* HAVE_BYTEARRAY */
 
     /** Frame type */
     OBJ_TYPE_FRM = 0x19,
  */
 PmReturn_t obj_print(pPmObj_t pobj, uint8_t is_expr_repr, uint8_t is_nested);
 
-#ifdef HAVE_BACKTICK
 /**
  * Returns by reference a string object that is the human-readable
  * representation of the object. Used by the backtick operation (UNARY_CONVERT).
  * @return Return status
  */
 PmReturn_t obj_repr(pPmObj_t pobj, pPmObj_t *r_pstr);
-#endif /* HAVE_BACKTICK */
 
 #endif /* __OBJ_H__ */

File src/vm/seq.c

         l2 = ((pPmList_t)pobj2)->length;
     }
 
-#ifdef HAVE_BYTEARRAY
     else if (OBJ_GET_TYPE(pobj1) == OBJ_TYPE_BYA)
     {
         /* Return if the lengths differ */
                            l1)
                ? C_DIFFER : C_SAME;
     }
-#endif /* HAVE_BYTEARRAY */
-
     else
     {
         return C_DIFFER;
             *r_index = ((pPmList_t)pobj)->length;
             break;
 
-#ifdef HAVE_BYTEARRAY
         case OBJ_TYPE_BYA:
             *r_index = ((pPmBytearray_t)pobj)->length;
             break;
-#endif /* HAVE_BYTEARRAY */
 
         case OBJ_TYPE_DIC:
             *r_index = ((pPmDict_t)pobj)->length;
             retval = list_getItem(pobj, index, r_pobj);
             break;
 
-#ifdef HAVE_BYTEARRAY
         case OBJ_TYPE_BYA:
             retval = bytearray_getItem(pobj, index, r_pobj);
             break;
-#endif /* HAVE_BYTEARRAY */
 
         /* Issue #176 Add support to iterate over keys in a dict */
         case OBJ_TYPE_DIC:

File src/vm/strobj.c

 }
 
 
-#ifdef HAVE_PRINT
 PmReturn_t
 string_printFormattedBytes(uint8_t *pb, uint8_t is_escaped, uint16_t n)
 {
 
     return retval;
 }
-#endif /* HAVE_PRINT */
 
 
 PmReturn_t
 }
 
 
-#ifdef HAVE_STRING_FORMAT
 
 #define SIZEOF_FMTDBUF 42
 #define SIZEOF_SMALLFMT 8
     *r_pstring = (pPmObj_t)pnewstr;
     return PM_RET_OK;
 }
-#endif /* HAVE_STRING_FORMAT */

File src/vm/strobj.h

  */
 int8_t string_compare(pPmString_t pstr1, pPmString_t pstr2);
 
-#ifdef HAVE_PRINT
 /**
  * Sends out a string object bytewise. Escaping and framing is configurable
  * via is_escaped.
  * @return Return status
  */
 PmReturn_t string_print(pPmObj_t pstr, uint8_t is_escaped);
-#endif /* HAVE_PRINT */
 
 /**
  * Clears the string cache if one exists.
 PmReturn_t
 string_concat(pPmString_t pstr1, pPmString_t pstr2, pPmObj_t *r_pstring);
 
-#ifdef HAVE_STRING_FORMAT
 /**
  * Returns a new string object that is created from the given format string
  * and the argument(s).
 PmReturn_t string_printFormattedBytes(uint8_t *pb,
                                       uint8_t is_escaped,
                                       uint16_t n);
-#endif /* HAVE_STRING_FORMAT */
 
 #endif /* __STRING_H__ */

File src/vm/tuple.c

 }
 
 
-#ifdef HAVE_PRINT
 PmReturn_t
 tuple_print(pPmObj_t ptup)
 {
 
     return plat_putByte(')');
 }
-#endif /* HAVE_PRINT */

File src/vm/tuple.h

  */
 PmReturn_t tuple_getItem(pPmObj_t ptup, int16_t index, pPmObj_t *r_pobj);
 
-#ifdef HAVE_PRINT
 /**
  * Prints out a tuple. Uses obj_print() to print elements.
  *
  * @return Return status
  */
 PmReturn_t tuple_print(pPmObj_t pobj);
-#endif /* HAVE_PRINT */
 
 #endif /* __TUPLE_H__ */