2#ifndef ROSE_SgAsmJvmConstantPoolEntry_H
3#define ROSE_SgAsmJvmConstantPoolEntry_H
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmJvmNode.h>
30#if !defined(DOCUMENTATION)
45#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
47 friend class boost::serialization::access;
53 s & BOOST_SERIALIZATION_NVP(p_tag);
54 s & BOOST_SERIALIZATION_NVP(p_bytes);
55 s & BOOST_SERIALIZATION_NVP(p_hi_bytes);
56 s & BOOST_SERIALIZATION_NVP(p_low_bytes);
57 s & BOOST_SERIALIZATION_NVP(p_bootstrap_method_attr_index);
58 s & BOOST_SERIALIZATION_NVP(p_class_index);
59 s & BOOST_SERIALIZATION_NVP(p_descriptor_index);
60 s & BOOST_SERIALIZATION_NVP(p_name_index);
61 s & BOOST_SERIALIZATION_NVP(p_name_and_type_index);
62 s & BOOST_SERIALIZATION_NVP(p_reference_index);
63 s & BOOST_SERIALIZATION_NVP(p_reference_kind);
64 s & BOOST_SERIALIZATION_NVP(p_string_index);
65 s & BOOST_SERIALIZATION_NVP(p_length);
86 CONSTANT_Fieldref = 9,
87 CONSTANT_Methodref = 10,
88 CONSTANT_InterfaceMethodref = 11,
89 CONSTANT_NameAndType = 12,
90 CONSTANT_MethodHandle = 15,
91 CONSTANT_MethodType = 16,
92 CONSTANT_Dynamic = 17,
93 CONSTANT_InvokeDynamic = 18,
104 struct CONSTANT_Class_info {
111 struct CONSTANT_Fieldref_info {
113 uint16_t class_index;
114 uint16_t name_and_type_index;
116 struct CONSTANT_Methodref_info {
118 uint16_t class_index;
119 uint16_t name_and_type_index;
121 struct CONSTANT_InterfaceMethodref_info {
123 uint16_t class_index;
124 uint16_t name_and_type_index;
128 struct CONSTANT_String_info {
130 uint16_t string_index;
134 struct CONSTANT_Integer_info {
138 struct CONSTANT_Float_info {
142 struct CONSTANT_Long_info {
147 struct CONSTANT_Double_info {
154 struct CONSTANT_NameAndType_info {
157 uint16_t descriptor_index;
161 struct CONSTANT_Utf8_info {
168 struct CONSTANT_MethodHandle_info {
170 uint8_t reference_kind;
171 uint16_t reference_index;
175 struct CONSTANT_MethodType_info {
177 uint16_t descriptor_index;
181 struct CONSTANT_Dynamic_info {
183 uint16_t bootstrap_method_attr_index;
184 uint16_t name_and_type_index;
186 struct CONSTANT_InvokeDynamic_info {
188 uint16_t bootstrap_method_attr_index;
189 uint16_t name_and_type_index;
193 struct CONSTANT_Module_info {
199 struct CONSTANT_Package_info {
225 uint32_t
const& get_bytes()
const;
226 void set_bytes(uint32_t
const&);
237 uint32_t
const& get_hi_bytes()
const;
238 void set_hi_bytes(uint32_t
const&);
249 uint32_t
const& get_low_bytes()
const;
250 void set_low_bytes(uint32_t
const&);
260 uint16_t
const& get_bootstrap_method_attr_index()
const;
261 void set_bootstrap_method_attr_index(uint16_t
const&);
271 uint16_t
const& get_class_index()
const;
272 void set_class_index(uint16_t
const&);
282 uint16_t
const& get_descriptor_index()
const;
283 void set_descriptor_index(uint16_t
const&);
293 uint16_t
const& get_name_index()
const;
294 void set_name_index(uint16_t
const&);
305 uint16_t
const& get_name_and_type_index()
const;
306 void set_name_and_type_index(uint16_t
const&);
316 uint16_t
const& get_reference_index()
const;
317 void set_reference_index(uint16_t
const&);
327 uint8_t
const& get_reference_kind()
const;
328 void set_reference_kind(uint8_t
const&);
338 uint16_t
const& get_string_index()
const;
339 void set_string_index(uint16_t
const&);
349 uint16_t
const& get_length()
const;
350 void set_length(uint16_t
const&);
363 char*
const& get_utf8_bytes()
const;
364 void set_utf8_bytes(
char*
const&);
380 virtual void unparse(std::ostream&)
const override;
383 void dump(FILE*,
const char *prefix, ssize_t idx)
const override;
421 virtual std::string
class_name()
const override;
424 virtual VariantT
variantT()
const override;
429 enum { static_variant = V_SgAsmJvmConstantPoolEntry };
444 static const unsigned pool_size;
446 static std::vector<unsigned char *> pools;
451 static unsigned long initializeStorageClassArray(SgAsmJvmConstantPoolEntryStorageClass *);
454 static void clearMemoryPool();
455 static void deleteMemoryPool();
458 static void extendMemoryPoolForFileIO();
466 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(
unsigned long);
468 static void resetValidFreepointers();
470 static unsigned long getNumberOfLastValidPointer();
473#if defined(INLINE_FUNCTIONS)
475 inline void *
operator new (
size_t size);
478 void *
operator new (
size_t size);
481 void operator delete (
void* pointer,
size_t size);
484 void operator delete (
void* pointer)
530#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
533 virtual RTIReturnType
roseRTI()
override;
547 virtual const char*
sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
553 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
735 friend class SgAsmJvmConstantPoolEntryStorageClass;
738 friend class AstSpecificDataManagingClass;
741 friend class AstSpecificDataManagingClassStorageClass;
773#define BUILD_ATERM_SUPPORT 0
774 #if BUILD_ATERM_SUPPORT
775 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
787 virtual ATerm generate_ATerm()
override;
790 virtual void generate_ATerm_Annotation(ATerm & term)
override;
845uint16_t p_bootstrap_method_attr_index;
849uint16_t p_class_index;
853uint16_t p_descriptor_index;
857uint16_t p_name_index;
861uint16_t p_name_and_type_index;
865uint16_t p_reference_index;
869uint8_t p_reference_kind;
873uint16_t p_string_index;
Class holding static data and functions supporting File I/O.
Attribute containing a regex expression as a string.
Represents an entry in a JVM constant pool.
Represents an JVM constant pool.
Base class for JVM branch of binary analysis IR nodes.
virtual void unparse(std::ostream &) const
Write node to a binary file.
void initializeProperties()
Initialize all properties that have explicit initial values.
virtual void dump(FILE *, const char *prefix, ssize_t idx) const
Print some debugging information.
Supporting class from copy mechanism within ROSE.
This class represents the base class for all IR nodes within Sage III.
virtual size_t get_numberOfTraversalSuccessors()
return number of children in the traversal successor list
virtual RTIReturnType roseRTI()
return C++ Runtime-Time-Information
virtual std::vector< std::string > get_traversalSuccessorNamesContainer()
container of names of variables or container indices used used in the traversal to access AST success...
virtual void debugSerializationEnd(const char *className)
Called by generated serializers.
static std::string getNodeIdString(SgNode *sgnode)
compute the NodeId for a particular SgNode*.
virtual bool isInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
int variant() const
Older version function returns enum value "NODE".
virtual void processDataMemberReferenceToPointers(ReferenceToPointerHandler *)
FOR INTERNAL USE Processes pairs of references to SgNode* and strings for use in AST tools
virtual VariantT variantT() const
returns new style SageIII enum values
virtual long getChildIndex(SgNode *childNode) const
FOR INTERNAL USE Returns a unique index value for the childNode in the list of children at this IR no...
virtual size_t get_childIndex(SgNode *child)
index-based access to traversal successors by child node
virtual void debugSerializationBegin(const char *className)
Called by generated serializers.
virtual std::vector< SgNode * > get_traversalSuccessorContainer()
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
virtual std::string class_name() const
returns a string representing the class name
static void visitRepresentativeNode(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for type-based traversal.
virtual void checkDataMemberPointersIfInMemoryPool()
FOR INTERNAL USE This is used in internal tests to verify that all IR nodes are allocated from the he...
static size_t numberOfNodes()
Returns the total number of IR nodes of this type.
virtual void accept(ROSE_VisitorPattern &visitor)
support for the classic visitor pattern done in GoF
virtual SgNode * get_traversalSuccessorByIndex(size_t idx)
index-based access to traversal successors by index number
static void traverseMemoryPoolVisitorPattern(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
void executeVisitorMemberFunction(ROSE_VisitorPattern &visitor)
FOR INTERNAL USE Support for visitor pattern.
static SgNode * getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx)
Find a node by its variant type, pool index, and item index.
static size_t memoryUsage()
Returns the size in bytes of the total memory allocated for all IR nodes of this type.
static void traverseMemoryPoolNodes(ROSE_VisitTraversal &visit)
FOR INTERNAL USE Support for visitor pattern over all IR nodes by type of IR node.
virtual const char * sage_class_name() const
generates string representing the class name: (e.g. for SgNode returns "SgNode").
virtual std::vector< std::pair< SgNode *, std::string > > returnDataMemberPointers() const
FOR INTERNAL USE Returns STL vector of pairs of SgNode* and strings for use in AST tools
static SgNode * getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx)
FOR INTERNAL USE Find an SgNode from its memory pool and location therin.
SgNode * addRegExpAttribute(std::string s, AstRegExAttribute *a)
Support for AST matching using regular expression.
Kind
List of the supported kind of defects. Kind::any.
void parse(SgAsmGenericFile *)
Main function to parse DWARF information.
void serialize(std::ostream &output, Graph &graph)
Serialize a graph into a stream of bytes.
void copy(const Word *src, const BitRange &srcRange, Word *dst, const BitRange &dstRange)
Copy some bits.