diff options
Diffstat (limited to 'runtime/runtime.cc')
| -rw-r--r-- | runtime/runtime.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 14628f0403..2086d70791 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -37,6 +37,8 @@ #include <vector> #include <fcntl.h> +#include "android-base/strings.h" + #include "JniConstants.h" #include "ScopedLocalRef.h" #include "arch/arm/quick_method_frame_info_arm.h" @@ -869,7 +871,7 @@ static bool OpenDexFilesFromImage(const std::string& image_location, ImageHeader::GetOatLocationFromImageLocation(image_locations[index].c_str()); // Note: in the multi-image case, the image location may end in ".jar," and not ".art." Handle // that here. - if (EndsWith(oat_location, ".jar")) { + if (android::base::EndsWith(oat_location, ".jar")) { oat_location.replace(oat_location.length() - 3, 3, "oat"); } std::string error_msg; @@ -1197,6 +1199,8 @@ bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) { CHECK_EQ(self->GetThreadId(), ThreadList::kMainThreadId); CHECK(self != nullptr); + self->SetCanCallIntoJava(!IsAotCompiler()); + // Set us to runnable so tools using a runtime can allocate and GC by default self->TransitionFromSuspendedToRunnable(); @@ -1225,7 +1229,7 @@ bool Runtime::Init(RuntimeArgumentMap&& runtime_options_in) { for (const DexFile* dex_file : boot_class_path) { dex_locations.push_back(dex_file->GetLocation()); } - boot_class_path_string_ = Join(dex_locations, ':'); + boot_class_path_string_ = android::base::Join(dex_locations, ':'); } { ScopedTrace trace2("AddImageStringsToTable"); @@ -1719,7 +1723,7 @@ void Runtime::VisitImageRoots(RootVisitor* visitor) { if (space->IsImageSpace()) { auto* image_space = space->AsImageSpace(); const auto& image_header = image_space->GetImageHeader(); - for (size_t i = 0; i < ImageHeader::kImageRootsMax; ++i) { + for (int32_t i = 0, size = image_header.GetImageRoots()->GetLength(); i != size; ++i) { auto* obj = image_header.GetImageRoot(static_cast<ImageHeader::ImageRoot>(i)); if (obj != nullptr) { auto* after_obj = obj; @@ -1892,7 +1896,7 @@ void Runtime::RegisterAppInfo(const std::vector<std::string>& code_paths, } VLOG(profiler) << "Register app with " << profile_output_filename - << " " << Join(code_paths, ':'); + << " " << android::base::Join(code_paths, ':'); if (profile_output_filename.empty()) { LOG(WARNING) << "JIT profile information will not be recorded: profile filename is empty."; |