Merge "Add -Xzygote to suppress starting the signal catcher thread." into dalvik-dev
diff --git a/src/runtime.cc b/src/runtime.cc
index b4c25d3..4f463e5 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -31,6 +31,7 @@
Runtime::Runtime()
: verbose_startup_(false),
+ is_zygote_(false),
default_stack_size_(Thread::kDefaultStackSize),
thread_list_(NULL),
intern_table_(NULL),
@@ -205,6 +206,8 @@
parsed->heap_maximum_size_ = Heap::kMaximumSize;
parsed->stack_size_ = Thread::kDefaultStackSize;
+ parsed->is_zygote_ = false;
+
parsed->hook_vfprintf_ = vfprintf;
parsed->hook_exit_ = exit;
parsed->hook_abort_ = abort;
@@ -267,6 +270,8 @@
parsed->properties_.push_back(option.substr(strlen("-D")).data());
} else if (option.starts_with("-Xjnitrace:")) {
parsed->jni_trace_ = option.substr(strlen("-Xjnitrace:")).data();
+ } else if (option == "-Xzygote") {
+ parsed->is_zygote_ = true;
} else if (option.starts_with("-verbose:")) {
std::vector<std::string> verbose_options;
Split(option.substr(strlen("-verbose:")).data(), ',', verbose_options);
@@ -351,6 +356,10 @@
// come after ClassLinker::RunRootClinits.
started_ = true;
+ if (!is_zygote_) {
+ signal_catcher_ = new SignalCatcher;
+ }
+
StartDaemonThreads();
CreateSystemClassLoader();
@@ -363,7 +372,9 @@
}
void Runtime::StartDaemonThreads() {
- signal_catcher_ = new SignalCatcher;
+ if (IsVerboseStartup()) {
+ LOG(INFO) << "Runtime::StartDaemonThreads entering";
+ }
Thread* self = Thread::Current();
@@ -376,6 +387,10 @@
jmethodID mid = env->GetStaticMethodID(c.get(), "start", "()V");
CHECK(mid != NULL);
env->CallStaticVoidMethod(c.get(), mid);
+
+ if (IsVerboseStartup()) {
+ LOG(INFO) << "Runtime::StartDaemonThreads exiting";
+ }
}
bool Runtime::IsStarted() const {
@@ -400,6 +415,8 @@
class_path_ = options->class_path_;
properties_ = options->properties_;
+ is_zygote_ = options->is_zygote_;
+
vfprintf_ = options->hook_vfprintf_;
exit_ = options->hook_exit_;
abort_ = options->hook_abort_;
diff --git a/src/runtime.h b/src/runtime.h
index 65a54e9..462bb81 100644
--- a/src/runtime.h
+++ b/src/runtime.h
@@ -51,6 +51,7 @@
std::vector<std::string> images_;
bool check_jni_;
std::string jni_trace_;
+ bool is_zygote_;
size_t heap_initial_size_;
size_t heap_maximum_size_;
size_t stack_size_;
@@ -208,6 +209,7 @@
void StartDaemonThreads();
bool verbose_startup_;
+ bool is_zygote_;
// The host prefix is used during cross compilation. It is removed
// from the start of host paths such as:
diff --git a/test/etc/host-run-test-jar b/test/etc/host-run-test-jar
index d3c0fd5..682910e 100755
--- a/test/etc/host-run-test-jar
+++ b/test/etc/host-run-test-jar
@@ -5,9 +5,6 @@
#
# Options:
# --quiet -- don't chatter
-# --fast -- use the fast interpreter (the default)
-# --jit -- use the jit
-# --portable -- use the portable interpreter
# --debug -- wait for debugger to attach
# --valgrind -- use valgrind
# --no-verify -- turn off verification (on by default)
@@ -19,7 +16,6 @@
fi
}
-INTERP=""
DEBUG="n"
GDB="n"
VERIFY="y"
@@ -33,18 +29,6 @@
if [ "x$1" = "x--quiet" ]; then
QUIET="y"
shift
- elif [ "x$1" = "x--jit" ]; then
- INTERP="jit"
- msg "Using jit"
- shift
- elif [ "x$1" = "x--fast" ]; then
- INTERP="fast"
- msg "Using fast interpreter"
- shift
- elif [ "x$1" = "x--portable" ]; then
- INTERP="portable"
- msg "Using portable interpreter"
- shift
elif [ "x$1" = "x--debug" ]; then
DEBUG="y"
shift
@@ -77,11 +61,6 @@
fi
done
-if [ "x$INTERP" = "x" ]; then
- INTERP="fast"
- msg "Using fast interpreter by default"
-fi
-
if [ "$OPTIMIZE" = "y" ]; then
if [ "$VERIFY" = "y" ]; then
DEX_OPTIMIZE="-Xdexopt:verified"
@@ -155,5 +134,5 @@
fi
$valgrind_cmd $gdb $exe $gdbargs "-Xbootclasspath:${bpath}" \
- $DEX_VERIFY $DEX_OPTIMIZE $DEX_DEBUG $GC_OPTS "-Xint:${INTERP}" -ea \
+ $DEX_VERIFY $DEX_OPTIMIZE $DEX_DEBUG $GC_OPTS -ea \
-cp test.jar Main "$@"
diff --git a/test/etc/push-and-run-test-jar b/test/etc/push-and-run-test-jar
index 79b0605..9b33924 100755
--- a/test/etc/push-and-run-test-jar
+++ b/test/etc/push-and-run-test-jar
@@ -5,9 +5,6 @@
#
# Options:
# --quiet -- don't chatter
-# --fast -- use the fast interpreter (the default)
-# --jit -- use the jit
-# --portable -- use the portable interpreter
# --debug -- wait for debugger to attach
# --zygote -- use the zygote (if so, all other options are ignored)
# --dev -- development mode (print the vm invocation cmdline)
@@ -21,7 +18,6 @@
fi
}
-INTERP=""
DEBUG="n"
VERIFY="y"
OPTIMIZE="y"
@@ -34,18 +30,6 @@
if [ "x$1" = "x--quiet" ]; then
QUIET="y"
shift
- elif [ "x$1" = "x--fast" ]; then
- INTERP="fast"
- msg "Using fast interpreter"
- shift
- elif [ "x$1" = "x--jit" ]; then
- INTERP="jit"
- msg "Using jit"
- shift
- elif [ "x$1" = "x--portable" ]; then
- INTERP="portable"
- msg "Using portable interpreter"
- shift
elif [ "x$1" = "x--debug" ]; then
DEBUG="y"
shift
@@ -77,11 +61,6 @@
done
if [ "$ZYGOTE" = "n" ]; then
- if [ "x$INTERP" = "x" ]; then
- INTERP="fast"
- msg "Using fast interpreter by default"
- fi
-
if [ "$OPTIMIZE" = "y" ]; then
if [ "$VERIFY" = "y" ]; then
DEX_OPTIMIZE="-Xdexopt:verified"
diff --git a/test/run-all-tests b/test/run-all-tests
index 94c7c31..ce28457 100755
--- a/test/run-all-tests
+++ b/test/run-all-tests
@@ -43,15 +43,6 @@
elif [ "x$1" = "x--reference" ]; then
run_args="${run_args} --reference"
shift
- elif [ "x$1" = "x--jit" ]; then
- run_args="${run_args} --jit"
- shift
- elif [ "x$1" = "x--fast" ]; then
- run_args="${run_args} --fast"
- shift
- elif [ "x$1" = "x--portable" ]; then
- run_args="${run_args} --portable"
- shift
elif [ "x$1" = "x--debug" ]; then
run_args="${run_args} --debug"
shift
@@ -93,8 +84,7 @@
echo " $prog [options] Run all tests with the given options."
echo " Options are all passed to run-test; refer to that for " \
"further documentation:"
- echo " --debug --dev --fast --host --no-optimize --no-verify" \
- "--portable"
+ echo " --debug --dev --host --no-optimize --no-verify"
echo " --reference --update --valgrind --zygote"
) 1>&2
exit 1
diff --git a/test/run-test b/test/run-test
index 6c51699..b80fbd9 100755
--- a/test/run-test
+++ b/test/run-test
@@ -57,15 +57,6 @@
elif [ "x$1" = "x--reference" ]; then
RUN="${progdir}/etc/reference-run-test-classes"
shift
- elif [ "x$1" = "x--jit" ]; then
- run_args="${run_args} --jit"
- shift
- elif [ "x$1" = "x--fast" ]; then
- run_args="${run_args} --fast"
- shift
- elif [ "x$1" = "x--portable" ]; then
- run_args="${run_args} --portable"
- shift
elif [ "x$1" = "x--debug" ]; then
run_args="${run_args} --debug"
shift
@@ -146,9 +137,6 @@
echo ' Omitting the test name or specifying "-" will use the' \
"current directory."
echo " Runtime Options:"
- echo " --fast Use the fast interpreter (the default)."
- echo " --jit Use the jit."
- echo " --portable Use the portable interpreter."
echo " --debug Wait for a debugger to attach."
#echo " --gdb Run under gdb; incompatible with some tests."
echo " --no-verify Turn off verification (on by default)."