diff options
47 files changed, 110 insertions, 79 deletions
diff --git a/build/Android.cpplint.mk b/build/Android.cpplint.mk index d09f2902db..f924a855b7 100644 --- a/build/Android.cpplint.mk +++ b/build/Android.cpplint.mk @@ -21,7 +21,7 @@ ART_CPPLINT_FILTER := --filter=-whitespace/line_length,-build/include,-readabili ART_CPPLINT_FLAGS := --quiet --root=$(ANDROID_BUILD_TOP) ART_CPPLINT_INGORED := \ runtime/elf.h \ - runtime/openjdkjvmti/jvmti.h + runtime/openjdkjvmti/include/jvmti.h # This: # 1) Gets a list of all .h & .cc files in the art directory. diff --git a/compiler/optimizing/intrinsics_arm64.cc b/compiler/optimizing/intrinsics_arm64.cc index 934ba1b9fb..807d6cf54f 100644 --- a/compiler/optimizing/intrinsics_arm64.cc +++ b/compiler/optimizing/intrinsics_arm64.cc @@ -1560,7 +1560,10 @@ void IntrinsicCodeGeneratorARM64::VisitStringEquals(HInvoke* invoke) { // Load `count` field of the argument string and check if it matches the const string. // Also compares the compression style, if differs return false. __ Ldr(temp, MemOperand(arg.X(), count_offset)); + // Temporarily release temp1 as we may not be able to embed the flagged count in CMP immediate. + scratch_scope.Release(temp1); __ Cmp(temp, Operand(mirror::String::GetFlaggedCount(const_string_length, is_compressed))); + temp1 = scratch_scope.AcquireW(); __ B(&return_false, ne); } else { // Load `count` fields of this and argument strings. diff --git a/compiler/optimizing/ssa_liveness_analysis_test.cc b/compiler/optimizing/ssa_liveness_analysis_test.cc index cc48d3196b..1916c73ca4 100644 --- a/compiler/optimizing/ssa_liveness_analysis_test.cc +++ b/compiler/optimizing/ssa_liveness_analysis_test.cc @@ -32,6 +32,7 @@ class SsaLivenessAnalysisTest : public testing::Test { : pool_(), allocator_(&pool_), graph_(CreateGraph(&allocator_)), + compiler_options_(), instruction_set_(kRuntimeISA) { std::string error_msg; instruction_set_features_ = @@ -39,7 +40,7 @@ class SsaLivenessAnalysisTest : public testing::Test { codegen_ = CodeGenerator::Create(graph_, instruction_set_, *instruction_set_features_, - CompilerOptions()); + compiler_options_); CHECK(codegen_ != nullptr) << instruction_set_ << " is not a supported target architecture."; // Create entry block. entry_ = new (&allocator_) HBasicBlock(graph_); @@ -59,6 +60,7 @@ class SsaLivenessAnalysisTest : public testing::Test { ArenaPool pool_; ArenaAllocator allocator_; HGraph* graph_; + CompilerOptions compiler_options_; InstructionSet instruction_set_; std::unique_ptr<const InstructionSetFeatures> instruction_set_features_; std::unique_ptr<CodeGenerator> codegen_; diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 3fa30fafb1..92a12c8d07 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -1486,7 +1486,7 @@ class Dex2Oat FINAL { TimingLogger::ScopedTiming t3("Loading image checksum", timings_); std::vector<gc::space::ImageSpace*> image_spaces = Runtime::Current()->GetHeap()->GetBootImageSpaces(); - image_file_location_oat_checksum_ = OatFileAssistant::CalculateCombinedImageChecksum(); + image_file_location_oat_checksum_ = image_spaces[0]->GetImageHeader().GetOatChecksum(); image_file_location_oat_data_begin_ = reinterpret_cast<uintptr_t>(image_spaces[0]->GetImageHeader().GetOatDataBegin()); image_patch_delta_ = image_spaces[0]->GetImageHeader().GetPatchDelta(); @@ -1907,6 +1907,14 @@ class Dex2Oat FINAL { oat_writer->GetOatDataOffset(), oat_writer->GetOatSize()); } + + if (IsBootImage()) { + // Have the image_file_location_oat_checksum_ for boot oat files + // depend on the contents of all the boot oat files. This way only + // the primary image checksum needs to be checked to determine + // whether any of the images are out of date. + image_file_location_oat_checksum_ ^= oat_writer->GetOatHeader().GetChecksum(); + } } for (size_t i = 0, size = oat_files_.size(); i != size; ++i) { diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 952a71793c..eb7d7bd9a3 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -906,7 +906,6 @@ bool ClassLinker::InitFromBootImage(std::string* error_msg) { runtime->GetOatFileManager().RegisterImageOatFiles(spaces); DCHECK(!oat_files.empty()); const OatHeader& default_oat_header = oat_files[0]->GetOatHeader(); - CHECK_EQ(default_oat_header.GetImageFileLocationOatChecksum(), 0U); CHECK_EQ(default_oat_header.GetImageFileLocationOatDataBegin(), 0U); const char* image_file_location = oat_files[0]->GetOatHeader(). GetStoreValueByKey(OatHeader::kImageLocationKey); diff --git a/runtime/dexopt_test.cc b/runtime/dexopt_test.cc index 51678699b4..db65e40da5 100644 --- a/runtime/dexopt_test.cc +++ b/runtime/dexopt_test.cc @@ -111,7 +111,7 @@ void DexoptTest::GenerateOatForTest(const std::string& dex_location, &error_msg)); ASSERT_TRUE(image_header != nullptr) << error_msg; const OatHeader& oat_header = odex_file->GetOatHeader(); - uint32_t combined_checksum = OatFileAssistant::CalculateCombinedImageChecksum(); + uint32_t combined_checksum = image_header->GetOatChecksum(); if (CompilerFilter::DependsOnImageChecksum(filter)) { if (with_alternate_image) { diff --git a/runtime/oat_file_assistant.cc b/runtime/oat_file_assistant.cc index 48bf1e72a4..1735045d60 100644 --- a/runtime/oat_file_assistant.cc +++ b/runtime/oat_file_assistant.cc @@ -750,32 +750,18 @@ OatFileAssistant::ImageInfo::GetRuntimeImageInfo(InstructionSet isa, std::string // same as kRuntimeISA, so this behavior is suspect (b/35659889). if (isa == kRuntimeISA) { const ImageHeader& image_header = image_spaces[0]->GetImageHeader(); + info->oat_checksum = image_header.GetOatChecksum(); info->oat_data_begin = reinterpret_cast<uintptr_t>(image_header.GetOatDataBegin()); info->patch_delta = image_header.GetPatchDelta(); - - info->oat_checksum = 0; - for (gc::space::ImageSpace* image_space : image_spaces) { - info->oat_checksum ^= image_space->GetImageHeader().GetOatChecksum(); - } } else { std::unique_ptr<ImageHeader> image_header( gc::space::ImageSpace::ReadImageHeader(info->location.c_str(), isa, error_msg)); if (image_header == nullptr) { return nullptr; } + info->oat_checksum = image_header->GetOatChecksum(); info->oat_data_begin = reinterpret_cast<uintptr_t>(image_header->GetOatDataBegin()); info->patch_delta = image_header->GetPatchDelta(); - - info->oat_checksum = 0; - for (gc::space::ImageSpace* image_space : image_spaces) { - std::string location = image_space->GetImageLocation(); - image_header.reset( - gc::space::ImageSpace::ReadImageHeader(location.c_str(), isa, error_msg)); - if (image_header == nullptr) { - return nullptr; - } - info->oat_checksum ^= image_header->GetOatChecksum(); - } } return info; } @@ -792,16 +778,6 @@ const OatFileAssistant::ImageInfo* OatFileAssistant::GetImageInfo() { return cached_image_info_.get(); } -uint32_t OatFileAssistant::CalculateCombinedImageChecksum(InstructionSet isa) { - std::string error_msg; - std::unique_ptr<ImageInfo> info = ImageInfo::GetRuntimeImageInfo(isa, &error_msg); - if (info == nullptr) { - LOG(WARNING) << "Unable to get runtime image info for checksum: " << error_msg; - return 0; - } - return info->oat_checksum; -} - OatFileAssistant::OatFileInfo& OatFileAssistant::GetBestInfo() { bool use_oat = oat_.IsUseable() || odex_.Status() == kOatCannotOpen; return use_oat ? oat_ : odex_; diff --git a/runtime/oat_file_assistant.h b/runtime/oat_file_assistant.h index eec87f0768..d61e9949b6 100644 --- a/runtime/oat_file_assistant.h +++ b/runtime/oat_file_assistant.h @@ -276,8 +276,6 @@ class OatFileAssistant { std::string* oat_filename, std::string* error_msg); - static uint32_t CalculateCombinedImageChecksum(InstructionSet isa = kRuntimeISA); - private: struct ImageInfo { uint32_t oat_checksum = 0; diff --git a/runtime/openjdkjvmti/Android.bp b/runtime/openjdkjvmti/Android.bp index c01e3f4152..dd49ad0cfb 100644 --- a/runtime/openjdkjvmti/Android.bp +++ b/runtime/openjdkjvmti/Android.bp @@ -13,6 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +cc_library_headers { + name: "libopenjdkjvmti_headers", + host_supported: true, + export_include_dirs: ["include"], +} + cc_defaults { name: "libopenjdkjvmti_defaults", defaults: ["art_defaults"], @@ -40,6 +46,7 @@ cc_defaults { "ti_timers.cc", "transform.cc"], include_dirs: ["art/runtime"], + header_libs: ["libopenjdkjvmti_headers"], shared_libs: [ "libbase", "libnativehelper", diff --git a/runtime/openjdkjvmti/OpenjdkJvmTi.cc b/runtime/openjdkjvmti/OpenjdkJvmTi.cc index 5e0d4bdd07..5401e5cdf8 100644 --- a/runtime/openjdkjvmti/OpenjdkJvmTi.cc +++ b/runtime/openjdkjvmti/OpenjdkJvmTi.cc @@ -35,7 +35,7 @@ #include <jni.h> -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "art_jvmti.h" #include "base/logging.h" diff --git a/runtime/openjdkjvmti/jvmti.h b/runtime/openjdkjvmti/include/jvmti.h index de07c163fc..de07c163fc 100644 --- a/runtime/openjdkjvmti/jvmti.h +++ b/runtime/openjdkjvmti/include/jvmti.h diff --git a/runtime/openjdkjvmti/ti_class.cc b/runtime/openjdkjvmti/ti_class.cc index 4282e38b17..2d1b25ed26 100644 --- a/runtime/openjdkjvmti/ti_class.cc +++ b/runtime/openjdkjvmti/ti_class.cc @@ -62,6 +62,7 @@ #include "thread-inl.h" #include "thread_list.h" #include "ti_class_loader.h" +#include "ti_phase.h" #include "ti_redefine.h" #include "utils.h" @@ -142,6 +143,18 @@ struct ClassCallback : public art::ClassLoadCallback { // It is a primitive or array. Just return return; } + jvmtiPhase phase = PhaseUtil::GetPhaseUnchecked(); + if (UNLIKELY(phase != JVMTI_PHASE_START && phase != JVMTI_PHASE_LIVE)) { + // We want to wait until we are at least in the START phase so that all WellKnownClasses and + // mirror classes have been initialized and loaded. The runtime relies on these classes having + // specific fields and methods present. Since PreDefine hooks don't need to abide by this + // restriction we will simply not send the event for these classes. + LOG(WARNING) << "Ignoring load of class <" << descriptor << "> as it is being loaded during " + << "runtime initialization."; + return; + } + + // Strip the 'L' and ';' from the descriptor std::string name(std::string(descriptor).substr(1, strlen(descriptor) - 2)); art::Thread* self = art::Thread::Current(); diff --git a/test/021-string2/src/Main.java b/test/021-string2/src/Main.java index 0dd82abf6f..194f4a1a7d 100644 --- a/test/021-string2/src/Main.java +++ b/test/021-string2/src/Main.java @@ -127,6 +127,9 @@ public class Main { Assert.assertEquals("I", /* Small latin dotless i */ "\u0131".toUpperCase()); Assert.assertEquals("abc", "a\u0131c".replace('\u0131', 'b')); Assert.assertEquals("a\u0131c", "abc".replace('b', '\u0131')); + + // Regression test for scratch register exhaustion in String.equals() intrinsic on arm64. + Assert.assertFalse(result.equals("Very long constant string, so that the known constant count field cannot be embedded in a CMP immediate instruction on arm64. Since it can hold 12-bit values, optionally shifted left by 12, let's go somewhere over 2^12, i.e. 4096. That should trigger the bug with or without string compression. 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/")); } public static void testCompareToAndEquals() { diff --git a/test/901-hello-ti-agent/basics.cc b/test/901-hello-ti-agent/basics.cc index 0b17656303..91662770be 100644 --- a/test/901-hello-ti-agent/basics.cc +++ b/test/901-hello-ti-agent/basics.cc @@ -20,7 +20,7 @@ #include <stdio.h> #include <string.h> #include "base/macros.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ti-agent/common_helper.h" #include "ti-agent/common_load.h" diff --git a/test/903-hello-tagging/tagging.cc b/test/903-hello-tagging/tagging.cc index 6177263cd2..b85ed48930 100644 --- a/test/903-hello-tagging/tagging.cc +++ b/test/903-hello-tagging/tagging.cc @@ -25,7 +25,7 @@ #include "art_method-inl.h" #include "base/logging.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ti-agent/common_helper.h" #include "ti-agent/common_load.h" #include "utils.h" diff --git a/test/904-object-allocation/tracking.cc b/test/904-object-allocation/tracking.cc index 95eab0c6cc..cc6f681d79 100644 --- a/test/904-object-allocation/tracking.cc +++ b/test/904-object-allocation/tracking.cc @@ -21,7 +21,7 @@ #include "base/logging.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ScopedUtfChars.h" #include "ti-agent/common_helper.h" diff --git a/test/905-object-free/tracking_free.cc b/test/905-object-free/tracking_free.cc index 7b26d79edb..5eed4729af 100644 --- a/test/905-object-free/tracking_free.cc +++ b/test/905-object-free/tracking_free.cc @@ -21,7 +21,7 @@ #include "base/logging.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ScopedUtfChars.h" #include "ti-agent/common_helper.h" diff --git a/test/906-iterate-heap/iterate_heap.cc b/test/906-iterate-heap/iterate_heap.cc index 13c3562b60..f2532debfb 100644 --- a/test/906-iterate-heap/iterate_heap.cc +++ b/test/906-iterate-heap/iterate_heap.cc @@ -26,7 +26,7 @@ #include "android-base/stringprintf.h" #include "base/logging.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedPrimitiveArray.h" #include "ti-agent/common_helper.h" #include "ti-agent/common_load.h" diff --git a/test/907-get-loaded-classes/get_loaded_classes.cc b/test/907-get-loaded-classes/get_loaded_classes.cc index 5bda7ebac8..48ce2e2de1 100644 --- a/test/907-get-loaded-classes/get_loaded_classes.cc +++ b/test/907-get-loaded-classes/get_loaded_classes.cc @@ -21,7 +21,7 @@ #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ScopedUtfChars.h" diff --git a/test/908-gc-start-finish/gc_callbacks.cc b/test/908-gc-start-finish/gc_callbacks.cc index 8f96ee63ef..45148f87cd 100644 --- a/test/908-gc-start-finish/gc_callbacks.cc +++ b/test/908-gc-start-finish/gc_callbacks.cc @@ -19,7 +19,7 @@ #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ti-agent/common_helper.h" #include "ti-agent/common_load.h" diff --git a/test/909-attach-agent/attach.cc b/test/909-attach-agent/attach.cc index adae844ef0..67c756745f 100644 --- a/test/909-attach-agent/attach.cc +++ b/test/909-attach-agent/attach.cc @@ -20,7 +20,7 @@ #include <stdio.h> #include <string.h> #include "base/macros.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" namespace art { namespace Test909AttachAgent { diff --git a/test/910-methods/methods.cc b/test/910-methods/methods.cc index f60fabb1df..fdc4cdbe04 100644 --- a/test/910-methods/methods.cc +++ b/test/910-methods/methods.cc @@ -18,7 +18,7 @@ #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ti-agent/common_helper.h" diff --git a/test/911-get-stack-trace/stack_trace.cc b/test/911-get-stack-trace/stack_trace.cc index 68f6d8dfb2..5a3a311255 100644 --- a/test/911-get-stack-trace/stack_trace.cc +++ b/test/911-get-stack-trace/stack_trace.cc @@ -24,7 +24,7 @@ #include "base/logging.h" #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ti-agent/common_helper.h" #include "ti-agent/common_load.h" diff --git a/test/912-classes/classes.cc b/test/912-classes/classes.cc index 3ccfe86bed..5bd34f6be8 100644 --- a/test/912-classes/classes.cc +++ b/test/912-classes/classes.cc @@ -20,7 +20,7 @@ #include "class_linker.h" #include "jni.h" #include "mirror/class_loader.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "runtime.h" #include "ScopedLocalRef.h" #include "ScopedUtfChars.h" diff --git a/test/913-heaps/heaps.cc b/test/913-heaps/heaps.cc index 39fa000195..66fc7bef9a 100644 --- a/test/913-heaps/heaps.cc +++ b/test/913-heaps/heaps.cc @@ -28,7 +28,7 @@ #include "jit/jit.h" #include "jni.h" #include "native_stack_dump.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "runtime.h" #include "scoped_thread_state_change-inl.h" #include "thread-inl.h" diff --git a/test/918-fields/fields.cc b/test/918-fields/fields.cc index 7d29912f47..c659126aae 100644 --- a/test/918-fields/fields.cc +++ b/test/918-fields/fields.cc @@ -18,7 +18,7 @@ #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ti-agent/common_helper.h" diff --git a/test/920-objects/objects.cc b/test/920-objects/objects.cc index 0553a9d007..ad1431ed00 100644 --- a/test/920-objects/objects.cc +++ b/test/920-objects/objects.cc @@ -18,7 +18,7 @@ #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ti-agent/common_helper.h" diff --git a/test/922-properties/properties.cc b/test/922-properties/properties.cc index cb732c74f1..3fd274e9d6 100644 --- a/test/922-properties/properties.cc +++ b/test/922-properties/properties.cc @@ -18,7 +18,7 @@ #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedUtfChars.h" #include "ti-agent/common_helper.h" diff --git a/test/923-monitors/monitors.cc b/test/923-monitors/monitors.cc index 4baa530ec2..131fc6a4d4 100644 --- a/test/923-monitors/monitors.cc +++ b/test/923-monitors/monitors.cc @@ -18,7 +18,7 @@ #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedUtfChars.h" #include "ti-agent/common_helper.h" diff --git a/test/924-threads/threads.cc b/test/924-threads/threads.cc index 0380433d19..14ea5af60e 100644 --- a/test/924-threads/threads.cc +++ b/test/924-threads/threads.cc @@ -20,7 +20,7 @@ #include "base/macros.h" #include "base/logging.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ti-agent/common_helper.h" diff --git a/test/925-threadgroups/threadgroups.cc b/test/925-threadgroups/threadgroups.cc index 6c6e835dd3..2feaab079b 100644 --- a/test/925-threadgroups/threadgroups.cc +++ b/test/925-threadgroups/threadgroups.cc @@ -20,7 +20,7 @@ #include "base/macros.h" #include "base/logging.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ti-agent/common_helper.h" diff --git a/test/927-timers/timers.cc b/test/927-timers/timers.cc index 58d5c271e6..7b1d5c3f52 100644 --- a/test/927-timers/timers.cc +++ b/test/927-timers/timers.cc @@ -20,7 +20,7 @@ #include "base/logging.h" #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ti-agent/common_helper.h" #include "ti-agent/common_load.h" diff --git a/test/928-jni-table/jni_table.cc b/test/928-jni-table/jni_table.cc index 5123d3a43f..b5c0efdd95 100644 --- a/test/928-jni-table/jni_table.cc +++ b/test/928-jni-table/jni_table.cc @@ -17,7 +17,7 @@ #include <stdio.h> #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "base/logging.h" #include "base/macros.h" diff --git a/test/929-search/search.cc b/test/929-search/search.cc index d1c698491e..ad7a05323b 100644 --- a/test/929-search/search.cc +++ b/test/929-search/search.cc @@ -20,7 +20,7 @@ #include "base/logging.h" #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedUtfChars.h" #include "ti-agent/common_helper.h" diff --git a/test/931-agent-thread/agent_thread.cc b/test/931-agent-thread/agent_thread.cc index a488d9a803..f8f9e48657 100644 --- a/test/931-agent-thread/agent_thread.cc +++ b/test/931-agent-thread/agent_thread.cc @@ -21,7 +21,7 @@ #include "base/logging.h" #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "runtime.h" #include "ScopedLocalRef.h" #include "thread-inl.h" diff --git a/test/933-misc-events/misc_events.cc b/test/933-misc-events/misc_events.cc index 860d4b5e16..7043350b5a 100644 --- a/test/933-misc-events/misc_events.cc +++ b/test/933-misc-events/misc_events.cc @@ -21,7 +21,7 @@ #include "base/logging.h" #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ti-agent/common_helper.h" #include "ti-agent/common_load.h" diff --git a/test/936-search-onload/search_onload.cc b/test/936-search-onload/search_onload.cc index 2286a467d3..3b19ca591d 100644 --- a/test/936-search-onload/search_onload.cc +++ b/test/936-search-onload/search_onload.cc @@ -22,7 +22,7 @@ #include "base/logging.h" #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedUtfChars.h" #include "ti-agent/common_helper.h" diff --git a/test/944-transform-classloaders/classloader.cc b/test/944-transform-classloaders/classloader.cc index 5fbd8e11c9..7cb3c08dc3 100644 --- a/test/944-transform-classloaders/classloader.cc +++ b/test/944-transform-classloaders/classloader.cc @@ -16,8 +16,8 @@ #include "base/macros.h" #include "jni.h" +#include "jvmti.h" #include "mirror/class-inl.h" -#include "openjdkjvmti/jvmti.h" #include "ScopedLocalRef.h" #include "ti-agent/common_helper.h" diff --git a/test/945-obsolete-native/obsolete_native.cc b/test/945-obsolete-native/obsolete_native.cc index 061e7afbbc..442836b7ff 100644 --- a/test/945-obsolete-native/obsolete_native.cc +++ b/test/945-obsolete-native/obsolete_native.cc @@ -24,7 +24,7 @@ #include "base/logging.h" #include "base/macros.h" #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" #include "ti-agent/common_helper.h" #include "ti-agent/common_load.h" diff --git a/test/Android.bp b/test/Android.bp index 00c890a834..594cce2a6e 100644 --- a/test/Android.bp +++ b/test/Android.bp @@ -279,6 +279,7 @@ art_cc_defaults { shared_libs: [ "libbase", ], + header_libs: ["libopenjdkjvmti_headers"], } art_cc_test_library { diff --git a/test/knownfailures.json b/test/knownfailures.json index 50d70f18dc..535b94fdf0 100644 --- a/test/knownfailures.json +++ b/test/knownfailures.json @@ -103,7 +103,8 @@ { "test": "152-dead-large-object", "variant": "gcstress", - "description": ["152-dead-large-object requires a heap larger than what gcstress uses."] + "description": ["152-dead-large-object requires a heap larger than what gcstress uses."], + "bug": "http://b/35800768" }, { "tests": ["908-gc-start-finish", @@ -128,9 +129,10 @@ "variant": "gcstress" }, { - "tests": "154-gc-loop", - "variant": "gcstress | jit", - "description": ["154-gc-loop depends GC not happening too often"] + "test": "154-gc-loop", + "variant": "gcstress | jit & debug", + "description": ["154-gc-loop depends GC not happening too often"], + "bug": "http://b/35917229" }, { "test": "115-native-bridge", diff --git a/test/testrunner/run_build_test_target.py b/test/testrunner/run_build_test_target.py index 0cd1ddee7b..4c519ae7f7 100755 --- a/test/testrunner/run_build_test_target.py +++ b/test/testrunner/run_build_test_target.py @@ -14,15 +14,28 @@ # See the License for the specific language governing permissions and # limitations under the License. +"""Build and run go/ab/git_master-art-host target + +Provided with a target name, the script setup the environment for +building the test target by taking config information from +from target_config.py. + +If the target field is defined in the configuration for the target, it +invokes `make` to build the target, otherwise, it assumes +that the its is a run-test target, and invokes testrunner.py +script for building and running the run-tests. +""" + import argparse import os import subprocess +import sys from target_config import target_config import env parser = argparse.ArgumentParser() -parser.add_argument('--build-target', required=True, dest='build_target') +parser.add_argument('build_target') parser.add_argument('-j', default='1', dest='n_threads') options = parser.parse_args() @@ -49,6 +62,7 @@ else: run_test_command += target.get('flags', []) run_test_command += ['-j', str(n_threads)] run_test_command += ['-b'] + run_test_command += ['--host'] run_test_command += ['--verbose'] print run_test_command diff --git a/test/testrunner/target_config.py b/test/testrunner/target_config.py index 5387d6a8e8..1af2ae7a63 100644 --- a/test/testrunner/target_config.py +++ b/test/testrunner/target_config.py @@ -51,7 +51,8 @@ target_config = { 'flags': ['--jit', '--gcstress'], 'env' : { - 'ART_USE_READ_BARRIER' : 'false' + 'ART_USE_READ_BARRIER' : 'false', + 'ART_DEFAULT_GC_TYPE' : 'SS' } }, 'art-read-barrier' : { @@ -185,20 +186,20 @@ target_config = { } }, 'art-gtest' : { - 'target' : 'test-art-gtest', + 'target' : 'test-art-host-gtest', 'env' : { 'ART_USE_READ_BARRIER' : 'true' } }, 'art-gtest-read-barrier': { - 'target' : 'test-art-gtest', + 'target' : 'test-art-host-gtest', 'env' : { 'ART_USE_READ_BARRIER' : 'true', 'ART_HEAP_POISONING' : 'true' } }, 'art-gtest-read-barrier-table-lookup': { - 'target' : 'test-art-gtest', + 'target' : 'test-art-host-gtest', 'env': { 'ART_USE_READ_BARRIER' : 'true', 'ART_READ_BARRIER_TYPE' : 'TABLELOOKUP', @@ -206,21 +207,21 @@ target_config = { } }, 'art-gtest-ss-gc': { - 'target' : 'test-art-gtest', + 'target' : 'test-art-host-gtest', 'env': { 'ART_DEFAULT_GC_TYPE' : 'SS', 'ART_USE_READ_BARRIER' : 'false' } }, 'art-gtest-gss-gc': { - 'target' : 'test-art-gtest', + 'target' : 'test-art-host-gtest', 'env' : { 'ART_DEFAULT_GC_TYPE' : 'GSS', 'ART_USE_READ_BARRIER' : 'false' } }, 'art-gtest-ss-gc-tlab': { - 'target' : 'test-art-gtest', + 'target' : 'test-art-host-gtest', 'env': { 'ART_DEFAULT_GC_TYPE' : 'SS', 'ART_USE_TLAB' : 'true', @@ -228,13 +229,20 @@ target_config = { } }, 'art-gtest-gss-gc-tlab': { - 'target' : 'test-art-gtest', + 'target' : 'test-art-host-gtest', 'env': { 'ART_DEFAULT_GC_TYPE' : 'GSS', 'ART_USE_TLAB' : 'true', 'ART_USE_READ_BARRIER' : 'false' } }, + 'art-gtest-debug-gc' : { + 'target' : 'test-art-host-gtest', + 'env' : { + 'ART_TEST_DEBUG_GC' : 'true', + 'ART_USE_READ_BARRIER' : 'false' + } + }, 'art-gtest-valgrind32': { 'target' : 'valgrind-test-art-host32', 'env': { diff --git a/test/ti-agent/common_helper.cc b/test/ti-agent/common_helper.cc index ea6359e5e0..4ddd0aafb0 100644 --- a/test/ti-agent/common_helper.cc +++ b/test/ti-agent/common_helper.cc @@ -25,7 +25,7 @@ #include "art_method.h" #include "jni.h" #include "jni_internal.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "scoped_thread_state_change-inl.h" #include "ScopedLocalRef.h" #include "stack.h" diff --git a/test/ti-agent/common_helper.h b/test/ti-agent/common_helper.h index 031850147e..0a316edc7b 100644 --- a/test/ti-agent/common_helper.h +++ b/test/ti-agent/common_helper.h @@ -18,7 +18,7 @@ #define ART_TEST_TI_AGENT_COMMON_HELPER_H_ #include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" #include "ScopedLocalRef.h" namespace art { diff --git a/test/ti-agent/common_load.cc b/test/ti-agent/common_load.cc index 351857d1d9..fddae3af02 100644 --- a/test/ti-agent/common_load.cc +++ b/test/ti-agent/common_load.cc @@ -18,8 +18,6 @@ #include <jni.h> #include <stdio.h> -// TODO I don't know? -#include "openjdkjvmti/jvmti.h" #include "art_method-inl.h" #include "base/logging.h" diff --git a/test/ti-agent/common_load.h b/test/ti-agent/common_load.h index d2544214ec..e79a0067b0 100644 --- a/test/ti-agent/common_load.h +++ b/test/ti-agent/common_load.h @@ -17,8 +17,7 @@ #ifndef ART_TEST_TI_AGENT_COMMON_LOAD_H_ #define ART_TEST_TI_AGENT_COMMON_LOAD_H_ -#include "jni.h" -#include "openjdkjvmti/jvmti.h" +#include "jvmti.h" namespace art { |