Browse Source

Disable the JIT if requested in the test_harness

jonathanvdc 8 years ago
parent
commit
91501583d1
1 changed files with 11 additions and 1 deletions
  1. 11 1
      performance/code/test_harness.alc

+ 11 - 1
performance/code/test_harness.alc

@@ -3,6 +3,13 @@ include "jit.alh"
 
 Void function test_main()
 
+Void function call_function(function_name : String):
+	// Resolve the specified function, and execute it.
+	Element func
+	func = resolve(function_name)
+	func()
+	return!
+
 Void function main():
 	String config
 	Integer start_time
@@ -12,7 +19,10 @@ Void function main():
 		set_jit_enabled(False)
 
 	start_time = time()
-	test_main()
+	// HACK: use `call_function` to hide what would otherwise be a direct call to `test_main`
+	// from the JIT. This prevents the JIT from compiling `test_main` _before_ `config` has
+	// been analyzed.
+	call_function("test_main")
 	end_time = time()
 	output(end_time - start_time)