Преглед на файлове

Add jit option to cppia host

Hugh преди 8 години
родител
ревизия
765963c5e8
променени са 2 файла, в които са добавени 11 реда и са изтрити 1 реда
  1. 10 1
      std/cpp/cppia/Host.hx
  2. 1 0
      tests/RunCi.hx

+ 10 - 1
std/cpp/cppia/Host.hx

@@ -31,6 +31,10 @@ class Host
       module.run();
    }
 
+
+   @:native("hx::EnableJit")
+   @:extern public static function enableJit(enable:Bool) : Void { }
+
    public static function runFile(filename:String)
    {
       run( sys.io.File.getContent(filename) );
@@ -39,7 +43,12 @@ class Host
 
    public static function main()
    {
-      var script = Sys.args()[0];
+      var args = Sys.args();
+      if (args.remove("-jit"))
+         enableJit(true);
+
+      var script = args[0];
+
       #if (!scriptable && !doc_gen)
       #error "Please define scriptable to use cppia"
       #end

+ 1 - 0
tests/RunCi.hx

@@ -888,6 +888,7 @@ class RunCi {
 								runCommand("haxe", ["compile-cppia-host.hxml"]);
 								runCommand("haxe", ["compile-cppia.hxml"]);
 								runCpp("bin/cppia/Host-debug", ["bin/unit.cppia"]);
+								runCpp("bin/cppia/Host-debug", ["bin/unit.cppia", "-jit"]);
 						}
 
 						changeDirectory(sysDir);