<commit_before>import sys
import subprocess

if __name__ == "__main__":
    PATH="benchmarks/sunspider/tests/sunspider-0.9.1/"
    subprocess.call(["make", "photon"], stdout=1)

    args = [];
    verbose = False

    for i in range(1, len(sys.argv)):
        arg = sys.argv[i]
        if arg == "-v":
            verbose = True
        else:
            args.append(arg)

    if len(args) == 0:
        args = [
            "3d-cube",
            "3d-morph",
            "3d-raytrace",
            "access-binary-trees",
            "access-fannkuch",
            "access-nbody",
            "access-nsieve",
            "bitops-3bit-bits-in-byte",
            "bitops-bits-in-byte",
            "bitops-bitwise-and",
            "bitops-nsieve-bits",
            "controlflow-recursive",
            "crypto-aes",
            "crypto-md5",
            "crypto-sha1",
            "math-cordic",
            "math-partial-sums",
            "math-spectral-norm",
            "regexp-dna",
            "string-base64",
            "string-fasta",
            "string-tagcloud",
            "string-unpack-code",
            "string-validate-input"
        ]

    for i in range(0, len(args)):
        TEST=args[i]
        fout0 = file("/tmp/log.txt", "w")
        subprocess.call(["d8", "%s/%s.js"%(PATH,TEST), "%s/%s-check.js"%(PATH,TEST)], stdout=fout0)
        fout0.close()
        fout1 = file("/tmp/log2.txt", "w")
        subprocess.call(["d8", "/Users/erick/Recherche/photon-js/photon-js.js", "--expose_gc", "--", "%s/%s.js"%(PATH,TEST), "%s/%s-check.js"%(PATH,TEST)], stdout=fout1)
        fout1.close()
        
        if verbose:
            option = "-n"
        else:
            option = "-q"

        ret = subprocess.call(["diff", option, "/tmp/log.txt", "/tmp/log2.txt"], stderr=None, stdout=None)
        if ret == 0:
            status = "ok"<commit_msg>Added a commandline option for activating inline caches<commit_after>import sys
import subprocess

if __name__ == "__main__":
    PATH="benchmarks/sunspider/tests/sunspider-0.9.1/"
    subprocess.call(["make", "photon"], stdout=1)

    args = [];
    verbose = False
    use_ic = False

    for i in range(1, len(sys.argv)):
        arg = sys.argv[i]
        if arg == "-v":
            verbose = True
        elif arg == "--use_ic":
            use_ic = True
        else:
            args.append(arg)

    if len(args) == 0:
        args = [
            "3d-cube",
            "3d-morph",
            "3d-raytrace",
            "access-binary-trees",
            "access-fannkuch",
            "access-nbody",
            "access-nsieve",
            "bitops-3bit-bits-in-byte",
            "bitops-bits-in-byte",
            "bitops-bitwise-and",
            "bitops-nsieve-bits",
            "controlflow-recursive",
            "crypto-aes",
            "crypto-md5",
            "crypto-sha1",
            "math-cordic",
            "math-partial-sums",
            "math-spectral-norm",
            "regexp-dna",
            "string-base64",
            "string-fasta",
            "string-tagcloud",
            "string-unpack-code",
            "string-validate-input"
        ]

    for i in range(0, len(args)):
        TEST=args[i]
        fout0 = file("/tmp/log.txt", "w")
        subprocess.call(["d8", "%s/%s.js"%(PATH,TEST), "%s/%s-check.js"%(PATH,TEST)], stdout=fout0)
        fout0.close()
        fout1 = file("/tmp/log2.txt", "w")
        subprocess.call(["d8", "/Users/erick/Recherche/photon-js/photon-js.js", "--expose_gc", "--", "%s/%s.js"%(PATH,TEST), "%s/%s-check.js"%(PATH,TEST)] + (["--use_ic"] if use_ic else []), stdout=fout1)
        fout1.close()
        
        if verbose:
            option = "-n"
        else:
            option = "-q"

        ret = subprocess.call(["diff", option, "/tmp/log.txt", "/tmp/log2.txt"], stderr=None, stdout=None)
        if ret == 0:
            status = "ok"
{'fraction_non_alphanumeric': 0.17692307692307693, 'fraction_numerical': 0.013333333333333334, 'mean_word_length': 1.5972037283621838, 'pattern_counts': {'":': 5, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4284027', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1313, 'n_words': 215}