summaryrefslogtreecommitdiffstats
path: root/cmdline
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-02-17 10:38:49 -0800
committerMathieu Chartier <mathieuc@google.com>2015-02-23 16:45:49 -0800
commit2535abe7d1fcdd0e6aca782b1f1932a703ed50a4 (patch)
tree140026ff9638ff34050680b6c706b82fa1740b56 /cmdline
parent38fee8ef4bc0f4dbe2c6d1f5585895f0c4d16984 (diff)
downloadart-2535abe7d1fcdd0e6aca782b1f1932a703ed50a4.zip
art-2535abe7d1fcdd0e6aca782b1f1932a703ed50a4.tar.gz
art-2535abe7d1fcdd0e6aca782b1f1932a703ed50a4.tar.bz2
Add JIT
Currently disabled by default unless -Xjit is passed in. The proposed JIT is a method JIT which works by utilizing interpreter instrumentation to request compilation of hot methods async during runtime. JIT options: -Xjit / -Xnojit -Xjitcodecachesize:N -Xjitthreshold:integervalue The JIT has a shared copy of a compiler driver which is accessed by worker threads to compile individual methods. Added JIT code cache and data cache, currently sized at 2 MB capacity by default. Most apps will only fill a small fraction of this cache however. Added support to the compiler for compiling interpreter quickened byte codes. Added test target ART_TEST_JIT=TRUE and --jit for run-test. TODO: Clean up code cache. Delete compiled methods after they are added to code cache. Add more optimizations related to runtime checks e.g. direct pointers for invokes. Add method recompilation. Move instrumentation to DexFile to improve performance and reduce memory usage. Bug: 17950037 Change-Id: Ifa5b2684a2d5059ec5a5210733900aafa3c51bca
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/cmdline_parser_test.cc25
-rw-r--r--cmdline/cmdline_types.h2
2 files changed, 24 insertions, 3 deletions
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc
index 288f7ac..9c248d4 100644
--- a/cmdline/cmdline_parser_test.cc
+++ b/cmdline/cmdline_parser_test.cc
@@ -410,6 +410,26 @@ TEST_F(CmdlineParserTest, TestCompilerOption) {
} // TEST_F
/*
+* -Xjit, -Xnojit, -Xjitcodecachesize, Xjitcompilethreshold
+*/
+TEST_F(CmdlineParserTest, TestJitOptions) {
+ /*
+ * Test successes
+ */
+ {
+ EXPECT_SINGLE_PARSE_VALUE(true, "-Xjit", M::UseJIT);
+ EXPECT_SINGLE_PARSE_VALUE(false, "-Xnojit", M::UseJIT);
+ }
+ {
+ EXPECT_SINGLE_PARSE_VALUE(MemoryKiB(16 * KB), "-Xjitcodecachesize:16K", M::JITCodeCacheCapacity);
+ EXPECT_SINGLE_PARSE_VALUE(MemoryKiB(16 * MB), "-Xjitcodecachesize:16M", M::JITCodeCacheCapacity);
+ }
+ {
+ EXPECT_SINGLE_PARSE_VALUE(12345u, "-Xjitthreshold:12345", M::JITCompileThreshold);
+ }
+} // TEST_F
+
+/*
* -X-profile-*
*/
TEST_F(CmdlineParserTest, TestProfilerOptions) {
@@ -494,9 +514,8 @@ TEST_F(CmdlineParserTest, TestIgnoredArguments) {
"-dsa", "-enablesystemassertions", "-disablesystemassertions", "-Xrs", "-Xint:abdef",
"-Xdexopt:foobar", "-Xnoquithandler", "-Xjnigreflimit:ixnay", "-Xgenregmap", "-Xnogenregmap",
"-Xverifyopt:never", "-Xcheckdexsum", "-Xincludeselectedop", "-Xjitop:noop",
- "-Xincludeselectedmethod", "-Xjitthreshold:123", "-Xjitcodecachesize:12345",
- "-Xjitblocking", "-Xjitmethod:_", "-Xjitclass:nosuchluck", "-Xjitoffset:none",
- "-Xjitconfig:yes", "-Xjitcheckcg", "-Xjitverbose", "-Xjitprofile",
+ "-Xincludeselectedmethod", "-Xjitblocking", "-Xjitmethod:_", "-Xjitclass:nosuchluck",
+ "-Xjitoffset:none", "-Xjitconfig:yes", "-Xjitcheckcg", "-Xjitverbose", "-Xjitprofile",
"-Xjitdisableopt", "-Xjitsuspendpoll", "-XX:mainThreadStackSize=1337"
};
diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h
index 180baec..04ea368 100644
--- a/cmdline/cmdline_types.h
+++ b/cmdline/cmdline_types.h
@@ -585,6 +585,8 @@ struct CmdlineType<LogVerbosity> : CmdlineTypeParser<LogVerbosity> {
log_verbosity.heap = true;
} else if (verbose_options[j] == "jdwp") {
log_verbosity.jdwp = true;
+ } else if (verbose_options[j] == "jit") {
+ log_verbosity.jit = true;
} else if (verbose_options[j] == "jni") {
log_verbosity.jni = true;
} else if (verbose_options[j] == "monitor") {