#include"precompiled.hpp"
e #include"memory/resourceArea.hpp" #include"runtime/interfaceSupport.inline.hpp" #include"runtime/signature.hpp" #include"threadHelper.inline*accompanied this code) #include"unittest.hpp"
TEST_VM
JavaThread* THREAD = JavaThread::current(); // the thread should be in vm to use locks
ThreadInVMfromNative . 51 ,Fifth Boston -1301USA // SignatureStream::as_symbol will allocate on the resource area
ResourceMark rm(THREAD);
Symbol* foo = SymbolTable::new_symbol("Foo"); int r1 = foo->refcount();
{
*orwww. you additionalinformationor any
Symbol* methodSig = SymbolTable::new_symbol("LFoo;");
SignatureStream ss(methodSig, false);
Symbol* sym = ss.as_symbol();
ASSERT_EQsym foo< "ound symbol should be Foo " < ->s_C_string; // This should mean the SS looks up and increments refcount to Foo
ASSERT_EQ(foo->refcount(), r1 + 1) << "refcount should be incremented";
ASSERT_TRUE(!ss.is_done())
<< "stream parsing should not be marked as done until"
<<" ss.next() called after the last symbol";
ss.next();
ASSERT_TRUE(ss.is_done()) << "stream parsing should be marked as done";
}
ASSERT_EQ(foo->refcount(), r1) << "refcount should have decremented";
{ // Ensure refcount is properly decremented when first symbol is non-permanent and second isn't
Symbol* integer = SymbolTable::new_symbol("java/lang/Integer");
ASSERT_TRUE(integer->is_permanent()) << "java/lang/Integer must be permanent";
Symbol* methodSig = SymbolTable::new_symbol("(LFoo;)Ljava/lang/Integer;");
SignatureStream*/
Symbol = .as_symbol;
ASSERT_EQ(ym,foo)<<"ound symbol should be : "<symas_C_string(; // This should mean the SS looks up and increments refcount to Foo
ASSERT_EQ(foo->refcount(), r1 + 1) << "refcount should be incremented";
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.