added AVMFEATURE_FLOAT (requires SWF16, precludes AOT). Tried to fix AOT compilation, fix may be incomplete.
authorVirgil Palanciuc <virgilp@adobe.com>
Wed, 09 Nov 2011 18:44:25 +0200
changeset 6902 9e138314d408741f333dce3332dae973a5265b45
parent 6901 e7f048b5fdf2abb783f486a3ccfab0c2ef8be23e
child 6903 598ed23d4b256ebf7de37690aa366b664432c124
push id4075
push userlhansen@adobe.com
push dateTue, 20 Dec 2011 16:50:11 +0000
added AVMFEATURE_FLOAT (requires SWF16, precludes AOT). Tried to fix AOT compilation, fix may be incomplete.
aot/AOTStubs.h
build/avmfeatures.py
core/AbcParser.cpp
core/ArrayClass.cpp
core/AvmCore.cpp
core/CdeclThunk.cpp
core/FrameState.cpp
core/Traits.cpp
core/Verifier.cpp
core/avmfeatures.as
core/avmfeatures.cpp
core/avmfeatures.h
core/avmplusList.cpp
core/builtin.py
shell/avmshell-features.h
--- a/aot/AOTStubs.h
+++ b/aot/AOTStubs.h
@@ -2018,29 +2018,29 @@ template<typename rt> struct demote_nume
 //------------------------------------------------------------------------------
 
 template<typename rt, typename t1, typename t2>
 rt abcOP_add(MethodEnv *env DOUBLE_ALLOCA_DEF, t1 a, t2 b) {
 	if(both_numeric<t1, t2>::yes && is_numeric<rt>::yes)
 		return demote_numeric<rt>::convert(promote_numeric<rt, t1>::convert(a) + promote_numeric<rt, t2>::convert(b));
 	
 #ifdef VMCFG_OPTIMISTIC_DOUBLE_ATOM
-    return abcOP_unbox<rt>(env, env->toplevel()->add2(doubleAlloca, (Atom)abcOP_box<LLVMAtom, t1>(env, a), (Atom)abcOP_box<LLVMAtom, t2>(env, b)));
+    return abcOP_unbox<rt>(env, op_add(env->core(), doubleAlloca, (Atom)abcOP_box<LLVMAtom, t1>(env, a), (Atom)abcOP_box<LLVMAtom, t2>(env, b)));
 #else
-    return abcOP_unbox<rt> (env, env->toplevel()->add2((Atom) abcOP_box<LLVMAtom, t1> (env, a), (Atom) abcOP_box<LLVMAtom, t2> (env, b)));
+    return abcOP_unbox<rt> (env, op_add(env->core(), (Atom) abcOP_box<LLVMAtom, t1> (env, a), (Atom) abcOP_box<LLVMAtom, t2> (env, b)));
 #endif
 }
 
 #ifdef VMCFG_OPTIMISTIC_DOUBLE_ATOM
 template<typename rt, typename t1, typename t2>
 rt abcOP_add(MethodEnv *env, t1 a, t2 b) {
 	if(both_numeric<t1, t2>::yes && is_numeric<rt>::yes)
 		return demote_numeric<rt>::convert(promote_numeric<rt, t1>::convert(a) + promote_numeric<rt, t2>::convert(b));
 	
-    return abcOP_unbox<rt> (env, env->toplevel()->add2((Atom) abcOP_box<LLVMAtom, t1> (env, a), (Atom) abcOP_box<LLVMAtom, t2> (env, b)));
+    return abcOP_unbox<rt> (env, op_add(env->core(), (Atom) abcOP_box<LLVMAtom, t1> (env, a), (Atom) abcOP_box<LLVMAtom, t2> (env, b)));
 }
 #endif
 
 //------------------------------------------------------------------------------
 // OP_add_i
 //------------------------------------------------------------------------------
 
 template<typename rt, typename t1, typename t2>
