Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 96544 Details for
Bug 148629
Support Java 6 Class File Format Changes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
This patch introduce new java 6 attributes parsing and interface to Harmony verifier
bci.patch (text/plain), 40.46 KB, created by
Vasily v. Levchenko
on 2008-04-18 01:00:00 EDT
(
hide
)
Description:
This patch introduce new java 6 attributes parsing and interface to Harmony verifier
Filename:
MIME Type:
Creator:
Vasily v. Levchenko
Created:
2008-04-18 01:00:00 EDT
Size:
40.46 KB
patch
obsolete
>? BCIEng >? bci.patch >Index: Common/CommonDef.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.probekit/src-native/BCI/Common/CommonDef.h,v >retrieving revision 1.10 >diff -U3 -p -r1.10 CommonDef.h >--- Common/CommonDef.h 25 Apr 2006 16:16:35 -0000 1.10 >+++ Common/CommonDef.h 15 Apr 2008 03:54:07 -0000 >@@ -22,14 +22,13 @@ > // For this header to work, you need to define one of these ARCH symbols: > // > // WIN32 (means x86) >+// IA32_ARCH (means x86) > // IPF_ARCH (means Itanium Processor Family) > // EM64T_ARCH (means Intel/AMD 64-bit processors) >-// IA32_ARCH (means x86) > // SPARC_ARCH > // HPPA_ARCH > // ALPHA_ARCH > // PPC_ARCH >-// LINUX_PPC_ARCH (LINUX PPC64) > // OS390_ARCH (means zSeries) > // AS400_ARCH (means iSeries) > // >@@ -72,10 +71,14 @@ > // This brings _WINDOWS_ into scope. Use _WINDOWS_ to wrap Windows code. > # include <windows.h> /* for lots o' stuff, but esp. _WINDOWS_ */ > # include <malloc.h> /* for alloca */ >-#elif defined(IPF_ARCH) || (EM64T_ARCH) || (LINUX_PPC_ARCH) >+#elif defined(IPF_ARCH) || (EM64T_ARCH) > # include <stdint.h> /* for int64_t and uint64_t */ > #endif > >+/* On LinuxPPC64 we need this to get int64_t */ >+#if defined(PPC_ARCH) >+# include </usr/include/sys/types.h> >+#endif > /* Only on OS400, we need this to get malloc/free */ > #ifdef OS400 > #include <stdlib.h> >@@ -113,15 +116,17 @@ typedef unsigned short WORD, *PWORD; > typedef signed long long int int64_t; > typedef unsigned long long int uint64_t; > #else >-#if defined(_WINDOWS_) >+# if defined(_WINDOWS_) > typedef __int64 int64_t; > typedef unsigned __int64 uint64_t; >-#else >-# if !defined(IPF_ARCH) && !defined(EM64T_ARCH) && !defined(LINUX_PPC_ARCH) // Already being declared in stdint.h >- typedef long long int64_t; >+#elif defined(PPC_ARCH) > typedef unsigned long long uint64_t; >+# else >+# if !defined(IPF_ARCH) && !defined(EM64T_ARCH) >+ typedef long long int64_t; >+ typedef unsigned long long uint64_t; > # endif >-#endif >+# endif > #endif > > //------------------------------------------------------------------------------ >@@ -197,7 +202,7 @@ typedef unsigned short WORD, *PWORD; > /////// > #if defined(WIN32) || defined(IA32_ARCH) || defined(IPF_ARCH) || defined(EM64T_ARCH) || defined(ALPHA_ARCH) > # define BIG_ENDIAN_HW >-#elif defined(SPARC_ARCH) || defined(HPPA_ARCH) || defined(PPC_ARCH) || defined(AS400_ARCH) || defined(OS390_ARCH) || defined(LINUX_PPC_ARCH) >+#elif defined(SPARC_ARCH) || defined(HPPA_ARCH) || defined(PPC_ARCH) || defined(AS400_ARCH) || defined(OS390_ARCH) > # define LITTLE_ENDIAN_HW > #else > # error "Platform-specific configuration required" >Index: Common/JavaDef.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.probekit/src-native/BCI/Common/JavaDef.h,v >retrieving revision 1.5 >diff -U3 -p -r1.5 JavaDef.h >--- Common/JavaDef.h 24 Mar 2006 22:00:25 -0000 1.5 >+++ Common/JavaDef.h 15 Apr 2008 03:54:07 -0000 >@@ -50,6 +50,7 @@ > #define CONSTANT_InterfaceMethodref 11 // Interface method refernce constant > #define CONSTANT_NameAndType 12 // Name and type constant > >+#define CONSTANT_Unknown 0 > // Array types > #define T_BOOLEAN 4 // bool > #define T_CHAR 5 // char >@@ -60,7 +61,21 @@ > #define T_INT 10 // int > #define T_LONG 11 // long > >-#define CONSTANT_Unknown 0 >+// stack map frame types (new in Java 6.0) >+#define SAME_LOCALS_1_STACK_ITEM_EXTENDED 247 >+#define SAME_FRAME_EXTENDED 251 >+#define FULL_FRAME 255 >+ >+// verification types (new in Java 6.0) >+#define ITEM_Top 0 >+#define ITEM_Integer 1 >+#define ITEM_Float 2 >+#define ITEM_Double 3 >+#define ITEM_Long 4 >+#define ITEM_Null 5 >+#define ITEM_UninitializedThis 6 >+#define ITEM_Object 7 >+#define ITEM_Uninitialized 8 > > // ToDo: other Java specific definitions > typedef unsigned char u1; // 1 byte >Index: JClass/JClassBuilder.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.probekit/src-native/BCI/JClass/JClassBuilder.cpp,v >retrieving revision 1.5 >diff -U3 -p -r1.5 JClassBuilder.cpp >--- JClass/JClassBuilder.cpp 24 Mar 2006 22:00:44 -0000 1.5 >+++ JClass/JClassBuilder.cpp 15 Apr 2008 03:54:07 -0000 >@@ -80,7 +80,8 @@ CJClassBuilder::GetThisClassName() > string > CJClassBuilder::GetSuperClassName() > { >- CCPUtf8Info* pcpUtf8 = (CCPUtf8Info*)((*m_pConstPool)[GetSuperClass()]); >+ CCPClassInfo* pccpClassInfo = (CCPClassInfo*)((*m_pConstPool)[GetSuperClass()]); >+ CCPUtf8Info* pcpUtf8 = (CCPUtf8Info*)((*m_pConstPool)[pccpClassInfo->GetClassInd()]); > string strSuperClass = (string)*pcpUtf8; > return strSuperClass; > } >@@ -245,6 +246,7 @@ CJClassBuilder::FindClass(CSTR i_szName) > CConstPool::iterator itr = m_pConstPool->begin(); > while(itr != m_pConstPool->end()) > { >+ if (*itr == NULL) return NULL; > if((*itr)->GetTag() == CONSTANT_Class) > { > CCPClassInfo* pcpci = (CCPClassInfo*)*itr; >@@ -278,6 +280,22 @@ CJClassBuilder::CreateStringConstant(CST > } > > //------------------------------------------------------------------------------ >+// CreateClassConstant >+// In: >+// i_szClassName - class name >+// Returns: >+// CCPClassInfo* - pointer to the class infoin the constant pool >+// >+CCPClassInfo* >+CJClassBuilder::CreateClassConstant(CSTR i_szClassName) >+{ >+ u2 u2ClassName = m_pConstPool->Add(new CCPUtf8Info(i_szClassName)); >+ u2 u2ClassRef = m_pConstPool->Add(new CCPClassInfo(u2ClassName)); >+ CCPClassInfo* pcpClass = (CCPClassInfo*)((*m_pConstPool)[u2ClassRef]); >+ return pcpClass; >+} >+ >+//------------------------------------------------------------------------------ > // CreateIntegerConstant > // In: > // i_int - Integer value to add >Index: JClass/JClassBuilder.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.probekit/src-native/BCI/JClass/JClassBuilder.h,v >retrieving revision 1.5 >diff -U3 -p -r1.5 JClassBuilder.h >--- JClass/JClassBuilder.h 24 Mar 2006 22:00:45 -0000 1.5 >+++ JClass/JClassBuilder.h 15 Apr 2008 03:54:07 -0000 >@@ -62,7 +62,8 @@ public: > > // Constant pool manipulation > CCPStringInfo* CreateStringConstant(CSTR i_szString); >- CCPIntegerInfo* CreateIntegerConstant (JINTEGER i_int); >+ CCPClassInfo* CreateClassConstant(CSTR i_szClassName); >+ CCPIntegerInfo* CreateIntegerConstant (JINTEGER i_int); > CCPLongInfo* CreateLongConstant(JLONG i_long); > CCPFloatInfo* CreateFloatConstant(JFLOAT i_float); > CCPDoubleInfo* CreateDoubleConstant(JDOUBLE i_double); >Index: JClass/JClassFile.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.probekit/src-native/BCI/JClass/JClassFile.cpp,v >retrieving revision 1.7 >diff -U3 -p -r1.7 JClassFile.cpp >--- JClass/JClassFile.cpp 10 Apr 2006 03:57:43 -0000 1.7 >+++ JClass/JClassFile.cpp 18 Apr 2008 04:51:26 -0000 >@@ -47,8 +47,11 @@ > # include <iostream> > #endif > >+#include "JavaDef.h" > #include "CommonDef.h" >+ > #include "JClassFile.h" >+#include "JMemStream.h" > > USE_NAMESPACE(std); > >@@ -259,8 +262,9 @@ CCPUtf8Info::~CCPUtf8Info() > void > CCPUtf8Info::Read(CJStream& i_jstream) > { >- i_jstream >> m_u2Length; >- m_pu1Bytes = new u1[m_u2Length]; >+ i_jstream >> m_u2Length; >+ m_pu1Bytes = new u1[m_u2Length + 1]; >+ m_pu1Bytes[m_u2Length] = 0; /*Helps standard string functions find end of the string*/ > i_jstream.ReadUtf8((void*)m_pu1Bytes, m_u2Length); > } > >@@ -1738,6 +1742,10 @@ CJAttribs::Read(CJStream& i_jstream) > { > pCurrent = new CLocalVariableTypeTableAttribute(m_pClassFile); > } >+ else if(*pcpUtf8 == "StackMapTable") >+ { >+ pCurrent = new CStackMapTableAttribute(m_pClassFile); >+ } > else if(*pcpUtf8 == "Exceptions") > { > pCurrent = new CExceptionsAttribute(m_pClassFile); >@@ -2119,6 +2127,41 @@ CCodeAttribute::GetLocalVariableTypes() > return NULL; > } > >+//------------------------------------------------------------------------------ >+CStackMapTableAttribute* >+CCodeAttribute::GetStackMaps() >+{ >+ for(CJAttribs::iterator iter = m_Attribs.begin(); iter < m_Attribs.end(); iter++) >+ { >+ if(*(*iter)->GetName() == "StackMapTable") >+ return (CStackMapTableAttribute*)*iter; >+ } >+ return NULL; >+} >+ >+//------------------------------------------------------------------------------ >+CStackMapTableAttribute* >+CCodeAttribute::GetOrCreateStackMaps() >+{ >+ // Return the StackMapTable attribute of this Code attribute, creating a new one >+ // if such an attribute does not exist >+ >+ CStackMapTableAttribute* result = NULL; >+ for(CJAttribs::iterator iter = m_Attribs.begin(); iter < m_Attribs.end(); iter++) >+ { >+ if(*(*iter)->GetName() == "StackMapTable") >+ { >+ result = (CStackMapTableAttribute*)*iter; >+ } >+ } >+ >+ if (result == NULL) >+ { >+ result = new CStackMapTableAttribute(m_pClassFile); >+ m_Attribs.push_back(result); >+ } >+ return result; >+} > > //============================================================================== > // CExceptionsAttribute implementation >@@ -2500,6 +2543,764 @@ CSourceDirAttribute::CSourceDirAttribute > {} > > //============================================================================== >+// CStackMapTableAttribute implementation >+// >+CVerificationTypeInfo::CVerificationTypeInfo(u1 i_u1Tag) >+: m_u1Tag(i_u1Tag) >+{ >+} >+ >+CVerificationTypeInfo::~CVerificationTypeInfo() >+{ >+} >+ >+void >+CVerificationTypeInfo::Read(CJStream& i_jstream) >+{ >+ // m_u1Tag is read by the CVerificationTypes container. >+} >+ >+u2 >+CVerificationTypeInfo::Read(u1 *i_tbl) >+{ >+ // m_u1Tag is read by the CVerificationTypes container. >+ return 0; >+} >+ >+void >+CVerificationTypeInfo::Write(CJStream& i_jstream) const >+{ >+ i_jstream << m_u1Tag; >+} >+ >+u4 >+CVerificationTypeInfo::GetSize() const >+{ >+ return sizeof(m_u1Tag); >+} >+ >+//------------------------------------------------------------------------------ >+CVerificationTypes::~CVerificationTypes() >+{ >+ for (iterator iter = begin(); iter != end(); iter++) >+ { >+ delete *iter; >+ } >+} >+ >+CVerificationTypes::CVerificationTypes(const CVerificationTypes &i_VerTypes) >+{ >+ *this = i_VerTypes; >+} >+ >+CVerificationTypes& >+CVerificationTypes::operator =(const CVerificationTypes &i_VerTypes) >+{ >+ for(iterator iter = begin(); iter != end(); iter++) >+ { >+ delete *iter; >+ } >+ if(!i_VerTypes.empty()) >+ { >+ const_iterator iterIn; >+ clear(); >+ for(iterIn = i_VerTypes.begin(); iterIn != i_VerTypes.end(); iterIn++) >+ { >+ push_back((*iterIn)->Clone()); >+ } >+ } >+ return *this; >+} >+ >+void >+CVerificationTypes::Read(CJStream& i_jstream, u2 i_u2EntriesToRead) >+{ >+ CVerificationTypeInfo* pCurrent; >+ >+ resize(i_u2EntriesToRead); >+ for(u2 u2Ind = 0; u2Ind < i_u2EntriesToRead; u2Ind++) >+ { >+ u1 u1Tag; >+ i_jstream >> u1Tag; >+ switch (u1Tag) >+ { >+ case ITEM_Top: >+ case ITEM_Integer: >+ case ITEM_Float: >+ case ITEM_Double: >+ case ITEM_Long: >+ case ITEM_Null: >+ case ITEM_UninitializedThis: >+ pCurrent = new CVerificationTypeInfo(u1Tag); >+ break; >+ case ITEM_Object: >+ pCurrent = new CVerificationTypeObjectInfo(u1Tag); >+ break; >+ case ITEM_Uninitialized: >+ pCurrent = new CVerificationTypeUninitializedVariableInfo(u1Tag); >+ break; >+ default: >+ throw CJClassFileException(CJClassFileException::X_INTERNAL_ERROR); >+ } >+ >+ pCurrent->Read(i_jstream); >+ (*this)[u2Ind] = pCurrent; >+ } >+} >+ >+void >+CVerificationTypes::Write(CJStream& i_jstream) const >+{ >+ for (u2 u2Ind = 0; u2Ind < size(); u2Ind++) >+ { >+ (*this)[u2Ind]->Write(i_jstream); >+ } >+} >+ >+u4 >+CVerificationTypes::GetSize() const >+{ >+ u4 u4Size = 0; >+ for (const_iterator iter = begin(); iter != end(); iter++) >+ { >+ u4Size += (*iter)->GetSize(); >+ } >+ return u4Size; >+} >+ >+//------------------------------------------------------------------------------ >+CVerificationTypeObjectInfo::CVerificationTypeObjectInfo(u1 i_u1Tag) >+: CVerificationTypeInfo(i_u1Tag) >+{ >+} >+ >+CVerificationTypeObjectInfo::~CVerificationTypeObjectInfo() >+{ >+} >+ >+void >+CVerificationTypeObjectInfo::Read(CJStream& i_jstream) >+{ >+ CVerificationTypeInfo::Read(i_jstream); >+ i_jstream >> m_u2CpoolIndex; >+} >+ >+void >+CVerificationTypeObjectInfo::Write(CJStream& i_jstream) const >+{ >+ CVerificationTypeInfo::Write(i_jstream); >+ i_jstream << m_u2CpoolIndex; >+} >+ >+u4 >+CVerificationTypeObjectInfo::GetSize() const >+{ >+ u4 u4Size = CVerificationTypeInfo::GetSize() >+ + sizeof(m_u2CpoolIndex); >+ return u4Size; >+} >+ >+//------------------------------------------------------------------------------ >+CVerificationTypeUninitializedVariableInfo::CVerificationTypeUninitializedVariableInfo(u1 i_u1Tag) >+: CVerificationTypeInfo(i_u1Tag) >+{ >+} >+ >+CVerificationTypeUninitializedVariableInfo::~CVerificationTypeUninitializedVariableInfo() >+{ >+} >+ >+void >+CVerificationTypeUninitializedVariableInfo::Read(CJStream& i_jstream) >+{ >+ CVerificationTypeInfo::Read(i_jstream); >+ i_jstream >> m_u2Offset; >+} >+ >+void >+CVerificationTypeUninitializedVariableInfo::Write(CJStream& i_jstream) const >+{ >+ CVerificationTypeInfo::Write(i_jstream); >+ i_jstream << m_u2Offset; >+} >+ >+u4 >+CVerificationTypeUninitializedVariableInfo::GetSize() const >+{ >+ u4 u4Size = CVerificationTypeInfo::GetSize() >+ + sizeof(m_u2Offset); >+ return u4Size; >+} >+ >+//------------------------------------------------------------------------------ >+CStackMapFrameInfo::CStackMapFrameInfo(u1 i_u1FrameType) >+: m_u1FrameType(i_u1FrameType) >+{ >+ m_u2ByteCodeOffset = 0; >+ m_u2OffsetDelta = 0; >+} >+ >+CStackMapFrameInfo::~CStackMapFrameInfo() >+{ >+} >+ >+void >+CStackMapFrameInfo::Read(CJStream& i_jstream) >+{ >+ // m_u1FrameType is read by the CStackMapTable container >+} >+ >+void >+CStackMapFrameInfo::Write(CJStream& i_jstream) const >+{ >+ i_jstream << m_u1FrameType; >+} >+ >+u4 >+CStackMapFrameInfo::GetSize() const >+{ >+ return sizeof(m_u1FrameType); >+} >+ >+void >+CStackMapFrameInfo::SetByteCodeOffset(u2 i_u2Offset) >+{ >+ m_u2ByteCodeOffset = i_u2Offset; >+} >+ >+void >+CStackMapFrameInfo::AdjustOffsetDelta(int i_s2PrevFrameOffset) >+{ >+ int newOffsetDelta = m_u2ByteCodeOffset - 1 - i_s2PrevFrameOffset; >+ if (newOffsetDelta < 0) >+ { >+ // Frame order was changed. This is not supported >+ throw CJClassFileException(CJClassFileException::X_INTERNAL_ERROR); >+ } >+ m_u2OffsetDelta = (u2)newOffsetDelta; // this is a safe cast since newDelta >= 1 >+} >+ >+CStackMapFrameInfo::CStackMapFrameInfo(const CStackMapFrameInfo &i_Other) >+: m_u2ByteCodeOffset(i_Other.m_u2ByteCodeOffset), m_u2OffsetDelta(i_Other.m_u2OffsetDelta), >+ m_u1FrameType(i_Other.m_u1FrameType) >+{ >+} >+ >+//------------------------------------------------------------------------------ >+CStackMapSameFrameInfo::CStackMapSameFrameInfo(u1 i_u1FrameType, bool i_IsExtended) >+: CStackMapFrameInfo(i_u1FrameType), m_IsExtended(i_IsExtended) >+{ >+} >+ >+CStackMapSameFrameInfo::~CStackMapSameFrameInfo() >+{ >+} >+ >+void >+CStackMapSameFrameInfo::Read(CJStream& i_jstream) >+{ >+ CStackMapFrameInfo::Read(i_jstream); >+ if (m_IsExtended) >+ { >+ // SAME_FRAME_EXTENDED type >+ i_jstream >> m_u2OffsetDelta; >+ } >+ else >+ { >+ // SAME frame type. offset_delta is stored in the tag >+ m_u2OffsetDelta = GetFrameType(); >+ } >+} >+ >+void >+CStackMapSameFrameInfo::Write(CJStream& i_jstream) const >+{ >+ CStackMapFrameInfo::Write(i_jstream); >+ if (m_IsExtended) >+ { >+ // SAME_FRAME_EXTENDED type >+ i_jstream << m_u2OffsetDelta; >+ } >+} >+ >+u4 >+CStackMapSameFrameInfo::GetSize() const >+{ >+ u4 u4Size = CStackMapFrameInfo::GetSize(); >+ if (m_IsExtended) >+ { >+ u4Size += sizeof(m_u2OffsetDelta); >+ } >+ return u4Size; >+} >+ >+void >+CStackMapSameFrameInfo::AdjustOffsetDelta(int i_s2PrevFrameOffset) >+{ >+ CStackMapFrameInfo::AdjustOffsetDelta(i_s2PrevFrameOffset); >+ if (m_u2OffsetDelta > 63) >+ { >+ // Frame type is SAME_FRAME_EXTENDED >+ m_u1FrameType = SAME_FRAME_EXTENDED; >+ m_IsExtended = true; >+ } >+ else >+ { >+ // Frame type is SAME_FRAME. offset_delta is stored in the tag >+ m_u1FrameType = (u1)m_u2OffsetDelta; // this is safe since m_u2OffsetDelta <= 63 >+ m_IsExtended = false; >+ } >+} >+ >+CStackMapFrameInfo* >+CStackMapSameFrameInfo::Clone() const >+{ >+ return new CStackMapSameFrameInfo(*this); >+} >+ >+//------------------------------------------------------------------------------ >+CStackMapChopFrameInfo::CStackMapChopFrameInfo(u1 i_u1FrameType) >+: CStackMapFrameInfo(i_u1FrameType) >+{ >+} >+ >+CStackMapChopFrameInfo::~CStackMapChopFrameInfo() >+{ >+} >+ >+void >+CStackMapChopFrameInfo::Read(CJStream& i_jstream) >+{ >+ CStackMapFrameInfo::Read(i_jstream); >+ i_jstream >> m_u2OffsetDelta; >+} >+ >+void >+CStackMapChopFrameInfo::Write(CJStream& i_jstream) const >+{ >+ CStackMapFrameInfo::Write(i_jstream); >+ i_jstream << m_u2OffsetDelta; >+} >+ >+u4 >+CStackMapChopFrameInfo::GetSize() const >+{ >+ u4 u4Size = CStackMapFrameInfo::GetSize() >+ + sizeof(m_u2OffsetDelta); >+ return u4Size; >+} >+ >+CStackMapFrameInfo* >+CStackMapChopFrameInfo::Clone() const >+{ >+ return new CStackMapChopFrameInfo(*this); >+} >+ >+//------------------------------------------------------------------------------ >+CStackMapSameLocals1StackItemFrameInfo::CStackMapSameLocals1StackItemFrameInfo(u1 i_u1FrameType, >+ bool i_IsExtended) >+: CStackMapFrameInfo(i_u1FrameType), m_IsExtended(i_IsExtended) >+{ >+} >+ >+CStackMapSameLocals1StackItemFrameInfo::~CStackMapSameLocals1StackItemFrameInfo() >+{ >+} >+ >+void >+CStackMapSameLocals1StackItemFrameInfo::Read(CJStream& i_jstream) >+{ >+ CStackMapFrameInfo::Read(i_jstream); >+ if (m_IsExtended) >+ { >+ // SAME_LOCALS_1_STACK_ITEM_FRAME_EXTENDED type >+ i_jstream >> m_u2OffsetDelta; >+ } >+ else >+ { >+ // SAME_LOCALS_1_STACK_ITEM_FRAME frame type >+ m_u2OffsetDelta = GetFrameType() - 64; >+ } >+ m_Stack.Read(i_jstream, 1); // must hold exactly one stack item >+} >+ >+void >+CStackMapSameLocals1StackItemFrameInfo::Write(CJStream& i_jstream) const >+{ >+ CStackMapFrameInfo::Write(i_jstream); >+ if (m_IsExtended) >+ { >+ // SAME_FRAME_EXTENDED type >+ i_jstream << m_u2OffsetDelta; >+ } >+ m_Stack.Write(i_jstream); >+} >+ >+u4 >+CStackMapSameLocals1StackItemFrameInfo::GetSize() const >+{ >+ u4 u4Size = CStackMapFrameInfo::GetSize(); >+ if (m_IsExtended) >+ { >+ u4Size += sizeof(m_u2OffsetDelta); >+ } >+ u4Size += m_Stack.GetSize(); >+ return u4Size; >+} >+ >+void >+CStackMapSameLocals1StackItemFrameInfo::AdjustOffsetDelta(int i_s2PrevFrameOffset) >+{ >+ CStackMapFrameInfo::AdjustOffsetDelta(i_s2PrevFrameOffset); >+ if (m_u2OffsetDelta + 64 > 127) >+ { >+ // Frame type is SAME_LOCALS_1_STACK_FRAME_EXTENDED >+ m_u1FrameType = SAME_LOCALS_1_STACK_ITEM_EXTENDED; >+ m_IsExtended = true; >+ } >+ else >+ { >+ // Frame type is SAME_LOCALS_1_STACK_FRAME. offset_delta is stored in the tag >+ m_u1FrameType = (u1)(m_u2OffsetDelta + 64); // this is safe since m_u2OffsetDelta <= 63 >+ m_IsExtended = false; >+ } >+} >+ >+CStackMapFrameInfo* >+CStackMapSameLocals1StackItemFrameInfo::Clone() const >+{ >+ return new CStackMapSameLocals1StackItemFrameInfo(*this); >+} >+ >+CStackMapSameLocals1StackItemFrameInfo::CStackMapSameLocals1StackItemFrameInfo(const CStackMapSameLocals1StackItemFrameInfo &i_Other) >+: CStackMapFrameInfo(i_Other), m_Stack(i_Other.m_Stack), m_IsExtended(i_Other.m_IsExtended) >+{ >+} >+ >+//------------------------------------------------------------------------------ >+CStackMapAppendFrameInfo::CStackMapAppendFrameInfo(u1 i_u1FrameType) >+: CStackMapFrameInfo(i_u1FrameType) >+{ >+} >+ >+CStackMapAppendFrameInfo::~CStackMapAppendFrameInfo() >+{ >+} >+ >+void >+CStackMapAppendFrameInfo::Read(CJStream& i_jstream) >+{ >+ CStackMapFrameInfo::Read(i_jstream); >+ i_jstream >> m_u2OffsetDelta; >+ m_Locals.Read(i_jstream, GetFrameType() - 251); >+} >+ >+void >+CStackMapAppendFrameInfo::Write(CJStream& i_jstream) const >+{ >+ CStackMapFrameInfo::Write(i_jstream); >+ i_jstream << m_u2OffsetDelta; >+ m_Locals.Write(i_jstream); >+} >+ >+u4 >+CStackMapAppendFrameInfo::GetSize() const >+{ >+ u4 u4Size = CStackMapFrameInfo::GetSize() >+ + sizeof(m_u2OffsetDelta) >+ + m_Locals.GetSize(); >+ return u4Size; >+} >+ >+CStackMapFrameInfo* >+CStackMapAppendFrameInfo::Clone() const >+{ >+ return new CStackMapAppendFrameInfo(*this); >+} >+ >+CStackMapAppendFrameInfo::CStackMapAppendFrameInfo(const CStackMapAppendFrameInfo &i_Other) >+: CStackMapFrameInfo(i_Other), m_Locals(i_Other.m_Locals) >+{ >+} >+ >+//------------------------------------------------------------------------------ >+CStackMapFullFrameInfo::CStackMapFullFrameInfo(u1 i_u1FrameType) >+: CStackMapFrameInfo(i_u1FrameType), m_u2NumberOfLocals(0), m_u2NumberOfStackItems(0) >+{ >+} >+ >+CStackMapFullFrameInfo::~CStackMapFullFrameInfo() >+{ >+} >+ >+void >+CStackMapFullFrameInfo::Read(CJStream& i_jstream) >+{ >+ CStackMapFrameInfo::Read(i_jstream); >+ i_jstream >> m_u2OffsetDelta >+ >> m_u2NumberOfLocals; >+ m_Locals.Read(i_jstream, m_u2NumberOfLocals); >+ i_jstream >> m_u2NumberOfStackItems; >+ m_Stack.Read(i_jstream, m_u2NumberOfStackItems); >+} >+ >+void >+CStackMapFullFrameInfo::Write(CJStream& i_jstream) const >+{ >+ CStackMapFrameInfo::Write(i_jstream); >+ i_jstream << m_u2OffsetDelta >+ << m_u2NumberOfLocals; >+ m_Locals.Write(i_jstream); >+ i_jstream << m_u2NumberOfStackItems; >+ m_Stack.Write(i_jstream); >+} >+ >+u4 >+CStackMapFullFrameInfo::GetSize() const >+{ >+ u4 u4Size = CStackMapFrameInfo::GetSize() >+ + sizeof(m_u2OffsetDelta) >+ + sizeof(m_u2NumberOfLocals) >+ + m_Locals.GetSize() >+ + sizeof(m_u2NumberOfStackItems) >+ + m_Stack.GetSize(); >+ return u4Size; >+} >+ >+CStackMapFrameInfo* >+CStackMapFullFrameInfo::Clone() const >+{ >+ return new CStackMapFullFrameInfo(*this); >+} >+ >+CStackMapFullFrameInfo::CStackMapFullFrameInfo(const CStackMapFullFrameInfo &i_Other) >+: CStackMapFrameInfo(i_Other), m_Locals(i_Other.m_Locals), m_Stack(i_Other.m_Stack), >+ m_u2NumberOfLocals(i_Other.m_u2NumberOfLocals), >+ m_u2NumberOfStackItems(i_Other.m_u2NumberOfStackItems) >+{ >+} >+ >+//------------------------------------------------------------------------------ >+CStackMapTable::~CStackMapTable() >+{ >+ for (iterator iter = begin(); iter != end(); iter++) >+ { >+ delete *iter; >+ } >+} >+ >+void >+CStackMapTable::Read(CJStream& i_jstream) >+{ >+ u2 u2Size; >+ CStackMapFrameInfo* pCurrent; >+ int s2PrevFrameOffset = -1; >+ >+ i_jstream >> u2Size; >+ resize(u2Size); >+ for(u2 u2Ind = 0; u2Ind < u2Size; u2Ind++) >+ { >+ u1 u1FrameType; >+ i_jstream >> u1FrameType; >+ if (u1FrameType >= 0 && u1FrameType <= 63) >+ { >+ pCurrent = new CStackMapSameFrameInfo(u1FrameType, false); >+ } >+ else if (u1FrameType >= 64 && u1FrameType <= 127) >+ { >+ pCurrent = new CStackMapSameLocals1StackItemFrameInfo(u1FrameType, false); >+ } >+ else if (u1FrameType == SAME_LOCALS_1_STACK_ITEM_EXTENDED) >+ { >+ pCurrent = new CStackMapSameLocals1StackItemFrameInfo(u1FrameType, true); >+ } >+ else if (u1FrameType >= 248 && u1FrameType <= 250) >+ { >+ pCurrent = new CStackMapChopFrameInfo(u1FrameType); >+ } >+ else if (u1FrameType == SAME_FRAME_EXTENDED) >+ { >+ pCurrent = new CStackMapSameFrameInfo(u1FrameType, true); >+ } >+ else if (u1FrameType >= 252 && u1FrameType <= 254) >+ { >+ pCurrent = new CStackMapAppendFrameInfo(u1FrameType); >+ } >+ else if (u1FrameType == FULL_FRAME) >+ { >+ pCurrent = new CStackMapFullFrameInfo(u1FrameType); >+ } >+ else >+ { >+ // Unknown frame type >+ throw CJClassFileException(CJClassFileException::X_INTERNAL_ERROR); >+ } >+ >+ pCurrent->Read(i_jstream); >+ pCurrent->SetByteCodeOffset(s2PrevFrameOffset + 1 + pCurrent->m_u2OffsetDelta); >+ (*this)[u2Ind] = pCurrent; >+ s2PrevFrameOffset = pCurrent->GetByteCodeOffset(); >+ } >+} >+ >+void >+CStackMapTable::AdjustOffsetDeltas() >+{ >+ // Recalculate offset deltas for all frames. This function must be called before >+ // writing the Stack Map Table to the class file or calculating its size >+ CStackMapFrameInfo* pCurrent; >+ int s2PrevFrameOffset = -1; >+ >+ for (u2 u2Ind = 0; u2Ind < size(); u2Ind++) >+ { >+ pCurrent = (*this)[u2Ind]; >+ pCurrent->AdjustOffsetDelta(s2PrevFrameOffset); >+ s2PrevFrameOffset = pCurrent->GetByteCodeOffset(); >+ } >+} >+ >+CStackMapFrameInfo* >+CStackMapTable::GetFrameAtOffset(u2 i_u2Offset) >+{ >+ bool found = false; >+ iterator it = begin(); >+ for (; it != end(); ++it) >+ { >+ if ((*it)->GetByteCodeOffset() == i_u2Offset) >+ { >+ found = true; >+ break; >+ } >+ } >+ >+ if (found) >+ { >+ return (*it); >+ } >+ else >+ { >+ return NULL; >+ } >+} >+ >+void >+CStackMapTable::Write(CJStream& i_jstream) const >+{ >+ i_jstream << (u2)size(); // the number_of_entries field >+ >+ CStackMapFrameInfo* pCurrent; >+ int s2PrevFrameOffset = -1; >+ >+ for (u2 u2Ind = 0; u2Ind < size(); u2Ind++) >+ { >+ pCurrent = (*this)[u2Ind]; >+ pCurrent->Write(i_jstream); >+ s2PrevFrameOffset = pCurrent->GetByteCodeOffset(); >+ } >+} >+ >+u4 >+CStackMapTable::GetSize() const >+{ >+ u4 u4Size = sizeof(u2); // the number_of_entries field >+ for (const_iterator iter = begin(); iter != end(); iter++) >+ { >+ u4Size += (*iter)->GetSize(); >+ } >+ return u4Size; >+} >+ >+CStackMapTable& >+CStackMapTable::operator = (const CStackMapTable& i_StackMaps) >+{ >+ for(iterator iter = begin(); iter != end(); iter++) >+ { >+ delete *iter; >+ } >+ if(!i_StackMaps.empty()) >+ { >+ const_iterator iterIn; >+ clear(); >+ for(iterIn = i_StackMaps.begin(); iterIn != i_StackMaps.end(); iterIn++) >+ { >+ push_back((*iterIn)->Clone()); >+ } >+ } >+ return *this; >+} >+ >+//------------------------------------------------------------------------------ >+CStackMapTableAttribute::CStackMapTableAttribute(CJClassFile* i_pClassFile) >+: CAttributeInfo(i_pClassFile) >+{ >+ u2 u2NameInd = i_pClassFile->GetConstPool()->Add(new CCPUtf8Info("StackMapTable")); >+ m_u2NameInd = u2NameInd; >+ m_StackMapTable.clear(); >+} >+ >+CStackMapTableAttribute::~CStackMapTableAttribute() >+{ >+} >+ >+void >+CStackMapTableAttribute::Read(CJStream& i_jstream) >+{ >+ CAttributeInfo::Read(i_jstream); >+ m_StackMapTable.Read(i_jstream); >+} >+ >+void >+CStackMapTableAttribute::Write(CJStream& i_jstream) const >+{ >+ const u4 u4Length = GetLength() - CAttributeInfo::SizeOf(); >+ i_jstream << m_u2NameInd >+ << u4Length; >+ m_StackMapTable.Write(i_jstream); >+} >+ >+u4 >+CStackMapTableAttribute::GetSize() const >+{ >+ return GetLength(); >+} >+ >+u4 >+CStackMapTableAttribute::GetLength() const >+{ >+ u4 u4Length = CAttributeInfo::SizeOf() >+ + m_StackMapTable.GetSize(); >+ return u4Length; >+} >+ >+void >+CStackMapTableAttribute::RereadFromBuffer(u1 *i_u1Tbl) >+{ >+ u2 u2skip = 0; >+ u4 u4attributeLenght = 0; >+ >+ if (i_u1Tbl == NULL) return; >+ >+ u2skip = i_u1Tbl[0]; >+ u2skip <<= 8; >+ u2skip |= i_u1Tbl[1]; >+ >+ u4attributeLenght = i_u1Tbl[2]; >+ u4attributeLenght <<= 8; >+ u4attributeLenght |= i_u1Tbl[3]; >+ u4attributeLenght <<= 8; >+ u4attributeLenght |= i_u1Tbl[4]; >+ u4attributeLenght <<= 8; >+ u4attributeLenght |= i_u1Tbl[5]; >+ m_u4Length = u4attributeLenght; >+ CJMemStream memstream; >+ memstream.Open(&i_u1Tbl[2], u4attributeLenght >+ + sizeof(u2) /*part of attribute header (its length)*/ >+ + 2 /*workaround for end buffer checking*/); >+ CJStream mem_jstream(&memstream); >+ //GetStackMapTable().RereadFromBuffer(&i_u1Tbl[6]); >+ this->Read(mem_jstream); >+} >+//============================================================================== > // CJClassFile implementation > // > >@@ -2544,12 +3345,8 @@ CJClassFile::Read(CJStream& i_jstream) > { > throw CJClassFileException(CJClassFileException::X_BAD_MAGIC); > } >- i_jstream >> m_u2MajorVersion; >- if(CJClassFile::MajorVersion < m_u2MajorVersion) >- { >- throw CJClassFileException(CJClassFileException::X_BAD_VERSION); >- } > i_jstream >> m_u2MinorVersion; >+ i_jstream >> m_u2MajorVersion; > m_pConstPool->Read(i_jstream); > i_jstream >> m_u2AccessFlags > >> m_u2ThisClass >@@ -2565,8 +3362,8 @@ void > CJClassFile::Write(CJStream& i_jstream) const > { > i_jstream << m_u4Magic >- << m_u2MajorVersion >- << m_u2MinorVersion; >+ << m_u2MinorVersion >+ << m_u2MajorVersion; > m_pConstPool->Write(i_jstream); > i_jstream << m_u2AccessFlags > << m_u2ThisClass >Index: JClass/JClassFile.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.probekit/src-native/BCI/JClass/JClassFile.h,v >retrieving revision 1.7 >diff -U3 -p -r1.7 JClassFile.h >--- JClass/JClassFile.h 10 Apr 2006 03:57:43 -0000 1.7 >+++ JClass/JClassFile.h 18 Apr 2008 04:51:07 -0000 >@@ -82,6 +82,7 @@ class CExceptionsAttribute; > class CLineNumberTableAttribute; > class CLocalVariableTableAttribute; > class CLocalVariableTypeTableAttribute; >+class CStackMapTableAttribute; > > //------------------------------------------------------------------------------ > // Container classes >@@ -672,6 +673,9 @@ public: > CLineNumberTableAttribute* GetLineNumbers(); > CLocalVariableTableAttribute* GetLocalVariables(); > CLocalVariableTypeTableAttribute* GetLocalVariableTypes(); >+ CStackMapTableAttribute* GetStackMaps(); >+ CStackMapTableAttribute* GetOrCreateStackMaps(); >+ > > protected: > u2 m_u2MaxStack; >@@ -899,6 +903,289 @@ private: > }; > > //------------------------------------------------------------------------------ >+// Verification Type Information (new in Java 6) >+// >+// Represents the following verification types: Top, Integer, Float, Double, Long, Null, >+// UninitializedThis >+// >+class CVerificationTypeInfo >+{ >+public: >+ CVerificationTypeInfo(u1 i_u1Tag); >+ ~CVerificationTypeInfo(); >+ virtual void Read(CJStream& i_jstream); >+ virtual u2 Read(u1* i_tbl); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual CVerificationTypeInfo* Clone() const >+ { >+ return new CVerificationTypeInfo(*this); >+ } >+ >+ u1 GetTag() { return m_u1Tag; } >+ >+private: >+ u1 m_u1Tag; >+}; >+ >+//------------------------------------------------------------------------------ >+// Verification Type Information Vector >+// >+class CVerificationTypes : public vector<CVerificationTypeInfo*> >+{ >+public: >+ CVerificationTypes() { clear(); } >+ CVerificationTypes(const CVerificationTypes &i_VerTypes); >+ ~CVerificationTypes(); >+ >+ CVerificationTypes& operator = (const CVerificationTypes &i_VerTypes); >+ >+ virtual void Read(CJStream& i_jstream, u2 i_u2EntriesToRead); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ >+private: >+}; >+ >+//------------------------------------------------------------------------------ >+// Verification Type Information: Object (new in Java 6) >+// >+class CVerificationTypeObjectInfo : public CVerificationTypeInfo >+{ >+public: >+ CVerificationTypeObjectInfo(u1 i_u1Tag); >+ ~CVerificationTypeObjectInfo(); >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual CVerificationTypeInfo* Clone() const >+ { >+ return new CVerificationTypeObjectInfo(*this); >+ } >+ >+ u2 GetCpoolIndex() { return m_u2CpoolIndex; } >+ void SetCpoolIndex(u2 i_u2CpoolIndex) { m_u2CpoolIndex = i_u2CpoolIndex; } >+ >+private: >+ u2 m_u2CpoolIndex; >+}; >+ >+//------------------------------------------------------------------------------ >+// Verification Type Information: Uninitialized Variable (new in Java 6) >+// >+class CVerificationTypeUninitializedVariableInfo : public CVerificationTypeInfo >+{ >+public: >+ CVerificationTypeUninitializedVariableInfo(u1 i_u1Tag); >+ ~CVerificationTypeUninitializedVariableInfo(); >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual CVerificationTypeInfo* Clone() const >+ { >+ return new CVerificationTypeUninitializedVariableInfo(*this); >+ } >+ >+ u2 GetOffset() { return m_u2Offset; } >+ void SetOffset(u2 i_u2Offset) { m_u2Offset = i_u2Offset; } >+ >+private: >+ u2 m_u2Offset; >+}; >+ >+ >+//------------------------------------------------------------------------------ >+// Stack Map Frame Information (new in Java 6) >+// >+class CStackMapFrameInfo >+{ >+ friend class CStackMapTable; >+public: >+ CStackMapFrameInfo(u1 i_u1FrameType); >+ CStackMapFrameInfo(const CStackMapFrameInfo &i_Other); >+ ~CStackMapFrameInfo(); >+ >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual CStackMapFrameInfo* Clone() const = 0; >+ >+ u1 GetFrameType() const { return m_u1FrameType; } >+ u2 GetByteCodeOffset() { return m_u2ByteCodeOffset; } >+ void SetByteCodeOffset(u2 i_u2Offset); >+ >+protected: >+ virtual void AdjustOffsetDelta(int i_s2PrevFrameOffset); >+ >+ u2 m_u2ByteCodeOffset; >+ u2 m_u2OffsetDelta; >+ u1 m_u1FrameType; >+}; >+ >+//------------------------------------------------------------------------------ >+// Stack Map Frame Information: same_frame and same_frame_extended (new in Java 6) >+// >+class CStackMapSameFrameInfo : public CStackMapFrameInfo >+{ >+ friend class CStackMapTable; >+public: >+ CStackMapSameFrameInfo(u1 i_u1FrameType, bool i_IsExtended); >+ ~CStackMapSameFrameInfo(); >+ >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual CStackMapFrameInfo* Clone() const; >+ >+protected: >+ virtual void AdjustOffsetDelta(int i_s2PrevFrameOffset); >+ >+private: >+ bool m_IsExtended; >+}; >+ >+//------------------------------------------------------------------------------ >+// Stack Map Frame Information: chop_frame (new in Java 6) >+// >+class CStackMapChopFrameInfo : public CStackMapFrameInfo >+{ >+public: >+ CStackMapChopFrameInfo(u1 i_u1FrameType); >+ ~CStackMapChopFrameInfo(); >+ >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual CStackMapFrameInfo* Clone() const; >+ >+private: >+}; >+ >+//------------------------------------------------------------------------------ >+// Stack Map Frame Information: same_locals_1_stack_item_frame and >+// same_locals_1_stack_item_frame_extended (new in Java 6) >+// >+class CStackMapSameLocals1StackItemFrameInfo : public CStackMapFrameInfo >+{ >+ friend class CStackMapTable; >+public: >+ CStackMapSameLocals1StackItemFrameInfo(u1 i_u1FrameType, bool i_IsExtended); >+ CStackMapSameLocals1StackItemFrameInfo(const CStackMapSameLocals1StackItemFrameInfo &i_Other); >+ ~CStackMapSameLocals1StackItemFrameInfo(); >+ >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual CStackMapFrameInfo* Clone() const; >+ >+ CVerificationTypes& GetStack() { return m_Stack; } >+ >+protected: >+ virtual void AdjustOffsetDelta(int i_s2PrevFrameOffset); >+ >+private: >+ CStackMapSameLocals1StackItemFrameInfo& operator = (CStackMapSameLocals1StackItemFrameInfo &i_Other); >+ >+ CVerificationTypes m_Stack; // A vector with 1 entry >+ bool m_IsExtended; >+}; >+ >+//------------------------------------------------------------------------------ >+// Stack Map Frame Information: append_frame (new in Java 6) >+// >+class CStackMapAppendFrameInfo : public CStackMapFrameInfo >+{ >+public: >+ CStackMapAppendFrameInfo(u1 i_u1FrameType); >+ CStackMapAppendFrameInfo(const CStackMapAppendFrameInfo &i_Other); >+ ~CStackMapAppendFrameInfo(); >+ >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual CStackMapFrameInfo* Clone() const; >+ >+ CVerificationTypes& GetLocals() { return m_Locals; } >+ >+private: >+ CStackMapAppendFrameInfo& operator = (const CStackMapAppendFrameInfo &i_Other); >+ >+ CVerificationTypes m_Locals; >+}; >+ >+//------------------------------------------------------------------------------ >+// Stack Map Frame Information: full_frame (new in Java 6) >+// >+class CStackMapFullFrameInfo : public CStackMapFrameInfo >+{ >+public: >+ CStackMapFullFrameInfo(u1 i_u1FrameType); >+ CStackMapFullFrameInfo(const CStackMapFullFrameInfo &i_Other); >+ ~CStackMapFullFrameInfo(); >+ >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual CStackMapFrameInfo* Clone() const; >+ >+ CVerificationTypes& GetLocals() { return m_Locals; } >+ CVerificationTypes& GetStack() { return m_Stack; } >+ >+private: >+ CStackMapFullFrameInfo& operator = (const CStackMapFullFrameInfo &i_Other); >+ >+ u2 m_u2NumberOfLocals; >+ CVerificationTypes m_Locals; >+ u2 m_u2NumberOfStackItems; >+ CVerificationTypes m_Stack; >+}; >+ >+ >+//------------------------------------------------------------------------------ >+// Stack Map Table (new in Java 6) >+// >+class CStackMapTable : public vector<CStackMapFrameInfo*> >+{ >+public: >+ CStackMapTable() { clear(); } >+ ~CStackMapTable(); >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ >+ void AdjustOffsetDeltas(); >+ CStackMapFrameInfo* GetFrameAtOffset(u2 i_u2Offset); >+ >+ CStackMapTable& operator = (const CStackMapTable& i_StackMaps); >+}; >+ >+//------------------------------------------------------------------------------ >+// Stack Map Table Attribute (new in Java 6 - [4.8.4]) >+// >+class CStackMapTableAttribute : public CAttributeInfo >+{ >+ friend class CStackMapTable; >+public: >+ CStackMapTableAttribute(CJClassFile* i_pClassFile); >+ ~CStackMapTableAttribute(); >+ virtual void Read(CJStream& i_jstream); >+ virtual void Write(CJStream& i_jstream) const; >+ virtual u4 GetSize() const; >+ virtual u4 GetLength() const; >+ >+ CStackMapTable& GetStackMapTable() { return m_StackMapTable; } >+ void SetStackMapTable(const CStackMapTable& i_stackmap) {m_StackMapTable = i_stackmap;} >+ void RereadFromBuffer(u1 *i_u1Tbl); >+ >+private: >+ CStackMapTable m_StackMapTable; >+ >+ // Disable assignment operator. >+ // To enable, implement these functions as public >+ CStackMapTableAttribute& operator = (const CStackMapTableAttribute& i_other) {} >+}; >+ >+//------------------------------------------------------------------------------ > // Interface information > // > class CInterfaceInfo >@@ -999,6 +1286,7 @@ public: > virtual u4 GetSize() const; > > u2 GetAccessFlags() {return m_u2AccessFlags;} >+ void SetAccessFlags(u2 i_u2AccessFlags) {m_u2AccessFlags = i_u2AccessFlags;} > u2 GetNameInd() const {return m_u2NameInd;} > u2 GetDescriptorInd() const {return m_u2DescriptorInd;} > CJAttribs& GetAttribs() {return m_Attribs;} >@@ -1070,7 +1358,7 @@ public: > class CJClassFile > { > public: >- enum {MajorVersion = 3, MinorVersion = 46}; // TODO: comment on version >+ enum {MajorVersion = 46, MinorVersion = 3}; // J2SE 1.2 > CJClassFile(); > virtual ~CJClassFile(); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 148629
:
88758
|
96544
|
96545
|
96546
|
96547
|
96548
|
96761
|
96986
|
97124
|
97125
|
97938
|
98002
|
98071
|
98143
|
98144
|
98393
|
98824
|
98844
|
98845
|
98935
|
99809
|
103085