Don't retrieve generic information during ti-stress
This cuts down significantly on memory use during these tests and
prevents test-failing log-messages from being generated in some
situations.
Test: ./test/run-test --host --jvmti-field-stress 044-proxy
Bug: 120995005
Change-Id: I8f65096d7d08f4d50f4c71607b8ba8b1859b0382
diff --git a/test/ti-stress/stress.cc b/test/ti-stress/stress.cc
index e123e9f..cd7af10 100644
--- a/test/ti-stress/stress.cc
+++ b/test/ti-stress/stress.cc
@@ -157,14 +157,12 @@
: jvmtienv_(jvmtienv),
class_(c),
name_(nullptr),
- generic_(nullptr),
file_(nullptr),
debug_ext_(nullptr) {}
~ScopedClassInfo() {
if (class_ != nullptr) {
jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(name_));
- jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(generic_));
jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(file_));
jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(debug_ext_));
}
@@ -173,12 +171,11 @@
bool Init() {
if (class_ == nullptr) {
name_ = const_cast<char*>("<NONE>");
- generic_ = const_cast<char*>("<NONE>");
return true;
} else {
jvmtiError ret1 = jvmtienv_->GetSourceFileName(class_, &file_);
jvmtiError ret2 = jvmtienv_->GetSourceDebugExtension(class_, &debug_ext_);
- return jvmtienv_->GetClassSignature(class_, &name_, &generic_) == JVMTI_ERROR_NONE &&
+ return jvmtienv_->GetClassSignature(class_, &name_, nullptr) == JVMTI_ERROR_NONE &&
ret1 != JVMTI_ERROR_MUST_POSSESS_CAPABILITY &&
ret1 != JVMTI_ERROR_INVALID_CLASS &&
ret2 != JVMTI_ERROR_MUST_POSSESS_CAPABILITY &&
@@ -192,9 +189,6 @@
const char* GetName() const {
return name_;
}
- const char* GetGeneric() const {
- return generic_;
- }
const char* GetSourceDebugExtension() const {
if (debug_ext_ == nullptr) {
return "<UNKNOWN_SOURCE_DEBUG_EXTENSION>";
@@ -214,7 +208,6 @@
jvmtiEnv* jvmtienv_;
jclass class_;
char* name_;
- char* generic_;
char* file_;
char* debug_ext_;
};
@@ -229,14 +222,12 @@
class_info_(nullptr),
name_(nullptr),
signature_(nullptr),
- generic_(nullptr),
first_line_(-1) {}
~ScopedMethodInfo() {
DeleteLocalRef(env_, declaring_class_);
jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(name_));
jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(signature_));
- jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(generic_));
}
bool Init() {
@@ -257,7 +248,7 @@
return false;
}
return class_info_->Init() &&
- (jvmtienv_->GetMethodName(method_, &name_, &signature_, &generic_) == JVMTI_ERROR_NONE);
+ (jvmtienv_->GetMethodName(method_, &name_, &signature_, nullptr) == JVMTI_ERROR_NONE);
}
const ScopedClassInfo& GetDeclaringClassInfo() const {
@@ -276,10 +267,6 @@
return signature_;
}
- const char* GetGeneric() const {
- return generic_;
- }
-
jint GetFirstLine() const {
return first_line_;
}
@@ -292,7 +279,6 @@
std::unique_ptr<ScopedClassInfo> class_info_;
char* name_;
char* signature_;
- char* generic_;
jint first_line_;
friend std::ostream& operator<<(std::ostream &os, ScopedMethodInfo const& m);
@@ -306,20 +292,18 @@
field_(field),
class_info_(nullptr),
name_(nullptr),
- type_(nullptr),
- generic_(nullptr) {}
+ type_(nullptr) {}
~ScopedFieldInfo() {
jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(name_));
jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(type_));
- jvmtienv_->Deallocate(reinterpret_cast<unsigned char*>(generic_));
}
bool Init() {
class_info_.reset(new ScopedClassInfo(jvmtienv_, declaring_class_));
return class_info_->Init() &&
(jvmtienv_->GetFieldName(
- declaring_class_, field_, &name_, &type_, &generic_) == JVMTI_ERROR_NONE);
+ declaring_class_, field_, &name_, &type_, nullptr) == JVMTI_ERROR_NONE);
}
const ScopedClassInfo& GetDeclaringClassInfo() const {
@@ -338,10 +322,6 @@
return type_;
}
- const char* GetGeneric() const {
- return generic_;
- }
-
private:
jvmtiEnv* jvmtienv_;
jclass declaring_class_;
@@ -349,7 +329,6 @@
std::unique_ptr<ScopedClassInfo> class_info_;
char* name_;
char* type_;
- char* generic_;
friend std::ostream& operator<<(std::ostream &os, ScopedFieldInfo const& m);
};