blob: 1ac45f4661390aa7d78174f970cd2be59cf7f74d [file] [log] [blame]
Carl Shapiro1fb86202011-06-27 17:43:13 -07001// Copyright 2011 Google Inc. All Rights Reserved.
2
Brian Carlstrom578bbdc2011-07-21 14:07:47 -07003#include "runtime.h"
Carl Shapiro1fb86202011-06-27 17:43:13 -07004
Elliott Hughesffe67362011-07-17 12:09:27 -07005#include <cstdio>
6#include <cstdlib>
Brian Carlstrom8a436592011-08-15 21:27:23 -07007#include <limits>
Carl Shapiro2ed144c2011-07-26 16:52:08 -07008#include <vector>
Elliott Hughesffe67362011-07-17 12:09:27 -07009
Elliott Hughes90a33692011-08-30 13:27:07 -070010#include "UniquePtr.h"
Brian Carlstrom578bbdc2011-07-21 14:07:47 -070011#include "class_linker.h"
12#include "heap.h"
Elliott Hughesc5f7c912011-08-18 14:00:42 -070013#include "jni_internal.h"
Elliott Hughese27955c2011-08-26 15:21:24 -070014#include "signal_catcher.h"
Brian Carlstrom578bbdc2011-07-21 14:07:47 -070015#include "thread.h"
Carl Shapiro61e019d2011-07-14 16:53:09 -070016
Elliott Hughes90a33692011-08-30 13:27:07 -070017// TODO: this drags in cutil/log.h, which conflicts with our logging.h.
18#include "JniConstants.h"
19
Carl Shapiro1fb86202011-06-27 17:43:13 -070020namespace art {
21
Carl Shapiro2ed144c2011-07-26 16:52:08 -070022Runtime* Runtime::instance_ = NULL;
23
Carl Shapiro61e019d2011-07-14 16:53:09 -070024Runtime::~Runtime() {
Elliott Hughesc5f7c912011-08-18 14:00:42 -070025 // TODO: use smart pointers instead. (we'll need the pimpl idiom.)
Carl Shapiro61e019d2011-07-14 16:53:09 -070026 delete class_linker_;
Carl Shapiro69759ea2011-07-21 18:13:35 -070027 Heap::Destroy();
Elliott Hughese27955c2011-08-26 15:21:24 -070028 delete signal_catcher_;
Carl Shapiro61e019d2011-07-14 16:53:09 -070029 delete thread_list_;
Elliott Hughesc5f7c912011-08-18 14:00:42 -070030 delete java_vm_;
Elliott Hughesc1674ed2011-08-25 18:09:09 -070031 Thread::Shutdown();
Carl Shapiro4acf4642011-07-26 18:54:13 -070032 // TODO: acquire a static mutex on Runtime to avoid racing.
Brian Carlstrom4a289ed2011-08-16 17:17:49 -070033 CHECK(instance_ == NULL || instance_ == this);
Carl Shapiro4acf4642011-07-26 18:54:13 -070034 instance_ = NULL;
Carl Shapiro61e019d2011-07-14 16:53:09 -070035}
36
Elliott Hughesffe67362011-07-17 12:09:27 -070037void Runtime::Abort(const char* file, int line) {
38 // Get any pending output out of the way.
39 fflush(NULL);
40
41 // Many people have difficulty distinguish aborts from crashes,
42 // so be explicit.
43 LogMessage(file, line, ERROR, -1).stream() << "Runtime aborting...";
44
Elliott Hughesffe67362011-07-17 12:09:27 -070045 // Perform any platform-specific pre-abort actions.
46 PlatformAbort(file, line);
47
Brian Carlstrom6ea095a2011-08-16 15:26:54 -070048 // use abort hook if we have one
49 if (Runtime::Current() != NULL && Runtime::Current()->abort_ != NULL) {
50 Runtime::Current()->abort_();
51 // notreached
52 }
53
Elliott Hughesffe67362011-07-17 12:09:27 -070054 // If we call abort(3) on a device, all threads in the process
Carl Shapiro69759ea2011-07-21 18:13:35 -070055 // receive SIGABRT. debuggerd dumps the stack trace of the main
56 // thread, whether or not that was the thread that failed. By
57 // stuffing a value into a bogus address, we cause a segmentation
Elliott Hughesffe67362011-07-17 12:09:27 -070058 // fault in the current thread, and get a useful log from debuggerd.
59 // We can also trivially tell the difference between a VM crash and
60 // a deliberate abort by looking at the fault address.
61 *reinterpret_cast<char*>(0xdeadd00d) = 38;
62 abort();
Elliott Hughesffe67362011-07-17 12:09:27 -070063 // notreached
64}
65
Brian Carlstrom8a436592011-08-15 21:27:23 -070066// Parse a string of the form /[0-9]+[kKmMgG]?/, which is used to specify
67// memory sizes. [kK] indicates kilobytes, [mM] megabytes, and
68// [gG] gigabytes.
69//
70// "s" should point just past the "-Xm?" part of the string.
Brian Carlstrom8a436592011-08-15 21:27:23 -070071// "div" specifies a divisor, e.g. 1024 if the value must be a multiple
72// of 1024.
73//
74// The spec says the -Xmx and -Xms options must be multiples of 1024. It
75// doesn't say anything about -Xss.
76//
77// Returns 0 (a useless size) if "s" is malformed or specifies a low or
78// non-evenly-divisible value.
79//
80size_t ParseMemoryOption(const char *s, size_t div) {
81 // strtoul accepts a leading [+-], which we don't want,
82 // so make sure our string starts with a decimal digit.
83 if (isdigit(*s)) {
84 const char *s2;
85 size_t val = strtoul(s, (char **)&s2, 10);
86 if (s2 != s) {
87 // s2 should be pointing just after the number.
88 // If this is the end of the string, the user
89 // has specified a number of bytes. Otherwise,
90 // there should be exactly one more character
91 // that specifies a multiplier.
92 if (*s2 != '\0') {
Brian Carlstromf734cf52011-08-17 16:28:14 -070093 // The remainder of the string is either a single multiplier
94 // character, or nothing to indicate that the value is in
95 // bytes.
96 char c = *s2++;
97 if (*s2 == '\0') {
98 size_t mul;
99 if (c == '\0') {
100 mul = 1;
101 } else if (c == 'k' || c == 'K') {
102 mul = KB;
103 } else if (c == 'm' || c == 'M') {
104 mul = MB;
105 } else if (c == 'g' || c == 'G') {
106 mul = GB;
Brian Carlstrom8a436592011-08-15 21:27:23 -0700107 } else {
Brian Carlstromf734cf52011-08-17 16:28:14 -0700108 // Unknown multiplier character.
Brian Carlstrom8a436592011-08-15 21:27:23 -0700109 return 0;
110 }
Brian Carlstromf734cf52011-08-17 16:28:14 -0700111
112 if (val <= std::numeric_limits<size_t>::max() / mul) {
113 val *= mul;
114 } else {
115 // Clamp to a multiple of 1024.
116 val = std::numeric_limits<size_t>::max() & ~(1024-1);
117 }
118 } else {
119 // There's more than one character after the numeric part.
120 return 0;
121 }
Brian Carlstrom8a436592011-08-15 21:27:23 -0700122 }
123 // The man page says that a -Xm value must be a multiple of 1024.
124 if (val % div == 0) {
125 return val;
126 }
Carl Shapirofc322c72011-07-27 00:20:01 -0700127 }
128 }
Brian Carlstrom8a436592011-08-15 21:27:23 -0700129 return 0;
Carl Shapirofc322c72011-07-27 00:20:01 -0700130}
131
Elliott Hughes0af55432011-08-17 18:37:28 -0700132void LoadJniLibrary(JavaVMExt* vm, const char* name) {
133 // TODO: OS_SHARED_LIB_FORMAT_STR
134 std::string mapped_name(StringPrintf("lib%s.so", name));
Elliott Hughes75770752011-08-24 17:52:38 -0700135 std::string reason;
136 if (!vm->LoadNativeLibrary(mapped_name, NULL, reason)) {
Elliott Hughes0af55432011-08-17 18:37:28 -0700137 LOG(FATAL) << "LoadNativeLibrary failed for \"" << mapped_name << "\": "
138 << reason;
139 }
140}
141
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700142const DexFile* Open(const std::string& filename) {
Elliott Hughes40ef99e2011-08-11 17:44:34 -0700143 if (filename.size() < 4) {
144 LOG(WARNING) << "Ignoring short classpath entry '" << filename << "'";
145 return NULL;
146 }
147 std::string suffix(filename.substr(filename.size() - 4));
148 if (suffix == ".zip" || suffix == ".jar" || suffix == ".apk") {
149 return DexFile::OpenZip(filename);
150 } else {
151 return DexFile::OpenFile(filename);
152 }
153}
154
Brian Carlstrom8a436592011-08-15 21:27:23 -0700155void CreateBootClassPath(const char* boot_class_path_cstr,
Brian Carlstrom9ea1cb12011-08-24 23:18:18 -0700156 std::vector<const DexFile*>& boot_class_path_vector) {
Brian Carlstrom8a436592011-08-15 21:27:23 -0700157 CHECK(boot_class_path_cstr != NULL);
Carl Shapirofc322c72011-07-27 00:20:01 -0700158 std::vector<std::string> parsed;
Elliott Hughes34023802011-08-30 12:06:17 -0700159 Split(boot_class_path_cstr, ':', parsed);
Carl Shapirofc322c72011-07-27 00:20:01 -0700160 for (size_t i = 0; i < parsed.size(); ++i) {
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700161 const DexFile* dex_file = Open(parsed[i]);
Carl Shapirofc322c72011-07-27 00:20:01 -0700162 if (dex_file != NULL) {
Brian Carlstrom8a436592011-08-15 21:27:23 -0700163 boot_class_path_vector.push_back(dex_file);
Carl Shapirofc322c72011-07-27 00:20:01 -0700164 }
165 }
166}
167
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700168Runtime::ParsedOptions* Runtime::ParsedOptions::Create(const Options& options, bool ignore_unrecognized) {
Elliott Hughes90a33692011-08-30 13:27:07 -0700169 UniquePtr<ParsedOptions> parsed(new ParsedOptions());
Brian Carlstrom8a436592011-08-15 21:27:23 -0700170 const char* boot_class_path = getenv("BOOTCLASSPATH");
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700171 parsed->boot_image_ = NULL;
Elliott Hughes515a5bc2011-08-17 11:08:34 -0700172#ifdef NDEBUG
Elliott Hughes5174fe62011-08-23 15:12:35 -0700173 // -Xcheck:jni is off by default for regular builds...
Elliott Hughes515a5bc2011-08-17 11:08:34 -0700174 parsed->check_jni_ = false;
175#else
176 // ...but on by default in debug builds.
177 parsed->check_jni_ = true;
178#endif
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700179 parsed->heap_initial_size_ = Heap::kInitialSize;
180 parsed->heap_maximum_size_ = Heap::kMaximumSize;
Brian Carlstromf734cf52011-08-17 16:28:14 -0700181 parsed->stack_size_ = Thread::kDefaultStackSize;
182
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700183 parsed->hook_vfprintf_ = vfprintf;
184 parsed->hook_exit_ = exit;
185 parsed->hook_abort_ = abort;
Brian Carlstrom8a436592011-08-15 21:27:23 -0700186
187 for (size_t i = 0; i < options.size(); ++i) {
188 const StringPiece& option = options[i].first;
Brian Carlstrom8a436592011-08-15 21:27:23 -0700189 if (option.starts_with("-Xbootclasspath:")) {
190 boot_class_path = option.substr(strlen("-Xbootclasspath:")).data();
191 } else if (option == "bootclasspath") {
Brian Carlstromf734cf52011-08-17 16:28:14 -0700192 const void* dex_vector = options[i].second;
Brian Carlstrom9ea1cb12011-08-24 23:18:18 -0700193 const std::vector<const DexFile*>* v
194 = reinterpret_cast<const std::vector<const DexFile*>*>(dex_vector);
Brian Carlstromf734cf52011-08-17 16:28:14 -0700195 if (v == NULL) {
196 if (ignore_unrecognized) {
197 continue;
198 }
199 // TODO: usage
200 LOG(FATAL) << "Could not parse " << option;
201 return NULL;
202 }
203 parsed->boot_class_path_ = *v;
Brian Carlstrom8a436592011-08-15 21:27:23 -0700204 } else if (option.starts_with("-Xbootimage:")) {
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700205 parsed->boot_image_ = option.substr(strlen("-Xbootimage:")).data();
Elliott Hughes515a5bc2011-08-17 11:08:34 -0700206 } else if (option.starts_with("-Xcheck:jni")) {
207 parsed->check_jni_ = true;
Brian Carlstrom8a436592011-08-15 21:27:23 -0700208 } else if (option.starts_with("-Xms")) {
Brian Carlstromf734cf52011-08-17 16:28:14 -0700209 size_t size = ParseMemoryOption(option.substr(strlen("-Xms")).data(), 1024);
210 if (size == 0) {
211 if (ignore_unrecognized) {
212 continue;
213 }
Brian Carlstrom4a289ed2011-08-16 17:17:49 -0700214 // TODO: usage
Brian Carlstromf734cf52011-08-17 16:28:14 -0700215 LOG(FATAL) << "Could not parse " << option;
216 return NULL;
217 }
218 parsed->heap_initial_size_ = size;
Brian Carlstrom8a436592011-08-15 21:27:23 -0700219 } else if (option.starts_with("-Xmx")) {
Brian Carlstromf734cf52011-08-17 16:28:14 -0700220 size_t size = ParseMemoryOption(option.substr(strlen("-Xmx")).data(), 1024);
221 if (size == 0) {
222 if (ignore_unrecognized) {
223 continue;
224 }
Brian Carlstrom4a289ed2011-08-16 17:17:49 -0700225 // TODO: usage
Brian Carlstromf734cf52011-08-17 16:28:14 -0700226 LOG(FATAL) << "Could not parse " << option;
227 return NULL;
228 }
229 parsed->heap_maximum_size_ = size;
230 } else if (option.starts_with("-Xss")) {
231 size_t size = ParseMemoryOption(option.substr(strlen("-Xss")).data(), 1);
232 if (size == 0) {
233 if (ignore_unrecognized) {
234 continue;
235 }
Brian Carlstrom4a289ed2011-08-16 17:17:49 -0700236 // TODO: usage
Brian Carlstromf734cf52011-08-17 16:28:14 -0700237 LOG(FATAL) << "Could not parse " << option;
238 return NULL;
239 }
240 parsed->stack_size_ = size;
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700241 } else if (option.starts_with("-D")) {
242 parsed->properties_.push_back(option.substr(strlen("-D")).data());
243 } else if (option.starts_with("-verbose:")) {
Elliott Hughes0af55432011-08-17 18:37:28 -0700244 std::vector<std::string> verbose_options;
Elliott Hughes34023802011-08-30 12:06:17 -0700245 Split(option.substr(strlen("-verbose:")).data(), ',', verbose_options);
Elliott Hughes0af55432011-08-17 18:37:28 -0700246 for (size_t i = 0; i < verbose_options.size(); ++i) {
247 parsed->verbose_.insert(verbose_options[i]);
248 }
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700249 } else if (option == "vfprintf") {
250 parsed->hook_vfprintf_ = reinterpret_cast<int (*)(FILE *, const char*, va_list)>(options[i].second);
251 } else if (option == "exit") {
252 parsed->hook_exit_ = reinterpret_cast<void(*)(jint)>(options[i].second);
253 } else if (option == "abort") {
254 parsed->hook_abort_ = reinterpret_cast<void(*)()>(options[i].second);
Brian Carlstrom8a436592011-08-15 21:27:23 -0700255 } else {
256 if (!ignore_unrecognized) {
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700257 // TODO: print usage via vfprintf
Brian Carlstrom8a436592011-08-15 21:27:23 -0700258 LOG(FATAL) << "Unrecognized option " << option;
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700259 return NULL;
Brian Carlstrom8a436592011-08-15 21:27:23 -0700260 }
261 }
262 }
263
264 if (boot_class_path == NULL) {
265 boot_class_path = "";
266 }
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700267 if (parsed->boot_class_path_.size() == 0) {
268 CreateBootClassPath(boot_class_path, parsed->boot_class_path_);
Brian Carlstrom8a436592011-08-15 21:27:23 -0700269 }
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700270 return parsed.release();
Carl Shapiro2ed144c2011-07-26 16:52:08 -0700271}
272
Brian Carlstrom8a436592011-08-15 21:27:23 -0700273Runtime* Runtime::Create(const std::vector<const DexFile*>& boot_class_path) {
274 Runtime::Options options;
275 options.push_back(std::make_pair("bootclasspath", &boot_class_path));
276 return Runtime::Create(options, false);
277}
278
279Runtime* Runtime::Create(const Options& options, bool ignore_unrecognized) {
Carl Shapiro2ed144c2011-07-26 16:52:08 -0700280 // TODO: acquire a static mutex on Runtime to avoid racing.
281 if (Runtime::instance_ != NULL) {
282 return NULL;
283 }
Elliott Hughes90a33692011-08-30 13:27:07 -0700284 UniquePtr<Runtime> runtime(new Runtime());
Brian Carlstrom8a436592011-08-15 21:27:23 -0700285 bool success = runtime->Init(options, ignore_unrecognized);
Carl Shapiro61e019d2011-07-14 16:53:09 -0700286 if (!success) {
287 return NULL;
Carl Shapiro61e019d2011-07-14 16:53:09 -0700288 }
Elliott Hughes0af55432011-08-17 18:37:28 -0700289 instance_ = runtime.release();
290
291 // Most JNI libraries can just use System.loadLibrary, but you can't
292 // if you're the library that implements System.loadLibrary!
Elliott Hughes18c07532011-08-18 15:50:51 -0700293 Thread* self = Thread::Current();
294 Thread::State old_state = self->GetState();
295 self->SetState(Thread::kNative);
296 JniConstants::init(self->GetJniEnv());
Elliott Hughes0af55432011-08-17 18:37:28 -0700297 LoadJniLibrary(instance_->GetJavaVM(), "javacore");
Elliott Hughes18c07532011-08-18 15:50:51 -0700298 self->SetState(old_state);
Elliott Hughes0af55432011-08-17 18:37:28 -0700299
Elliott Hughese27955c2011-08-26 15:21:24 -0700300 instance_->signal_catcher_ = new SignalCatcher;
301
Elliott Hughes0af55432011-08-17 18:37:28 -0700302 return instance_;
Carl Shapiro61e019d2011-07-14 16:53:09 -0700303}
304
Elliott Hughes0af55432011-08-17 18:37:28 -0700305bool Runtime::Init(const Options& raw_options, bool ignore_unrecognized) {
Elliott Hughesc1674ed2011-08-25 18:09:09 -0700306 CHECK_EQ(sysconf(_SC_PAGE_SIZE), kPageSize);
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700307
Elliott Hughes90a33692011-08-30 13:27:07 -0700308 UniquePtr<ParsedOptions> options(ParsedOptions::Create(raw_options, ignore_unrecognized));
309 if (options.get() == NULL) {
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700310 return false;
311 }
Elliott Hughes0af55432011-08-17 18:37:28 -0700312 vfprintf_ = options->hook_vfprintf_;
313 exit_ = options->hook_exit_;
314 abort_ = options->hook_abort_;
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700315
Brian Carlstromb765be02011-08-17 23:54:10 -0700316 stack_size_ = options->stack_size_;
Carl Shapiro61e019d2011-07-14 16:53:09 -0700317 thread_list_ = ThreadList::Create();
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700318
Brian Carlstrom4a289ed2011-08-16 17:17:49 -0700319 if (!Heap::Init(options->heap_initial_size_,
320 options->heap_maximum_size_,
321 options->boot_image_)) {
322 return false;
323 }
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700324
Elliott Hughesc1674ed2011-08-25 18:09:09 -0700325 BlockSignals();
326
Elliott Hughes0af55432011-08-17 18:37:28 -0700327 bool verbose_jni = options->verbose_.find("jni") != options->verbose_.end();
Elliott Hughesc5f7c912011-08-18 14:00:42 -0700328 java_vm_ = new JavaVMExt(this, options->check_jni_, verbose_jni);
Elliott Hughes515a5bc2011-08-17 11:08:34 -0700329
Elliott Hughesc1674ed2011-08-25 18:09:09 -0700330 if (!Thread::Startup()) {
Brian Carlstrom4a289ed2011-08-16 17:17:49 -0700331 return false;
332 }
Elliott Hughes515a5bc2011-08-17 11:08:34 -0700333 Thread* current_thread = Thread::Attach(this);
Carl Shapiro61e019d2011-07-14 16:53:09 -0700334 thread_list_->Register(current_thread);
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700335
Brian Carlstroma663ea52011-08-19 23:33:41 -0700336 class_linker_ = ClassLinker::Create(options->boot_class_path_, Heap::GetBootSpace());
Brian Carlstrom6ea095a2011-08-16 15:26:54 -0700337
Carl Shapiro1fb86202011-06-27 17:43:13 -0700338 return true;
339}
340
Elliott Hughese27955c2011-08-26 15:21:24 -0700341void Runtime::DumpStatistics(std::ostream& os) {
342 // TODO: dump other runtime statistics?
343 os << "Loaded classes: " << class_linker_->NumLoadedClasses() << "\n";
344 os << "Intern table size: " << class_linker_->GetInternTable().Size() << "\n";
345 // LOGV("VM stats: meth=%d ifld=%d sfld=%d linear=%d",
346 // gDvm.numDeclaredMethods,
347 // gDvm.numDeclaredInstFields,
348 // gDvm.numDeclaredStaticFields,
349 // gDvm.pBootLoaderAlloc->curOffset);
350 // LOGI("GC precise methods: %d", dvmPointerSetGetCount(gDvm.preciseMethods));
351}
352
Elliott Hughesc1674ed2011-08-25 18:09:09 -0700353void Runtime::BlockSignals() {
354 sigset_t sigset;
355 if (sigemptyset(&sigset) == -1) {
356 PLOG(FATAL) << "sigemptyset failed";
357 }
358 if (sigaddset(&sigset, SIGPIPE) == -1) {
359 PLOG(ERROR) << "sigaddset SIGPIPE failed";
360 }
361 // SIGQUIT is used to dump the runtime's state (including stack traces).
362 if (sigaddset(&sigset, SIGQUIT) == -1) {
363 PLOG(ERROR) << "sigaddset SIGQUIT failed";
364 }
365 // SIGUSR1 is used to initiate a heap dump.
366 if (sigaddset(&sigset, SIGUSR1) == -1) {
367 PLOG(ERROR) << "sigaddset SIGUSR1 failed";
368 }
369 CHECK_EQ(sigprocmask(SIG_BLOCK, &sigset, NULL), 0);
370}
371
Elliott Hughes75770752011-08-24 17:52:38 -0700372bool Runtime::AttachCurrentThread(const char* name, JNIEnv** penv, bool as_daemon) {
373 if (as_daemon) {
374 UNIMPLEMENTED(WARNING) << "TODO: do something different for daemon threads";
375 }
Elliott Hughes515a5bc2011-08-17 11:08:34 -0700376 return Thread::Attach(instance_) != NULL;
Carl Shapiro61e019d2011-07-14 16:53:09 -0700377}
378
Ian Rogersb033c752011-07-20 12:22:35 -0700379bool Runtime::DetachCurrentThread() {
Elliott Hughesc1674ed2011-08-25 18:09:09 -0700380 Thread* self = Thread::Current();
381 thread_list_->Unregister(self);
382 delete self;
Ian Rogersb033c752011-07-20 12:22:35 -0700383 return true;
Carl Shapiro1fb86202011-06-27 17:43:13 -0700384}
385
Brian Carlstrom1f870082011-08-23 16:02:11 -0700386void Runtime::VisitRoots(Heap::RootVistor* root_visitor, void* arg) const {
387 GetClassLinker()->VisitRoots(root_visitor, arg);
388 UNIMPLEMENTED(WARNING) << "mark other roots including per thread state and thread stacks";
389}
390
Carl Shapiro1fb86202011-06-27 17:43:13 -0700391} // namespace art