--- a/build/avmfeatures.py
+++ b/build/avmfeatures.py
@@ -62,28 +62,30 @@ def featureSettings(o):
         args += "-DAVMFEATURE_ALLOCATION_SAMPLER=0 "
     arg = o.getBoolArg("vtune")
     if (arg == True):
         args += "-DAVMFEATURE_VTUNE=1 "
     if (arg == False):
         args += "-DAVMFEATURE_VTUNE=0 "
     if o.getBoolArg("jit"):
         args += "-DAVMFEATURE_JIT=1 -DAVMFEATURE_WORDCODE_INTERP=0 -DAVMFEATURE_AOT=0 "
+    if o.getBoolArg("float"):
+        args += "-DAVMFEATURE_FLOAT=1 -DAVMFEATURE_AOT=0 "
     arg = o.getBoolArg("osr")
     if (arg == True):
         args += "-DAVMFEATURE_OSR=1 "
     if (arg == False):
         args += "-DAVMFEATURE_OSR=0 "
     arg = o.getBoolArg("compilepolicy")
     if (arg == True):
         args += "-DAVMFEATURE_COMPILEPOLICY=1 "
     if (arg == False):
         args += "-DAVMFEATURE_COMPILEPOLICY=0 "
     if o.getBoolArg("aot"):
-        args += "-DAVMFEATURE_AOT=1 -DAVMFEATURE_JIT=0 -DAVMFEATURE_ABC_INTERP=0 -DAVMFEATURE_WORDCODE_INTERP=0 "
+        args += "-DAVMFEATURE_AOT=1 -DAVMFEATURE_JIT=0 -DAVMFEATURE_ABC_INTERP=0 -DAVMFEATURE_WORDCODE_INTERP=0 -DAVMFEATURE_FLOAT=0 "
     arg = o.getBoolArg("buffer-guard")
     if (arg == True):
         args += "-DAVMFEATURE_BUFFER_GUARD=1 "
     if (arg == False):
         args += "-DAVMFEATURE_BUFFER_GUARD=0 "
     if o.getBoolArg("abc-interp"):
         args += "-DAVMFEATURE_ABC_INTERP=1 -DAVMFEATURE_WORDCODE_INTERP=0 -DAVMFEATURE_AOT=0 "
     if o.getBoolArg("wordcode-interp"):
