63 return str.indexOf(suffix, str.length - suffix.length) !== -1; |
63 return str.indexOf(suffix, str.length - suffix.length) !== -1; |
64 } |
64 } |
65 |
65 |
66 function run_one_benchmark(arg, iters) { |
66 function run_one_benchmark(arg, iters) { |
67 |
67 |
68 load(path + 'base.js'); |
|
69 load(arg); |
|
70 |
|
71 var file_name; |
68 var file_name; |
72 |
|
73 var file = arg.split('/'); |
69 var file = arg.split('/'); |
74 if (file.length == 1) { |
70 if (file.length == 1) { |
75 file = arg.split('\\'); |
71 file = arg.split('\\'); |
76 } |
72 } |
77 |
73 |
78 //trim off trailing path separators |
74 //trim off trailing path separators |
79 while (file[file.length - 1].indexOf(".js") == -1) { |
75 while (file[file.length - 1].indexOf(".js") == -1) { |
80 file.pop(); |
76 file.pop(); |
81 } |
77 } |
82 file_name = file[file.length - 1]; |
78 file_name = file[file.length - 1]; |
|
79 |
|
80 if (typeof compile_only !== 'undefined') { |
|
81 print("Compiling... " + file_name); |
|
82 } |
|
83 |
|
84 load(path + 'base.js'); |
|
85 load(arg); |
83 |
86 |
84 if (typeof compile_only !== 'undefined') { |
87 if (typeof compile_only !== 'undefined') { |
85 print("Compiled OK: " + file_name); |
88 print("Compiled OK: " + file_name); |
|
89 print(""); |
86 return; |
90 return; |
87 } |
91 } |
88 |
92 |
89 var success = true; |
93 var success = true; |
90 var hiscore = 0; |
94 var hiscore = 0; |