runtime.h revision 1fb463e42cf1d67595cff66d19c0f99e3046f4c4
1/* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef ART_RUNTIME_RUNTIME_H_ 18#define ART_RUNTIME_RUNTIME_H_ 19 20#include <jni.h> 21#include <stdio.h> 22 23#include <iosfwd> 24#include <set> 25#include <string> 26#include <utility> 27#include <vector> 28 29#include "base/allocator.h" 30#include "compiler_callbacks.h" 31#include "gc_root.h" 32#include "instrumentation.h" 33#include "instruction_set.h" 34#include "jobject_comparator.h" 35#include "object_callbacks.h" 36#include "offsets.h" 37#include "profiler_options.h" 38#include "quick/quick_method_frame_info.h" 39#include "runtime_stats.h" 40#include "safe_map.h" 41 42namespace art { 43 44namespace gc { 45 class Heap; 46} // namespace gc 47namespace mirror { 48 class ArtMethod; 49 class ClassLoader; 50 class Array; 51 template<class T> class ObjectArray; 52 template<class T> class PrimitiveArray; 53 typedef PrimitiveArray<int8_t> ByteArray; 54 class String; 55 class Throwable; 56} // namespace mirror 57namespace verifier { 58class MethodVerifier; 59} 60class ClassLinker; 61class DexFile; 62class InternTable; 63class JavaVMExt; 64class MonitorList; 65class MonitorPool; 66class NullPointerHandler; 67class SignalCatcher; 68class StackOverflowHandler; 69class SuspensionHandler; 70class ThreadList; 71class Trace; 72class Transaction; 73 74typedef std::vector<std::pair<std::string, const void*>> RuntimeOptions; 75 76// Not all combinations of flags are valid. You may not visit all roots as well as the new roots 77// (no logical reason to do this). You also may not start logging new roots and stop logging new 78// roots (also no logical reason to do this). 79enum VisitRootFlags : uint8_t { 80 kVisitRootFlagAllRoots = 0x1, 81 kVisitRootFlagNewRoots = 0x2, 82 kVisitRootFlagStartLoggingNewRoots = 0x4, 83 kVisitRootFlagStopLoggingNewRoots = 0x8, 84 kVisitRootFlagClearRootLog = 0x10, 85}; 86 87class Runtime { 88 public: 89 // Creates and initializes a new runtime. 90 static bool Create(const RuntimeOptions& options, bool ignore_unrecognized) 91 SHARED_TRYLOCK_FUNCTION(true, Locks::mutator_lock_); 92 93 bool IsCompiler() const { 94 return compiler_callbacks_ != nullptr; 95 } 96 97 bool CanRelocate() const { 98 return !IsCompiler() || compiler_callbacks_->IsRelocationPossible(); 99 } 100 101 bool ShouldRelocate() const { 102 return must_relocate_ && CanRelocate(); 103 } 104 105 bool MustRelocateIfPossible() const { 106 return must_relocate_; 107 } 108 109 bool IsDex2OatEnabled() const { 110 return dex2oat_enabled_ && IsImageDex2OatEnabled(); 111 } 112 113 bool IsImageDex2OatEnabled() const { 114 return image_dex2oat_enabled_; 115 } 116 117 CompilerCallbacks* GetCompilerCallbacks() { 118 return compiler_callbacks_; 119 } 120 121 bool IsZygote() const { 122 return is_zygote_; 123 } 124 125 bool IsExplicitGcDisabled() const { 126 return is_explicit_gc_disabled_; 127 } 128 129 std::string GetCompilerExecutable() const; 130 std::string GetPatchoatExecutable() const; 131 132 const std::vector<std::string>& GetCompilerOptions() const { 133 return compiler_options_; 134 } 135 136 const std::vector<std::string>& GetImageCompilerOptions() const { 137 return image_compiler_options_; 138 } 139 140 const std::string& GetImageLocation() const { 141 return image_location_; 142 } 143 144 const ProfilerOptions& GetProfilerOptions() const { 145 return profiler_options_; 146 } 147 148 // Starts a runtime, which may cause threads to be started and code to run. 149 bool Start() UNLOCK_FUNCTION(Locks::mutator_lock_); 150 151 bool IsShuttingDown(Thread* self); 152 bool IsShuttingDownLocked() const EXCLUSIVE_LOCKS_REQUIRED(Locks::runtime_shutdown_lock_) { 153 return shutting_down_; 154 } 155 156 size_t NumberOfThreadsBeingBorn() const EXCLUSIVE_LOCKS_REQUIRED(Locks::runtime_shutdown_lock_) { 157 return threads_being_born_; 158 } 159 160 void StartThreadBirth() EXCLUSIVE_LOCKS_REQUIRED(Locks::runtime_shutdown_lock_) { 161 threads_being_born_++; 162 } 163 164 void EndThreadBirth() EXCLUSIVE_LOCKS_REQUIRED(Locks::runtime_shutdown_lock_); 165 166 bool IsStarted() const { 167 return started_; 168 } 169 170 bool IsFinishedStarting() const { 171 return finished_starting_; 172 } 173 174 static Runtime* Current() { 175 return instance_; 176 } 177 178 // Aborts semi-cleanly. Used in the implementation of LOG(FATAL), which most 179 // callers should prefer. 180 // This isn't marked ((noreturn)) because then gcc will merge multiple calls 181 // in a single function together. This reduces code size slightly, but means 182 // that the native stack trace we get may point at the wrong call site. 183 static void Abort() LOCKS_EXCLUDED(Locks::abort_lock_); 184 185 // Returns the "main" ThreadGroup, used when attaching user threads. 186 jobject GetMainThreadGroup() const; 187 188 // Returns the "system" ThreadGroup, used when attaching our internal threads. 189 jobject GetSystemThreadGroup() const; 190 191 // Returns the system ClassLoader which represents the CLASSPATH. 192 jobject GetSystemClassLoader() const; 193 194 // Attaches the calling native thread to the runtime. 195 bool AttachCurrentThread(const char* thread_name, bool as_daemon, jobject thread_group, 196 bool create_peer); 197 198 void CallExitHook(jint status); 199 200 // Detaches the current native thread from the runtime. 201 void DetachCurrentThread() LOCKS_EXCLUDED(Locks::mutator_lock_); 202 203 void DumpForSigQuit(std::ostream& os) 204 EXCLUSIVE_LOCKS_REQUIRED(Locks::mutator_lock_); 205 void DumpLockHolders(std::ostream& os); 206 207 ~Runtime(); 208 209 const std::string& GetBootClassPathString() const { 210 return boot_class_path_string_; 211 } 212 213 const std::string& GetClassPathString() const { 214 return class_path_string_; 215 } 216 217 ClassLinker* GetClassLinker() const { 218 return class_linker_; 219 } 220 221 size_t GetDefaultStackSize() const { 222 return default_stack_size_; 223 } 224 225 gc::Heap* GetHeap() const { 226 return heap_; 227 } 228 229 InternTable* GetInternTable() const { 230 DCHECK(intern_table_ != NULL); 231 return intern_table_; 232 } 233 234 JavaVMExt* GetJavaVM() const { 235 return java_vm_; 236 } 237 238 size_t GetMaxSpinsBeforeThinkLockInflation() const { 239 return max_spins_before_thin_lock_inflation_; 240 } 241 242 MonitorList* GetMonitorList() const { 243 return monitor_list_; 244 } 245 246 MonitorPool* GetMonitorPool() const { 247 return monitor_pool_; 248 } 249 250 mirror::Throwable* GetPreAllocatedOutOfMemoryError() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 251 252 mirror::Throwable* GetPreAllocatedNoClassDefFoundError() 253 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 254 255 const std::vector<std::string>& GetProperties() const { 256 return properties_; 257 } 258 259 ThreadList* GetThreadList() const { 260 return thread_list_; 261 } 262 263 static const char* GetVersion() { 264 return "2.1.0"; 265 } 266 267 void DisallowNewSystemWeaks() EXCLUSIVE_LOCKS_REQUIRED(Locks::mutator_lock_); 268 void AllowNewSystemWeaks() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 269 270 // Visit all the roots. If only_dirty is true then non-dirty roots won't be visited. If 271 // clean_dirty is true then dirty roots will be marked as non-dirty after visiting. 272 void VisitRoots(RootCallback* visitor, void* arg, VisitRootFlags flags = kVisitRootFlagAllRoots) 273 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 274 275 // Visit all of the roots we can do safely do concurrently. 276 void VisitConcurrentRoots(RootCallback* visitor, void* arg, 277 VisitRootFlags flags = kVisitRootFlagAllRoots) 278 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 279 280 // Visit all of the non thread roots, we can do this with mutators unpaused. 281 void VisitNonThreadRoots(RootCallback* visitor, void* arg) 282 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 283 284 // Visit all other roots which must be done with mutators suspended. 285 void VisitNonConcurrentRoots(RootCallback* visitor, void* arg) 286 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 287 288 // Sweep system weaks, the system weak is deleted if the visitor return nullptr. Otherwise, the 289 // system weak is updated to be the visitor's returned value. 290 void SweepSystemWeaks(IsMarkedCallback* visitor, void* arg) 291 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 292 293 // Constant roots are the roots which never change after the runtime is initialized, they only 294 // need to be visited once per GC cycle. 295 void VisitConstantRoots(RootCallback* callback, void* arg) 296 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 297 298 // Returns a special method that calls into a trampoline for runtime method resolution 299 mirror::ArtMethod* GetResolutionMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 300 301 bool HasResolutionMethod() const { 302 return !resolution_method_.IsNull(); 303 } 304 305 void SetResolutionMethod(mirror::ArtMethod* method) { 306 resolution_method_ = GcRoot<mirror::ArtMethod>(method); 307 } 308 309 mirror::ArtMethod* CreateResolutionMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 310 311 // Returns a special method that calls into a trampoline for runtime imt conflicts. 312 mirror::ArtMethod* GetImtConflictMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 313 mirror::ArtMethod* GetImtUnimplementedMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 314 315 bool HasImtConflictMethod() const { 316 return !imt_conflict_method_.IsNull(); 317 } 318 319 void SetImtConflictMethod(mirror::ArtMethod* method) { 320 imt_conflict_method_ = GcRoot<mirror::ArtMethod>(method); 321 } 322 void SetImtUnimplementedMethod(mirror::ArtMethod* method) { 323 imt_unimplemented_method_ = GcRoot<mirror::ArtMethod>(method); 324 } 325 326 mirror::ArtMethod* CreateImtConflictMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 327 328 // Returns an imt with every entry set to conflict, used as default imt for all classes. 329 mirror::ObjectArray<mirror::ArtMethod>* GetDefaultImt() 330 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 331 332 bool HasDefaultImt() const { 333 return !default_imt_.IsNull(); 334 } 335 336 void SetDefaultImt(mirror::ObjectArray<mirror::ArtMethod>* imt) { 337 default_imt_ = GcRoot<mirror::ObjectArray<mirror::ArtMethod>>(imt); 338 } 339 340 mirror::ObjectArray<mirror::ArtMethod>* CreateDefaultImt(ClassLinker* cl) 341 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 342 343 // Returns a special method that describes all callee saves being spilled to the stack. 344 enum CalleeSaveType { 345 kSaveAll, 346 kRefsOnly, 347 kRefsAndArgs, 348 kLastCalleeSaveType // Value used for iteration 349 }; 350 351 bool HasCalleeSaveMethod(CalleeSaveType type) const { 352 return !callee_save_methods_[type].IsNull(); 353 } 354 355 mirror::ArtMethod* GetCalleeSaveMethod(CalleeSaveType type) 356 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 357 358 mirror::ArtMethod* GetCalleeSaveMethodUnchecked(CalleeSaveType type) 359 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 360 361 QuickMethodFrameInfo GetCalleeSaveMethodFrameInfo(CalleeSaveType type) const { 362 return callee_save_method_frame_infos_[type]; 363 } 364 365 QuickMethodFrameInfo GetRuntimeMethodFrameInfo(mirror::ArtMethod* method) 366 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 367 368 static size_t GetCalleeSaveMethodOffset(CalleeSaveType type) { 369 return OFFSETOF_MEMBER(Runtime, callee_save_methods_[type]); 370 } 371 372 InstructionSet GetInstructionSet() const { 373 return instruction_set_; 374 } 375 376 void SetInstructionSet(InstructionSet instruction_set); 377 378 void SetCalleeSaveMethod(mirror::ArtMethod* method, CalleeSaveType type); 379 380 mirror::ArtMethod* CreateCalleeSaveMethod(CalleeSaveType type) 381 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 382 383 int32_t GetStat(int kind); 384 385 RuntimeStats* GetStats() { 386 return &stats_; 387 } 388 389 bool HasStatsEnabled() const { 390 return stats_enabled_; 391 } 392 393 void ResetStats(int kinds); 394 395 void SetStatsEnabled(bool new_state) LOCKS_EXCLUDED(Locks::instrument_entrypoints_lock_, 396 Locks::mutator_lock_); 397 398 enum class NativeBridgeAction { // private 399 kUnload, 400 kInitialize 401 }; 402 void PreZygoteFork(); 403 bool InitZygote(); 404 void DidForkFromZygote(JNIEnv* env, NativeBridgeAction action, const char* isa); 405 406 const instrumentation::Instrumentation* GetInstrumentation() const { 407 return &instrumentation_; 408 } 409 410 instrumentation::Instrumentation* GetInstrumentation() { 411 return &instrumentation_; 412 } 413 414 bool UseCompileTimeClassPath() const { 415 return use_compile_time_class_path_; 416 } 417 418 void AddMethodVerifier(verifier::MethodVerifier* verifier) LOCKS_EXCLUDED(method_verifier_lock_); 419 void RemoveMethodVerifier(verifier::MethodVerifier* verifier) 420 LOCKS_EXCLUDED(method_verifier_lock_); 421 422 const std::vector<const DexFile*>& GetCompileTimeClassPath(jobject class_loader); 423 void SetCompileTimeClassPath(jobject class_loader, std::vector<const DexFile*>& class_path); 424 425 void StartProfiler(const char* profile_output_filename); 426 void UpdateProfilerState(int state); 427 428 // Transaction support. 429 bool IsActiveTransaction() const { 430 return preinitialization_transaction_ != nullptr; 431 } 432 void EnterTransactionMode(Transaction* transaction); 433 void ExitTransactionMode(); 434 void RecordWriteField32(mirror::Object* obj, MemberOffset field_offset, uint32_t value, 435 bool is_volatile) const; 436 void RecordWriteField64(mirror::Object* obj, MemberOffset field_offset, uint64_t value, 437 bool is_volatile) const; 438 void RecordWriteFieldReference(mirror::Object* obj, MemberOffset field_offset, 439 mirror::Object* value, bool is_volatile) const; 440 void RecordWriteArray(mirror::Array* array, size_t index, uint64_t value) const 441 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 442 void RecordStrongStringInsertion(mirror::String* s) const 443 EXCLUSIVE_LOCKS_REQUIRED(Locks::intern_table_lock_); 444 void RecordWeakStringInsertion(mirror::String* s) const 445 EXCLUSIVE_LOCKS_REQUIRED(Locks::intern_table_lock_); 446 void RecordStrongStringRemoval(mirror::String* s) const 447 EXCLUSIVE_LOCKS_REQUIRED(Locks::intern_table_lock_); 448 void RecordWeakStringRemoval(mirror::String* s) const 449 EXCLUSIVE_LOCKS_REQUIRED(Locks::intern_table_lock_); 450 451 void SetFaultMessage(const std::string& message); 452 // Only read by the signal handler, NO_THREAD_SAFETY_ANALYSIS to prevent lock order violations 453 // with the unexpected_signal_lock_. 454 const std::string& GetFaultMessage() NO_THREAD_SAFETY_ANALYSIS { 455 return fault_message_; 456 } 457 458 void AddCurrentRuntimeFeaturesAsDex2OatArguments(std::vector<std::string>* arg_vector) const; 459 460 bool ExplicitNullChecks() const { 461 return null_pointer_handler_ == nullptr; 462 } 463 464 bool ExplicitSuspendChecks() const { 465 return suspend_handler_ == nullptr; 466 } 467 468 bool ExplicitStackOverflowChecks() const { 469 return stack_overflow_handler_ == nullptr; 470 } 471 472 bool IsVerificationEnabled() const { 473 return verify_; 474 } 475 476 bool RunningOnValgrind() const { 477 return running_on_valgrind_; 478 } 479 480 void SetTargetSdkVersion(int32_t version) { 481 target_sdk_version_ = version; 482 } 483 484 int32_t GetTargetSdkVersion() const { 485 return target_sdk_version_; 486 } 487 488 static const char* GetDefaultInstructionSetFeatures() { 489 return kDefaultInstructionSetFeatures; 490 } 491 492 private: 493 static void InitPlatformSignalHandlers(); 494 495 Runtime(); 496 497 void BlockSignals(); 498 499 bool Init(const RuntimeOptions& options, bool ignore_unrecognized) 500 SHARED_TRYLOCK_FUNCTION(true, Locks::mutator_lock_); 501 void InitNativeMethods() LOCKS_EXCLUDED(Locks::mutator_lock_); 502 void InitThreadGroups(Thread* self); 503 void RegisterRuntimeNativeMethods(JNIEnv* env); 504 505 void StartDaemonThreads(); 506 void StartSignalCatcher(); 507 508 // A pointer to the active runtime or NULL. 509 static Runtime* instance_; 510 511 static const char* kDefaultInstructionSetFeatures; 512 513 // NOTE: these must match the gc::ProcessState values as they come directly from the framework. 514 static constexpr int kProfileForground = 0; 515 static constexpr int kProfileBackgrouud = 1; 516 517 GcRoot<mirror::ArtMethod> callee_save_methods_[kLastCalleeSaveType]; 518 GcRoot<mirror::Throwable> pre_allocated_OutOfMemoryError_; 519 GcRoot<mirror::Throwable> pre_allocated_NoClassDefFoundError_; 520 GcRoot<mirror::ArtMethod> resolution_method_; 521 GcRoot<mirror::ArtMethod> imt_conflict_method_; 522 // Unresolved method has the same behavior as the conflict method, it is used by the class linker 523 // for differentiating between unfilled imt slots vs conflict slots in superclasses. 524 GcRoot<mirror::ArtMethod> imt_unimplemented_method_; 525 GcRoot<mirror::ObjectArray<mirror::ArtMethod>> default_imt_; 526 527 InstructionSet instruction_set_; 528 QuickMethodFrameInfo callee_save_method_frame_infos_[kLastCalleeSaveType]; 529 530 CompilerCallbacks* compiler_callbacks_; 531 bool is_zygote_; 532 bool must_relocate_; 533 bool is_concurrent_gc_enabled_; 534 bool is_explicit_gc_disabled_; 535 bool dex2oat_enabled_; 536 bool image_dex2oat_enabled_; 537 538 std::string compiler_executable_; 539 std::string patchoat_executable_; 540 std::vector<std::string> compiler_options_; 541 std::vector<std::string> image_compiler_options_; 542 std::string image_location_; 543 544 std::string boot_class_path_string_; 545 std::string class_path_string_; 546 std::vector<std::string> properties_; 547 548 // The default stack size for managed threads created by the runtime. 549 size_t default_stack_size_; 550 551 gc::Heap* heap_; 552 553 // The number of spins that are done before thread suspension is used to forcibly inflate. 554 size_t max_spins_before_thin_lock_inflation_; 555 MonitorList* monitor_list_; 556 MonitorPool* monitor_pool_; 557 558 ThreadList* thread_list_; 559 560 InternTable* intern_table_; 561 562 ClassLinker* class_linker_; 563 564 SignalCatcher* signal_catcher_; 565 std::string stack_trace_file_; 566 567 JavaVMExt* java_vm_; 568 569 // Fault message, printed when we get a SIGSEGV. 570 Mutex fault_message_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; 571 std::string fault_message_ GUARDED_BY(fault_message_lock_); 572 573 // Method verifier set, used so that we can update their GC roots. 574 Mutex method_verifier_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; 575 std::set<verifier::MethodVerifier*> method_verifiers_; 576 577 // A non-zero value indicates that a thread has been created but not yet initialized. Guarded by 578 // the shutdown lock so that threads aren't born while we're shutting down. 579 size_t threads_being_born_ GUARDED_BY(Locks::runtime_shutdown_lock_); 580 581 // Waited upon until no threads are being born. 582 std::unique_ptr<ConditionVariable> shutdown_cond_ GUARDED_BY(Locks::runtime_shutdown_lock_); 583 584 // Set when runtime shutdown is past the point that new threads may attach. 585 bool shutting_down_ GUARDED_BY(Locks::runtime_shutdown_lock_); 586 587 // The runtime is starting to shutdown but is blocked waiting on shutdown_cond_. 588 bool shutting_down_started_ GUARDED_BY(Locks::runtime_shutdown_lock_); 589 590 bool started_; 591 592 // New flag added which tells us if the runtime has finished starting. If 593 // this flag is set then the Daemon threads are created and the class loader 594 // is created. This flag is needed for knowing if its safe to request CMS. 595 bool finished_starting_; 596 597 // Hooks supported by JNI_CreateJavaVM 598 jint (*vfprintf_)(FILE* stream, const char* format, va_list ap); 599 void (*exit_)(jint status); 600 void (*abort_)(); 601 602 bool stats_enabled_; 603 RuntimeStats stats_; 604 605 const bool running_on_valgrind_; 606 607 std::string profile_output_filename_; 608 ProfilerOptions profiler_options_; 609 bool profiler_started_; 610 611 bool method_trace_; 612 std::string method_trace_file_; 613 size_t method_trace_file_size_; 614 instrumentation::Instrumentation instrumentation_; 615 616 typedef AllocationTrackingSafeMap<jobject, std::vector<const DexFile*>, 617 kAllocatorTagCompileTimeClassPath, JobjectComparator> 618 CompileTimeClassPaths; 619 CompileTimeClassPaths compile_time_class_paths_; 620 bool use_compile_time_class_path_; 621 622 jobject main_thread_group_; 623 jobject system_thread_group_; 624 625 // As returned by ClassLoader.getSystemClassLoader(). 626 jobject system_class_loader_; 627 628 // If true, then we dump the GC cumulative timings on shutdown. 629 bool dump_gc_performance_on_shutdown_; 630 631 // Transaction used for pre-initializing classes at compilation time. 632 Transaction* preinitialization_transaction_; 633 NullPointerHandler* null_pointer_handler_; 634 SuspensionHandler* suspend_handler_; 635 StackOverflowHandler* stack_overflow_handler_; 636 637 // If false, verification is disabled. True by default. 638 bool verify_; 639 640 // Specifies target SDK version to allow workarounds for certain API levels. 641 int32_t target_sdk_version_; 642 643 // Implicit checks flags. 644 bool implicit_null_checks_; // NullPointer checks are implicit. 645 bool implicit_so_checks_; // StackOverflow checks are implicit. 646 bool implicit_suspend_checks_; // Thread suspension checks are implicit. 647 648 // The filename to the native bridge library. If this is not empty the native bridge will be 649 // initialized and loaded from the given file (initialized and available). An empty value means 650 // that there's no native bridge (initialized but not available). 651 // 652 // The native bridge allows running native code compiled for a foreign ISA. The way it works is, 653 // if standard dlopen fails to load native library associated with native activity, it calls to 654 // the native bridge to load it and then gets the trampoline for the entry to native activity. 655 std::string native_bridge_library_filename_; 656 657 DISALLOW_COPY_AND_ASSIGN(Runtime); 658}; 659 660} // namespace art 661 662#endif // ART_RUNTIME_RUNTIME_H_ 663