--- a/core/AbcParser.cpp
+++ b/core/AbcParser.cpp
@@ -132,17 +132,17 @@ namespace avmplus
         {
             const MethodDebugInfo* methodDebugInfos = aotInfo->methodDebugInfos;
 
             if(methodDebugInfos != NULL)
             {
                 // create the structure representing the ABC
                 AbcFile* abc = AbcFile::create(core->GetGC(), core, 0);
 
-                for(int n = 0; n < aotInfo->nABCMethods; n++)
+                for(int n = 0; n < (int)aotInfo->nABCMethods; n++)
                 {
                     MethodInfo *f = pool->getMethodInfo(n);
 
                     // create DMIs
                     const MethodDebugInfo &info = methodDebugInfos[n];
                     DebuggerMethodInfo* dmi = DebuggerMethodInfo::create(core, info.local_count, -1, info.scope_count);
                     pool->_method_dmi.set(n, dmi);
 
--- a/core/ArrayClass.cpp
+++ b/core/ArrayClass.cpp
@@ -1339,17 +1339,17 @@ namespace avmplus
         return ArrayObject::create(core()->GetGC(), ivtable(), prototypePtr(), capacity);
     }
 
 #ifdef VMCFG_AOT
     template <typename ADT>
     ArrayObject* ArrayClass::newArray(MethodEnv *env, ADT argDesc, va_list ap)
     {
         uint32_t argc = argDescArgCount(argDesc);
-        AvmAssert(argc >= 0);
+        // removed assert, argc is unsigned!
         return ArrayObject::create<ADT>(core()->GetGC(), ivtable(), prototypePtr(), env, argDesc, argc, ap);
     }
 
     template ArrayObject* ArrayClass::newArray(MethodEnv *env, uint32_t argDesc, va_list ap);
     template ArrayObject* ArrayClass::newArray(MethodEnv *env, char* argDesc, va_list ap);
 #endif
 
     /*static*/ int ArrayClass::generic_indexOf(Atom thisAtom, Atom searchElement, int startIndex)
--- a/core/AvmCore.cpp
+++ b/core/AvmCore.cpp
@@ -745,17 +745,17 @@ namespace avmplus
     static void initScriptActivationTraits(AvmCore* core, Toplevel* toplevel, MethodInfo* method)
     {
 #ifdef VMCFG_AOT
         PoolObject* pool = method->pool();
         const AOTInfo* aotInfo = pool->aotInfo;
         if (method->needActivation()) {
             Traits* activationTraits = method->activationTraits();
             AvmAssert(activationTraits != NULL);
-            AvmAssert(method->method_id() < aotInfo->nActivationTraits);
+            AvmAssert(method->method_id() < (int)aotInfo->nActivationTraits);
             aotInfo->activationTraits[method->method_id()] = activationTraits;
             if (aotInfo->activationInfo[method->method_id()].initHandler != NULL) {
                 // NativeMethodInfo.handler is a union of
                 // pointer to function and pointer to member function.
                 // Zero the structure so that the entire thing is
                 // initialized.
                 // See bugzilla#647660
                 NativeMethodInfo compiledMethodInfo = {{0}, 0, 0};
--- a/core/CdeclThunk.cpp
+++ b/core/CdeclThunk.cpp
@@ -191,17 +191,16 @@ namespace avmplus
         kINT,
         kUINT,
         kBOOLEAN,
         kANY,
         kNAMESPACE,
         kVECTORINT,
         kVECTORUINT,
         kVECTORDOUBLE,
-        kVECTORFLOAT,
         kVECTOROBJ,
         
         
         
         kLASTENUMELEMENT/// KEEP THIS ONE THE LAST, SO THAT THE ASSERTION WORKS!
     };
     /* using MMGC_STATIC_ASSERT for lack of a better one */
     MMGC_STATIC_ASSERT(kLASTENUMELEMENT <=16); 
@@ -220,17 +219,16 @@ namespace avmplus
         case kUINT: return UINT_TYPE;
         case kBOOLEAN: return BOOLEAN_TYPE;
         case kVOID: return VOID_TYPE;
         case kANY: return NULL;
         case kNAMESPACE: return NAMESPACE_TYPE;
         case kVECTORINT: return VECTORINT_TYPE;
         case kVECTORUINT: return VECTORUINT_TYPE;
         case kVECTORDOUBLE: return VECTORDOUBLE_TYPE;
-        case kVECTORFLOAT: return VECTORFLOAT_TYPE;
         case kVECTOROBJ: return VECTOROBJ_TYPE;
         }
         AvmAssert(false); // shouldn't happen...
         return NULL;
     }
 
     // iterates over callee types for a method's signature
     class MethodSigArgDescIter
@@ -568,20 +566,16 @@ namespace avmplus
             case BUILTIN_int:
             case BUILTIN_uint:
             case BUILTIN_boolean:
                 l.int32Arg();
                 break;
             case BUILTIN_number:
                 l.doubleArg();
                 break;
-            case BUILTIN_float:
-            case BUILTIN_float4:
-                AvmAssertMsg(false,"Not implemented yet!");
-                break;
             default:
                 l.ptrArg();
                 break;
             }
         }
         if (calleeTypeIter.needArguments() || calleeTypeIter.hasRest())
         {
             l.ptrArg(); // argv
@@ -617,20 +611,16 @@ namespace avmplus
             case BUILTIN_int:
             case BUILTIN_uint:
             case BUILTIN_boolean:
                 size += sizeof(int32_t);
                 break;
             case BUILTIN_number:
                 size += sizeof(double);
                 break;
-            case BUILTIN_float:
-            case BUILTIN_float4:
-                AvmAssertMsg(false,"Not implemented yet!");
-                break;
             default:
                 size += sizeof(void*);
                 break;
             }
         }
         // count the rest as pointers (Atoms)
         while (callerTypeIter.nextType() != VOID_TYPE)
             size += sizeof(void*);
