runtime.h revision 7223d44a4893522e90d00bca38b119f710e55122
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 [[noreturn]] static void Abort() LOCKS_EXCLUDED(Locks::abort_lock_); 181 182 // Returns the "main" ThreadGroup, used when attaching user threads. 183 jobject GetMainThreadGroup() const; 184 185 // Returns the "system" ThreadGroup, used when attaching our internal threads. 186 jobject GetSystemThreadGroup() const; 187 188 // Returns the system ClassLoader which represents the CLASSPATH. 189 jobject GetSystemClassLoader() const; 190 191 // Attaches the calling native thread to the runtime. 192 bool AttachCurrentThread(const char* thread_name, bool as_daemon, jobject thread_group, 193 bool create_peer); 194 195 void CallExitHook(jint status); 196 197 // Detaches the current native thread from the runtime. 198 void DetachCurrentThread() LOCKS_EXCLUDED(Locks::mutator_lock_); 199 200 void DumpForSigQuit(std::ostream& os); 201 void DumpLockHolders(std::ostream& os); 202 203 ~Runtime(); 204 205 const std::string& GetBootClassPathString() const { 206 return boot_class_path_string_; 207 } 208 209 const std::string& GetClassPathString() const { 210 return class_path_string_; 211 } 212 213 ClassLinker* GetClassLinker() const { 214 return class_linker_; 215 } 216 217 size_t GetDefaultStackSize() const { 218 return default_stack_size_; 219 } 220 221 gc::Heap* GetHeap() const { 222 return heap_; 223 } 224 225 InternTable* GetInternTable() const { 226 DCHECK(intern_table_ != NULL); 227 return intern_table_; 228 } 229 230 JavaVMExt* GetJavaVM() const { 231 return java_vm_; 232 } 233 234 size_t GetMaxSpinsBeforeThinkLockInflation() const { 235 return max_spins_before_thin_lock_inflation_; 236 } 237 238 MonitorList* GetMonitorList() const { 239 return monitor_list_; 240 } 241 242 MonitorPool* GetMonitorPool() const { 243 return monitor_pool_; 244 } 245 246 // Is the given object the special object used to mark a cleared JNI weak global? 247 bool IsClearedJniWeakGlobal(mirror::Object* obj) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 248 249 // Get the special object used to mark a cleared JNI weak global. 250 mirror::Object* GetClearedJniWeakGlobal() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 251 252 mirror::Throwable* GetPreAllocatedOutOfMemoryError() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 253 254 mirror::Throwable* GetPreAllocatedNoClassDefFoundError() 255 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 256 257 const std::vector<std::string>& GetProperties() const { 258 return properties_; 259 } 260 261 ThreadList* GetThreadList() const { 262 return thread_list_; 263 } 264 265 static const char* GetVersion() { 266 return "2.1.0"; 267 } 268 269 void DisallowNewSystemWeaks() EXCLUSIVE_LOCKS_REQUIRED(Locks::mutator_lock_); 270 void AllowNewSystemWeaks() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 271 272 // Visit all the roots. If only_dirty is true then non-dirty roots won't be visited. If 273 // clean_dirty is true then dirty roots will be marked as non-dirty after visiting. 274 void VisitRoots(RootCallback* visitor, void* arg, VisitRootFlags flags = kVisitRootFlagAllRoots) 275 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 276 277 // Visit all of the roots we can do safely do concurrently. 278 void VisitConcurrentRoots(RootCallback* visitor, void* arg, 279 VisitRootFlags flags = kVisitRootFlagAllRoots) 280 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 281 282 // Visit all of the non thread roots, we can do this with mutators unpaused. 283 void VisitNonThreadRoots(RootCallback* visitor, void* arg) 284 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 285 286 // Visit all other roots which must be done with mutators suspended. 287 void VisitNonConcurrentRoots(RootCallback* visitor, void* arg) 288 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 289 290 // Sweep system weaks, the system weak is deleted if the visitor return nullptr. Otherwise, the 291 // system weak is updated to be the visitor's returned value. 292 void SweepSystemWeaks(IsMarkedCallback* visitor, void* arg) 293 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 294 295 // Constant roots are the roots which never change after the runtime is initialized, they only 296 // need to be visited once per GC cycle. 297 void VisitConstantRoots(RootCallback* callback, void* arg) 298 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 299 300 // Returns a special method that calls into a trampoline for runtime method resolution 301 mirror::ArtMethod* GetResolutionMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 302 303 bool HasResolutionMethod() const { 304 return !resolution_method_.IsNull(); 305 } 306 307 void SetResolutionMethod(mirror::ArtMethod* method) { 308 resolution_method_ = GcRoot<mirror::ArtMethod>(method); 309 } 310 311 mirror::ArtMethod* CreateResolutionMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 312 313 // Returns a special method that calls into a trampoline for runtime imt conflicts. 314 mirror::ArtMethod* GetImtConflictMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 315 316 bool HasImtConflictMethod() const { 317 return !imt_conflict_method_.IsNull(); 318 } 319 320 void SetImtConflictMethod(mirror::ArtMethod* method) { 321 imt_conflict_method_ = GcRoot<mirror::ArtMethod>(method); 322 } 323 324 mirror::ArtMethod* CreateImtConflictMethod() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 325 326 // Returns an imt with every entry set to conflict, used as default imt for all classes. 327 mirror::ObjectArray<mirror::ArtMethod>* GetDefaultImt() 328 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 329 330 bool HasDefaultImt() const { 331 return !default_imt_.IsNull(); 332 } 333 334 void SetDefaultImt(mirror::ObjectArray<mirror::ArtMethod>* imt) { 335 default_imt_ = GcRoot<mirror::ObjectArray<mirror::ArtMethod>>(imt); 336 } 337 338 mirror::ObjectArray<mirror::ArtMethod>* CreateDefaultImt(ClassLinker* cl) 339 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 340 341 // Returns a special method that describes all callee saves being spilled to the stack. 342 enum CalleeSaveType { 343 kSaveAll, 344 kRefsOnly, 345 kRefsAndArgs, 346 kLastCalleeSaveType // Value used for iteration 347 }; 348 349 bool HasCalleeSaveMethod(CalleeSaveType type) const { 350 return !callee_save_methods_[type].IsNull(); 351 } 352 353 mirror::ArtMethod* GetCalleeSaveMethod(CalleeSaveType type) 354 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 355 356 mirror::ArtMethod* GetCalleeSaveMethodUnchecked(CalleeSaveType type) 357 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 358 359 QuickMethodFrameInfo GetCalleeSaveMethodFrameInfo(CalleeSaveType type) const { 360 return callee_save_method_frame_infos_[type]; 361 } 362 363 QuickMethodFrameInfo GetRuntimeMethodFrameInfo(mirror::ArtMethod* method) 364 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 365 366 static size_t GetCalleeSaveMethodOffset(CalleeSaveType type) { 367 return OFFSETOF_MEMBER(Runtime, callee_save_methods_[type]); 368 } 369 370 InstructionSet GetInstructionSet() const { 371 return instruction_set_; 372 } 373 374 void SetInstructionSet(InstructionSet instruction_set); 375 376 void SetCalleeSaveMethod(mirror::ArtMethod* method, CalleeSaveType type); 377 378 mirror::ArtMethod* CreateCalleeSaveMethod(CalleeSaveType type) 379 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 380 381 int32_t GetStat(int kind); 382 383 RuntimeStats* GetStats() { 384 return &stats_; 385 } 386 387 bool HasStatsEnabled() const { 388 return stats_enabled_; 389 } 390 391 void ResetStats(int kinds); 392 393 void SetStatsEnabled(bool new_state) LOCKS_EXCLUDED(Locks::instrument_entrypoints_lock_, 394 Locks::mutator_lock_); 395 396 enum class NativeBridgeAction { // private 397 kUnload, 398 kInitialize 399 }; 400 void PreZygoteFork(); 401 bool InitZygote(); 402 void DidForkFromZygote(JNIEnv* env, NativeBridgeAction action, const char* isa); 403 404 const instrumentation::Instrumentation* GetInstrumentation() const { 405 return &instrumentation_; 406 } 407 408 instrumentation::Instrumentation* GetInstrumentation() { 409 return &instrumentation_; 410 } 411 412 bool UseCompileTimeClassPath() const { 413 return use_compile_time_class_path_; 414 } 415 416 void AddMethodVerifier(verifier::MethodVerifier* verifier) LOCKS_EXCLUDED(method_verifier_lock_); 417 void RemoveMethodVerifier(verifier::MethodVerifier* verifier) 418 LOCKS_EXCLUDED(method_verifier_lock_); 419 420 const std::vector<const DexFile*>& GetCompileTimeClassPath(jobject class_loader); 421 void SetCompileTimeClassPath(jobject class_loader, std::vector<const DexFile*>& class_path); 422 423 void StartProfiler(const char* profile_output_filename); 424 void UpdateProfilerState(int state); 425 426 // Transaction support. 427 bool IsActiveTransaction() const { 428 return preinitialization_transaction_ != nullptr; 429 } 430 void EnterTransactionMode(Transaction* transaction); 431 void ExitTransactionMode(); 432 void RecordWriteFieldBoolean(mirror::Object* obj, MemberOffset field_offset, uint8_t value, 433 bool is_volatile) const; 434 void RecordWriteFieldByte(mirror::Object* obj, MemberOffset field_offset, int8_t value, 435 bool is_volatile) const; 436 void RecordWriteFieldChar(mirror::Object* obj, MemberOffset field_offset, uint16_t value, 437 bool is_volatile) const; 438 void RecordWriteFieldShort(mirror::Object* obj, MemberOffset field_offset, int16_t value, 439 bool is_volatile) const; 440 void RecordWriteField32(mirror::Object* obj, MemberOffset field_offset, uint32_t value, 441 bool is_volatile) const; 442 void RecordWriteField64(mirror::Object* obj, MemberOffset field_offset, uint64_t value, 443 bool is_volatile) const; 444 void RecordWriteFieldReference(mirror::Object* obj, MemberOffset field_offset, 445 mirror::Object* value, bool is_volatile) const; 446 void RecordWriteArray(mirror::Array* array, size_t index, uint64_t value) const 447 SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); 448 void RecordStrongStringInsertion(mirror::String* s) const 449 EXCLUSIVE_LOCKS_REQUIRED(Locks::intern_table_lock_); 450 void RecordWeakStringInsertion(mirror::String* s) const 451 EXCLUSIVE_LOCKS_REQUIRED(Locks::intern_table_lock_); 452 void RecordStrongStringRemoval(mirror::String* s) const 453 EXCLUSIVE_LOCKS_REQUIRED(Locks::intern_table_lock_); 454 void RecordWeakStringRemoval(mirror::String* s) const 455 EXCLUSIVE_LOCKS_REQUIRED(Locks::intern_table_lock_); 456 457 void SetFaultMessage(const std::string& message); 458 // Only read by the signal handler, NO_THREAD_SAFETY_ANALYSIS to prevent lock order violations 459 // with the unexpected_signal_lock_. 460 const std::string& GetFaultMessage() NO_THREAD_SAFETY_ANALYSIS { 461 return fault_message_; 462 } 463 464 void AddCurrentRuntimeFeaturesAsDex2OatArguments(std::vector<std::string>* arg_vector) const; 465 466 bool ExplicitStackOverflowChecks() const { 467 return !implicit_so_checks_; 468 } 469 470 bool IsVerificationEnabled() const { 471 return verify_; 472 } 473 474 bool RunningOnValgrind() const { 475 return running_on_valgrind_; 476 } 477 478 void SetTargetSdkVersion(int32_t version) { 479 target_sdk_version_ = version; 480 } 481 482 int32_t GetTargetSdkVersion() const { 483 return target_sdk_version_; 484 } 485 486 static const char* GetDefaultInstructionSetFeatures() { 487 return kDefaultInstructionSetFeatures; 488 } 489 490 private: 491 static void InitPlatformSignalHandlers(); 492 493 Runtime(); 494 495 void BlockSignals(); 496 497 bool Init(const RuntimeOptions& options, bool ignore_unrecognized) 498 SHARED_TRYLOCK_FUNCTION(true, Locks::mutator_lock_); 499 void InitNativeMethods() LOCKS_EXCLUDED(Locks::mutator_lock_); 500 void InitThreadGroups(Thread* self); 501 void RegisterRuntimeNativeMethods(JNIEnv* env); 502 503 void StartDaemonThreads(); 504 void StartSignalCatcher(); 505 506 // A pointer to the active runtime or NULL. 507 static Runtime* instance_; 508 509 static const char* kDefaultInstructionSetFeatures; 510 511 // NOTE: these must match the gc::ProcessState values as they come directly from the framework. 512 static constexpr int kProfileForground = 0; 513 static constexpr int kProfileBackgrouud = 1; 514 515 GcRoot<mirror::ArtMethod> callee_save_methods_[kLastCalleeSaveType]; 516 GcRoot<mirror::Throwable> pre_allocated_OutOfMemoryError_; 517 GcRoot<mirror::Throwable> pre_allocated_NoClassDefFoundError_; 518 GcRoot<mirror::ArtMethod> resolution_method_; 519 GcRoot<mirror::ArtMethod> imt_conflict_method_; 520 GcRoot<mirror::ObjectArray<mirror::ArtMethod>> default_imt_; 521 522 // Special sentinel object used to invalid conditions in JNI (cleared weak references) and 523 // JDWP (invalid references). 524 GcRoot<mirror::Object> sentinel_; 525 526 InstructionSet instruction_set_; 527 QuickMethodFrameInfo callee_save_method_frame_infos_[kLastCalleeSaveType]; 528 529 CompilerCallbacks* compiler_callbacks_; 530 bool is_zygote_; 531 bool must_relocate_; 532 bool is_concurrent_gc_enabled_; 533 bool is_explicit_gc_disabled_; 534 bool dex2oat_enabled_; 535 bool image_dex2oat_enabled_; 536 537 std::string compiler_executable_; 538 std::string patchoat_executable_; 539 std::vector<std::string> compiler_options_; 540 std::vector<std::string> image_compiler_options_; 541 std::string image_location_; 542 543 std::string boot_class_path_string_; 544 std::string class_path_string_; 545 std::vector<std::string> properties_; 546 547 // The default stack size for managed threads created by the runtime. 548 size_t default_stack_size_; 549 550 gc::Heap* heap_; 551 552 // The number of spins that are done before thread suspension is used to forcibly inflate. 553 size_t max_spins_before_thin_lock_inflation_; 554 MonitorList* monitor_list_; 555 MonitorPool* monitor_pool_; 556 557 ThreadList* thread_list_; 558 559 InternTable* intern_table_; 560 561 ClassLinker* class_linker_; 562 563 SignalCatcher* signal_catcher_; 564 std::string stack_trace_file_; 565 566 JavaVMExt* java_vm_; 567 568 // Fault message, printed when we get a SIGSEGV. 569 Mutex fault_message_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; 570 std::string fault_message_ GUARDED_BY(fault_message_lock_); 571 572 // Method verifier set, used so that we can update their GC roots. 573 Mutex method_verifier_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; 574 std::set<verifier::MethodVerifier*> method_verifiers_; 575 576 // A non-zero value indicates that a thread has been created but not yet initialized. Guarded by 577 // the shutdown lock so that threads aren't born while we're shutting down. 578 size_t threads_being_born_ GUARDED_BY(Locks::runtime_shutdown_lock_); 579 580 // Waited upon until no threads are being born. 581 std::unique_ptr<ConditionVariable> shutdown_cond_ GUARDED_BY(Locks::runtime_shutdown_lock_); 582 583 // Set when runtime shutdown is past the point that new threads may attach. 584 bool shutting_down_ GUARDED_BY(Locks::runtime_shutdown_lock_); 585 586 // The runtime is starting to shutdown but is blocked waiting on shutdown_cond_. 587 bool shutting_down_started_ GUARDED_BY(Locks::runtime_shutdown_lock_); 588 589 bool started_; 590 591 // New flag added which tells us if the runtime has finished starting. If 592 // this flag is set then the Daemon threads are created and the class loader 593 // is created. This flag is needed for knowing if its safe to request CMS. 594 bool finished_starting_; 595 596 // Hooks supported by JNI_CreateJavaVM 597 jint (*vfprintf_)(FILE* stream, const char* format, va_list ap); 598 void (*exit_)(jint status); 599 void (*abort_)(); 600 601 bool stats_enabled_; 602 RuntimeStats stats_; 603 604 const bool running_on_valgrind_; 605 606 std::string profile_output_filename_; 607 ProfilerOptions profiler_options_; 608 bool profiler_started_; 609 610 bool method_trace_; 611 std::string method_trace_file_; 612 size_t method_trace_file_size_; 613 instrumentation::Instrumentation instrumentation_; 614 615 typedef AllocationTrackingSafeMap<jobject, std::vector<const DexFile*>, 616 kAllocatorTagCompileTimeClassPath, JobjectComparator> 617 CompileTimeClassPaths; 618 CompileTimeClassPaths compile_time_class_paths_; 619 bool use_compile_time_class_path_; 620 621 jobject main_thread_group_; 622 jobject system_thread_group_; 623 624 // As returned by ClassLoader.getSystemClassLoader(). 625 jobject system_class_loader_; 626 627 // If true, then we dump the GC cumulative timings on shutdown. 628 bool dump_gc_performance_on_shutdown_; 629 630 // Transaction used for pre-initializing classes at compilation time. 631 Transaction* preinitialization_transaction_; 632 633 // If false, verification is disabled. True by default. 634 bool verify_; 635 636 // Specifies target SDK version to allow workarounds for certain API levels. 637 int32_t target_sdk_version_; 638 639 // Implicit checks flags. 640 bool implicit_null_checks_; // NullPointer checks are implicit. 641 bool implicit_so_checks_; // StackOverflow checks are implicit. 642 bool implicit_suspend_checks_; // Thread suspension checks are implicit. 643 644 // The filename to the native bridge library. If this is not empty the native bridge will be 645 // initialized and loaded from the given file (initialized and available). An empty value means 646 // that there's no native bridge (initialized but not available). 647 // 648 // The native bridge allows running native code compiled for a foreign ISA. The way it works is, 649 // if standard dlopen fails to load native library associated with native activity, it calls to 650 // the native bridge to load it and then gets the trampoline for the entry to native activity. 651 std::string native_bridge_library_filename_; 652 653 DISALLOW_COPY_AND_ASSIGN(Runtime); 654}; 655 656} // namespace art 657 658#endif // ART_RUNTIME_RUNTIME_H_ 659