--- a/core/FrameState.cpp
+++ b/core/FrameState.cpp
@@ -37,22 +37,18 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 
 #include "avmplus.h"
 
 namespace avmplus
 {
-#ifdef VMCFG_FLOAT
     FrameState::FrameState(MethodSignaturep ms, MethodInfo* mi)
         : info(mi),
-#else
-    FrameState::FrameState(MethodSignaturep ms) :
-#endif // VMCFG_FLOAT
           wl_next(NULL), abc_pc(NULL),
           scopeDepth(0), stackDepth(0), withBase(-1),
           frameSize(ms->frame_size()),
           scopeBase(ms->scope_base()),
           stackBase(ms->stack_base()),
           targetOfBackwardsBranch(false),
           wl_pending(false)
     {
--- a/core/Traits.cpp
+++ b/core/Traits.cpp
@@ -1763,17 +1763,17 @@ namespace avmplus
 #ifdef VMCFG_AOT
     static inline void hookUpActivationTraitsInitMethodForTraitsMethod(AvmCore* core, MethodInfo* m)
     {
         AvmAssert(m->needActivation());
 
         const AOTInfo* aotInfo = m->pool()->aotInfo;
         Traits* activationTraits = m->activationTraits();
         AvmAssert(activationTraits != NULL);
-        AvmAssert(m->method_id() < aotInfo->nActivationTraits);
+        AvmAssert(m->method_id() < (int)aotInfo->nActivationTraits);
         AvmAssert(aotInfo->activationTraits != NULL);
         AvmAssert(aotInfo->activationTraits[m->method_id()] == activationTraits);
         AvmAssert(aotInfo->activationInfo != NULL);
 
         // See comment in initActivationTraits about why this can be called more than once per Traits
         if (activationTraits->init == NULL) {
             if (aotInfo->activationInfo[m->method_id()].initHandler) {
                 // NativeMethodInfo.handler is a union of
--- a/core/Verifier.cpp
+++ b/core/Verifier.cpp
@@ -1282,21 +1282,21 @@ namespace avmplus
                 state->setType(imm30, NULL, false);
                 break;
             }
 
             case OP_inclocal:
             case OP_declocal:
             {
                 Traits* retType = NUMBER_TYPE;
-                FrameValue& v = checkLocal(imm30);
                 bool already_coerced = false;
 #ifdef VMCFG_FLOAT
                 if(pool->hasFloatSupport())
                 {
+                    FrameValue& v = checkLocal(imm30);
                     Traits* vt = v.traits;
                     if(!vt || !vt->isNumeric())
                     {
                         emitCoerceToNumeric(imm30);
                         retType = OBJECT_TYPE;
                         already_coerced = true;
                     }
                     else if(vt == FLOAT_TYPE || vt == FLOAT4_TYPE)
--- a/core/avmfeatures.as
+++ b/core/avmfeatures.as
@@ -464,16 +464,25 @@ var FEATURES =
       <name> AVMSYSTEM_SH4 </name>
      </exactly-one>
     </requires>
     <defines> VMCFG_NANOJIT  </defines>
     <defines> VMCFG_LOOKUP_CACHE </defines>
     <defines> FEATURE_NANOJIT </defines> <!-- referenced by nanojit module only -->
   </feature>
 
+
+  <feature>
+    <desc> Enables the types 'float' and 'float4' in the VM. </desc>
+    <name> AVMFEATURE_FLOAT  </name>
+    <requires> AVMFEATURE_SWF16 </requires>
+    <defines> VMCFG_FLOAT  </defines>
+    <precludes> AVMFEATURE_AOT </precludes> <!--  -->
+  </feature>
+
   <feature>
     <desc> Enables delayed JIT-compilation with on-stack replacement.
            The default OSR compilation strategy either compiles a method eagerly
            or interprets it always, thus the OSR invocation threshold must be
            separately configured at runtime to obtain meaningful results. </desc>
 
     <name> AVMFEATURE_OSR  </name>
     <requires> AVMFEATURE_JIT </requires>
@@ -588,16 +597,23 @@ var FEATURES =
 
   <at-most-one>
     <!-- AOT currently implies no JIT or Interpreter, but this could be fixed
          in the future if necessary -->
     <name> AVMFEATURE_AOT </name>
     <name> AVMFEATURE_WORDCODE_INTERP </name>
   </at-most-one>
 
+  <at-most-one>
+    <!-- AOT currently implies no float support; this will presumably be fixed
+         in the future. -->
+    <name> AVMFEATURE_AOT </name>
+    <name> AVMFEATURE_FLOAT </name>
+  </at-most-one>
+
   <feature>
    <desc> AVMFEATURE_SELFTEST enables the built-in selftests.  These can be run by -Dselftest
           at the shell or by calling the global function avmplus::selftests(), see extensions/Selftest.h.
           Mostly they are useful for AVM development, not for embedders.
 
           Apart from code size considerations this can be enabled for release builds.  </desc>
 
    <name>     AVMFEATURE_SELFTEST </name>
@@ -743,17 +759,16 @@ var FEATURES =
     <defines> VMCFG_SWF15 </defines>
     <requires> AVMFEATURE_SWF14 </requires>
   </feature>
 
   <feature>
     <desc> Enabling this will support SWF16 / ABC version 47.16 </desc>
     <name> AVMFEATURE_SWF16 </name>
     <defines> VMCFG_SWF16 </defines>
-    <defines> VMCFG_FLOAT </defines> 
     <requires> AVMFEATURE_SWF15 </requires>
   </feature>
 
   <feature>
     <desc> Enabling this will support SWF17 / ABC version 47.17 </desc>
     <name> AVMFEATURE_SWF17 </name>
     <defines> VMCFG_SWF17 </defines>
     <requires> AVMFEATURE_SWF16 </requires>
--- a/core/avmfeatures.cpp
+++ b/core/avmfeatures.cpp
@@ -114,16 +114,19 @@ const char * const avmfeatures = ""
     "AVMFEATURE_ALLOCATION_SAMPLER;"
   #endif
   #if AVMFEATURE_VTUNE
     "AVMFEATURE_VTUNE;"
   #endif
   #if AVMFEATURE_JIT
     "AVMFEATURE_JIT;"
   #endif
+  #if AVMFEATURE_FLOAT
+    "AVMFEATURE_FLOAT;"
+  #endif
   #if AVMFEATURE_OSR
     "AVMFEATURE_OSR;"
   #endif
   #if AVMFEATURE_COMPILEPOLICY
     "AVMFEATURE_COMPILEPOLICY;"
   #endif
   #if AVMFEATURE_AOT
     "AVMFEATURE_AOT;"
--- a/core/avmfeatures.h
+++ b/core/avmfeatures.h
@@ -82,16 +82,17 @@
 #undef DEBUGGER
 #undef VMCFG_DEBUGGER_STUB
 #undef AVMPLUS_SAMPLER
 #undef VMCFG_VTUNE
 #undef AVMPLUS_VERBOSE
 #undef VMCFG_NANOJIT
 #undef VMCFG_LOOKUP_CACHE
 #undef FEATURE_NANOJIT
+#undef VMCFG_FLOAT
 #undef VMCFG_OSR
 #undef VMCFG_COMPILEPOLICY
 #undef VMCFG_AOT
 #undef VMCFG_AOTSHELL
 #undef VMCFG_CDECL
 #undef VMCFG_BUFFER_GUARD
 #undef VMCFG_MACH_EXCEPTIONS
 #undef VMCFG_INTERPRETER
@@ -113,17 +114,16 @@
 #undef VMCFG_CACHE_GQCN
 #undef MMGC_VALGRIND
 #undef VMCFG_SAFEPOINTS
 #undef VMCFG_SWF12
 #undef VMCFG_SWF13
 #undef VMCFG_SWF14
 #undef VMCFG_SWF15
 #undef VMCFG_SWF16
-#undef VMCFG_FLOAT
 #undef VMCFG_SWF17
 #undef VMCFG_SWF18
 #undef VMCFG_SWF19
 #undef VMCFG_SWF20
 
 #undef VMCFG_TWEAK_SIN_COS_NONFINITE
 #undef VMCFG_EPOC_EMULATOR
 #undef VMCFG_EXACT_TRACING
@@ -423,16 +423,25 @@
  * Enables the just-in-time compiler.  This will typically increase performance
  * significantly but may result in significantly higher memory consumption.
  */
 #if !defined AVMFEATURE_JIT || AVMFEATURE_JIT != 0 && AVMFEATURE_JIT != 1
 #  error "AVMFEATURE_JIT must be defined and 0 or 1 (only)."
 #endif
 
 
+/* AVMFEATURE_FLOAT
+ *
+ * Enables the types 'float' and 'float4' in the VM.
+ */
+#if !defined AVMFEATURE_FLOAT || AVMFEATURE_FLOAT != 0 && AVMFEATURE_FLOAT != 1
+#  error "AVMFEATURE_FLOAT must be defined and 0 or 1 (only)."
+#endif
+
+
 /* AVMFEATURE_OSR
  *
  * Enables delayed JIT-compilation with on-stack replacement.
  * The default OSR compilation strategy either compiles a method eagerly
  * or interprets it always, thus the OSR invocation threshold must be
  * separately configured at runtime to obtain meaningful results.
  */
 #if !defined AVMFEATURE_OSR || AVMFEATURE_OSR != 0 && AVMFEATURE_OSR != 1
@@ -877,16 +886,24 @@
 #  endif
 #endif
 #if AVMFEATURE_JIT
 #if AVMSYSTEM_IA32+AVMSYSTEM_AMD64+AVMSYSTEM_ARM+AVMSYSTEM_PPC+AVMSYSTEM_SPARC+AVMSYSTEM_MIPS+AVMSYSTEM_SH4 != 1
 #  error "Exactly one of AVMSYSTEM_IA32,AVMSYSTEM_AMD64,AVMSYSTEM_ARM,AVMSYSTEM_PPC,AVMSYSTEM_SPARC,AVMSYSTEM_MIPS,AVMSYSTEM_SH4 must be defined."
 #endif
 
 #endif
+#if AVMFEATURE_FLOAT
+#  if !AVMFEATURE_SWF16
+#    error "AVMFEATURE_SWF16 is required for AVMFEATURE_FLOAT"
+#  endif
+#  if AVMFEATURE_AOT
+#    error "AVMFEATURE_AOT is precluded for AVMFEATURE_FLOAT"
+#  endif
+#endif
 #if AVMFEATURE_OSR
 #  if !AVMFEATURE_JIT
 #    error "AVMFEATURE_JIT is required for AVMFEATURE_OSR"
 #  endif
 #endif
 #if AVMFEATURE_COMPILEPOLICY
 #  if !AVMFEATURE_JIT
 #    error "AVMFEATURE_JIT is required for AVMFEATURE_COMPILEPOLICY"
@@ -990,16 +1007,19 @@
 #  error "At most one of AVMFEATURE_AOT,AVMFEATURE_JIT must be defined."
 #endif
 #if AVMFEATURE_AOT+AVMFEATURE_ABC_INTERP > 1
 #  error "At most one of AVMFEATURE_AOT,AVMFEATURE_ABC_INTERP must be defined."
 #endif
 #if AVMFEATURE_AOT+AVMFEATURE_WORDCODE_INTERP > 1
 #  error "At most one of AVMFEATURE_AOT,AVMFEATURE_WORDCODE_INTERP must be defined."
 #endif
+#if AVMFEATURE_AOT+AVMFEATURE_FLOAT > 1
+#  error "At most one of AVMFEATURE_AOT,AVMFEATURE_FLOAT must be defined."
+#endif
 #if AVMTWEAK_EXACT_TRACING+AVMTWEAK_SELECTABLE_EXACT_TRACING > 1
 #  error "At most one of AVMTWEAK_EXACT_TRACING,AVMTWEAK_SELECTABLE_EXACT_TRACING must be defined."
 #endif
 
 #if AVMSYSTEM_UNIX+AVMSYSTEM_MAC+AVMSYSTEM_WIN32+AVMSYSTEM_SYMBIAN != 1
 #  error "Exactly one of AVMSYSTEM_UNIX,AVMSYSTEM_MAC,AVMSYSTEM_WIN32,AVMSYSTEM_SYMBIAN must be defined."
 #endif
 
@@ -1133,16 +1153,19 @@
 #  define VMCFG_NANOJIT
 #endif
 #if AVMFEATURE_JIT
 #  define VMCFG_LOOKUP_CACHE
 #endif
 #if AVMFEATURE_JIT
 #  define FEATURE_NANOJIT
 #endif
+#if AVMFEATURE_FLOAT
+#  define VMCFG_FLOAT
+#endif
 #if AVMFEATURE_OSR
 #  define VMCFG_OSR
 #endif
 #if AVMFEATURE_COMPILEPOLICY
 #  define VMCFG_COMPILEPOLICY
 #endif
 #if AVMFEATURE_AOT
 #  define VMCFG_AOT
@@ -1226,19 +1249,16 @@
 #  define VMCFG_SWF14
 #endif
 #if AVMFEATURE_SWF15
 #  define VMCFG_SWF15
 #endif
 #if AVMFEATURE_SWF16
 #  define VMCFG_SWF16
 #endif
-#if AVMFEATURE_SWF16
-#  define VMCFG_FLOAT
-#endif
 #if AVMFEATURE_SWF17
 #  define VMCFG_SWF17
 #endif
 #if AVMFEATURE_SWF18
 #  define VMCFG_SWF18
 #endif
 #if AVMFEATURE_SWF19
 #  define VMCFG_SWF19
--- a/core/avmplusList.cpp
+++ b/core/avmplusList.cpp
@@ -50,13 +50,15 @@ namespace avmplus
     template class ListImpl<MMgc::RCObject*, RCListHelper>;
     template class ListImpl<MMgc::GCObject*, WeakRefListHelper>;
     template class ListImpl<Atom, AtomListHelper>;
     template class ListImpl< UnmanagedPointer, DataListHelper<UnmanagedPointer> >;
     template class ListImpl< uint8_t, DataListHelper<uint8_t> >;
     template class ListImpl< int32_t, DataListHelper<int32_t> >;
     template class ListImpl< uint32_t, DataListHelper<uint32_t> >;
     template class ListImpl< uint64_t, DataListHelper<uint64_t> >;
+#ifdef VMCFG_FLOAT
     template class ListImpl< float, DataListHelper<float> >;
     template class ListImpl< float4_t, DataListHelper<float4_t> >;
+#endif    
     template class ListImpl< double, DataListHelper<double> >;
     template class ListImpl< char, DataListHelper<char> >;
 }
--- a/core/builtin.py
+++ b/core/builtin.py
@@ -58,17 +58,20 @@ if classpath == None:
     #exit(1)
 
 javacmd = "java -ea -DAS3 -DAVMPLUS -classpath "+classpath
 asc = javacmd+" macromedia.asc.embedding.ScriptCompiler "
 
 print("ASC="+classpath)
 print("Building builtins...")
 
-configs = "-config CONFIG::VMCFG_FLOAT=true"
+VMCFG_FLOAT = os.environ.get('VMCFG_FLOAT')
+if VMCFG_FLOAT == None:
+    VMCFG_FLOAT = "true"
+configs = "-config CONFIG::VMCFG_FLOAT="+VMCFG_FLOAT
 
 os.system(asc+"-abcfuture -builtin "+configs+" -apiversioning -out builtin builtin.as Math.as Error.as Date.as RegExp.as JSON.as XML.as IDataInput.as IDataOutput.as ByteArray.as Proxy.as ")
 
 rm("builtin.h")
 rm("builtin.cpp")
 mv("builtin.abc", "../generated/builtin.abc")
 
 print("Generating native thunks...")
--- a/shell/avmshell-features.h
+++ b/shell/avmshell-features.h
@@ -241,16 +241,20 @@
 #ifndef AVMFEATURE_SWF15
   #define AVMFEATURE_SWF15 1
 #endif
 
 #ifndef AVMFEATURE_SWF16
   #define AVMFEATURE_SWF16 1
 #endif
 
+#ifndef AVMFEATURE_FLOAT
+  #define AVMFEATURE_FLOAT 1
+#endif
+
 #ifndef AVMFEATURE_SWF17
   #define AVMFEATURE_SWF17 0
 #endif
 
 #ifndef AVMFEATURE_SWF18
   #define AVMFEATURE_SWF18 0
 #endif