ROSE 0.11.145.147
SgAsmJvmStackMapFrame.h
1
2#ifndef ROSE_SgAsmJvmStackMapFrame_H
3#define ROSE_SgAsmJvmStackMapFrame_H
4#include <RoseFirst.h>
5#include <Cxx_GrammarDeclarations.h>
6#include <SgAsmJvmNode.h>
7
8
9
10/* #line 1 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
11
12// WARNING -- GENERATED CODE -- DO NOT MODIFY THIS CODE -- WARNING!
13// This code is automatically generated for each
14// terminal and non-terminal within the defined
15// grammar. There is a simple way to change the
16// code to fix bugs etc. See the ROSE README file
17// for directions.
18
19// tps: (02/22/2010): Adding DLL export requirements
20#include "rosedll.h"
21
22// predeclarations for SgAsmJvmStackMapFrame
23
24/* #line 25 "../../../src/frontend/SageIII//SgAsmJvmStackMapFrame.h" */
25/* #line 9542 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
26
27#include <sageContainer.h>
28
29
30/* #line 13 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $PREDECLARATIONS" */
31
32/* #line 14 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
33
34#if !defined(DOCUMENTATION)
35// Class Definition for SgAsmJvmStackMapFrame
36class ROSE_DLL_API SgAsmJvmStackMapFrame : public SgAsmJvmNode
37 {
38 public:
39
40
41/* #line 42 "../../../src/frontend/SageIII//SgAsmJvmStackMapFrame.h" */
42
43 virtual SgNode* copy ( SgCopyHelp& help) const override;
44// Start of memberFunctionString
45/* #line 9578 "/workspace/src/ROSETTA/src/binaryInstruction.C" */
46
47
48 //----------------------- Boost serialization for SgAsmJvmStackMapFrame -----------------------
49#ifdef ROSE_HAVE_BOOST_SERIALIZATION_LIB
50private:
51 friend class boost::serialization::access;
52
53 template<class S>
54 void serialize(S &s, const unsigned /*version*/) {
55 debugSerializationBegin("SgAsmJvmStackMapFrame");
56 s & BOOST_SERIALIZATION_BASE_OBJECT_NVP(SgAsmJvmNode);
57 s & BOOST_SERIALIZATION_NVP(p_stack);
58 s & BOOST_SERIALIZATION_NVP(p_locals);
59 s & BOOST_SERIALIZATION_NVP(p_frame_type);
60 s & BOOST_SERIALIZATION_NVP(p_offset_delta);
61 debugSerializationEnd("SgAsmJvmStackMapFrame");
62 }
63#endif // ROSE_HAVE_BOOST_SERIALIZATION_LIB
64private:
65public:
66public:
70 SgAsmJvmStackMapVerificationTypePtrList const& get_stack() const;
71 SgAsmJvmStackMapVerificationTypePtrList& get_stack();
72 void set_stack(SgAsmJvmStackMapVerificationTypePtrList const&);
75public:
79 SgAsmJvmStackMapVerificationTypePtrList const& get_locals() const;
80 SgAsmJvmStackMapVerificationTypePtrList& get_locals();
81 void set_locals(SgAsmJvmStackMapVerificationTypePtrList const&);
84 // Local types (for documentation purposes only)
86#ifdef DOCUMENTATION
90 union stack_map_frame {
91 same_frame;
92 same_locals_1_stack_item_frame;
93 same_locals_1_stack_item_frame_extended;
94 chop_frame;
95 same_frame_extended;
96 append_frame;
97 full_frame;
98 };
99
100 struct same_frame {
101 uint8_t frame_type; /* 0-63 */
102 };
103 struct same_locals_1_stack_item_frame {
104 uint8_t frame_type; /* 64-127 */
105 verification_type_info stack;
106 };
107 struct same_locals_1_stack_item_extended {
108 uint8_t frame_type; /* 247 */
109 uint16_t offset_delta;
110 verification_type_info stack;
111 };
112 struct chop_frame {
113 uint8_t frame_type; /* 248-250 */
114 uint16_t offset_delta;
115 };
116 struct same_frame_extended {
117 uint8_t frame_type; /* 251 */
118 uint16_t offset_delta;
119 };
120 struct append_frame {
121 uint8_t frame_type; /* 252-254 */
122 uint16_t offset_delta;
123 verification_type_info stack;
124 };
125 struct full_frame {
126 uint8_t frame_type; /* 252-254 */
127 uint16_t offset_delta;
128 uint16_t number_of_locals;
129 verification_type_info stack[number_of_locals];
130 uint16_t number_of_stack_items;
131 verification_type_info stack[number_of_stack_items];
132 };
133#endif
134
136 // Properties
138private:
139public:
145 uint8_t const& get_frame_type() const;
146 void set_frame_type(uint8_t const&);
149public:
155 uint16_t const& get_offset_delta() const;
156 void set_offset_delta(uint16_t const&);
159 // Functions
161public:
166
169
171 virtual void unparse(std::ostream&) const override;
172
174 void dump(FILE*, const char *prefix, ssize_t idx) const override;
175public:
177 virtual ~SgAsmJvmStackMapFrame();
178
179public:
182
183protected:
191
192
193// End of memberFunctionString
194// Start of memberFunctionString
195/* #line 1 "/workspace/src/ROSETTA/Grammar/Common.code" */
196
197// *** COMMON CODE SECTION BEGINS HERE ***
198
199 public:
200
201 // DQ (3/25/3006): I put this back in because it had the logic for where the copy function required
202 // and not required which is required to match the other aspects of the copy mechanism code generation.
203 // Specifically it is a problem to declare the copy function everywhere because it is not implemented
204 // for the SgSymbol IR nodes. I'm not clear why it is not implemented for these IR nodes.
205 /* \brief Copies AST (whole subtree, depending on the SgCopyHelp class */
206 // virtual SgNode* copy ( const SgCopyHelp & help) const;
207
209 virtual std::string class_name() const override;
210
212 virtual VariantT variantT() const override; // MS: new variant used in tree traversal
213
215 // King84 (2010.08.16): Moved this to an enum to save space, since it's only used at compiler-time anyway.
216 // static const VariantT static_variant = V_SgAsmJvmStackMapFrame;
217 enum { static_variant = V_SgAsmJvmStackMapFrame };
218
219 /* the generated cast function */
221 ROSE_DLL_API friend SgAsmJvmStackMapFrame* isSgAsmJvmStackMapFrame( SgNode * s );
222
224 ROSE_DLL_API friend const SgAsmJvmStackMapFrame* isSgAsmJvmStackMapFrame( const SgNode * s );
225
226 // ******************************************
227 // * Memory Pool / New / Delete
228 // ******************************************
229
230 public:
232 static const unsigned pool_size; //
234 static std::vector<unsigned char *> pools; //
236 static SgAsmJvmStackMapFrame * next_node; //
237
239 static unsigned long initializeStorageClassArray(SgAsmJvmStackMapFrameStorageClass *); //
240
242 static void clearMemoryPool(); //
243 static void deleteMemoryPool(); //
244
246 static void extendMemoryPoolForFileIO(); //
247
249 static SgAsmJvmStackMapFrame * getPointerFromGlobalIndex(unsigned long); //
251 static SgAsmJvmStackMapFrame * getPointerFromGlobalIndex(AstSpecificDataManagingClass *, unsigned long); //
252
254 static unsigned long getNumberOfValidNodesAndSetGlobalIndexInFreepointer(unsigned long); //
256 static void resetValidFreepointers(); //
258 static unsigned long getNumberOfLastValidPointer(); //
259
260
261#if defined(INLINE_FUNCTIONS)
263 inline void *operator new (size_t size);
264#else
266 void *operator new (size_t size);
267#endif
269 void operator delete (void* pointer, size_t size);
270
271 // DQ (4/5/2007): This is not the correct operator that we want, but appears to be required to compile ROSE with ROSE.
272 void operator delete (void* pointer)
273 {
274 // This is the generated delete operator...
275 SgAsmJvmStackMapFrame::operator delete (pointer,sizeof(SgAsmJvmStackMapFrame));
276 }
277
279 static size_t numberOfNodes();
280
282 static size_t memoryUsage();
283
284 // End of scope which started in IR nodes specific code
285 /* */
286
287 /* name Internal Functions
288 \brief Internal functions ... incomplete-documentation
289
290 These functions have been made public as part of the design, but they are suggested for internal use
291 or by particularly knowledgeable users for specialized tools or applications.
292
293 \internal We could not make these private because they are required by user for special purposes. And
294 it would be unwieldy to have many of the internal classes in ROSE be explicitly defined as friends.
295
296 */
297
298 // MS: 02/12/02 container of pointers to AST successor nodes used in the traversal
299 // overridden in every class by *generated* implementation
301 virtual std::vector<SgNode*> get_traversalSuccessorContainer() override;
302 // MS: 06/28/02 container of names of variables or container indices
303 // used used in the traversal to access AST successor nodes
304 // overridden in every class by *generated* implementation
307 virtual std::vector<std::string> get_traversalSuccessorNamesContainer() override;
308
309 // GB (09/25/2007): Functions for index-based access to traversal successors; these are hopefully a lot faster
310 // than all the vector copies. The implementation for these functions is generated for each class.
312 virtual size_t get_numberOfTraversalSuccessors() override;
314 virtual SgNode *get_traversalSuccessorByIndex(size_t idx) override;
316 virtual size_t get_childIndex(SgNode *child) override;
317
318#ifndef ROSE_USE_INTERNAL_FRONTEND_DEVELOPMENT
319 // MS: 08/16/2002 method for generating RTI information
321 virtual RTIReturnType roseRTI() override;
322#endif
323 /* */
324
325
326
327 /* name Deprecated Functions
328 \brief Deprecated functions ... incomplete-documentation
329
330 These functions have been deprecated from use.
331 */
332 /* */
333
335 virtual const char* sage_class_name() const override ROSE_DEPRECATED_FUNCTION;
336
337 // JJW (10/16/2008): Changed to a single function in Node.code, and put
338 // getVariant() in #if 0 block to prevent confusing Doxygen
339#if 0
341 virtual int variant() const ROSE_DEPRECATED_FUNCTION;
343 // virtual int getVariant() const ROSE_DEPRECATED_FUNCTION;
344#endif
345 /* */
346
347
348
349
350 public:
351 /* name Traversal Support Functions
352 \brief Traversal support functions ... incomplete-documentation
353
354 These functions have been made public as part of the design, but they are suggested for internal use
355 or by particularly knowledgable users for specialized tools or applications.
356 */
357 /* */
358
359 // DQ (11/26/2005): Support for visitor pattern mechanims
360 // (inferior to ROSE traversal mechanism, experimental).
364
365 /* DXN (08/09/2010): support for the classic visitor pattern done in GoF */
367 virtual void accept (ROSE_VisitorPattern & visitor) override;
368
369 // DQ (12/26/2005): Support for traversal based on the memory pool
372 static void traverseMemoryPoolNodes(ROSE_VisitTraversal & visit);
373
377
378 // DQ (2/9/2006): Added to support traversal over single representative of each IR node
379 // This traversal helps support internal tools that call static member functions.
380 // note: this function operates on the memory pools.
383 static void visitRepresentativeNode (ROSE_VisitTraversal & visit);
384 /* */
385
386 public:
387 /* NodeId support functions */
389 static SgNode* getNodeByNodeId(VariantT variantT, size_t poolIdx, size_t itemIdx);
392 static SgAsmJvmStackMapFrame* getNodeByNodeIdInternal(size_t poolIdx, size_t itemIdx);
395 static std::string getNodeIdString(SgAsmJvmStackMapFrame* sgnode);
396 static std::string getNodeIdStringInternal(SgAsmJvmStackMapFrame* sgnode);
397
398 public:
399 /* name Memory Allocation Functions
400 \brief Memory allocations functions ... incomplete-documentation
401
402 These functions have been made public as part of the design, but they are suggested for internal use
403 or by particularly knowledgable users for specialized tools or applications.
404 */
405 /* */
406
417 virtual bool isInMemoryPool() override;
418
429 virtual void checkDataMemberPointersIfInMemoryPool() override;
430
431 // DQ (4/30/2006): Modified to be a const function.
446 virtual std::vector<std::pair<SgNode*,std::string> > returnDataMemberPointers() const override;
447
458
470 virtual long getChildIndex( SgNode* childNode ) const override;
471
472 // DQ (9/2/2015): Since this function is generated by ROSETTA, we can't define the
473 // comment here (changed to be a C style comment and not be a doxygen comment).
474 /* \brief Constructor for use by AST File I/O Mechanism
475
476 This constructor permits the IR node to be rebuilt from the contiguously arranged data in memory
477 which obtained via fast binary file I/O from disk.
478 */
479 // SgAsmJvmStackMapFrame( SgAsmJvmStackMapFrameStorageClass& source );
480
481
482
483
484
485 // JH (10/24/2005): methods added to support the ast file IO
486 private:
487
488 /* name AST Memory Allocation Support Functions
489 \brief Memory allocations support....
490
491 These functions handle the low leve support of the memory allocation scheme which permits IR nodes to be allocated
492 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
493 and support the AST File I/O Mechanism.
494 */
495 /* */
496
497 /* JH (10/24/2005): Two typedefs. The TestType notes the type every pointer is cast to before
498 we compare them. Since I had several problems with this, I decided to make a typdef to ensure
499 that I use the same type everywhere, if any changes are made. THe second one declares the type
500 (actually unsigned long) where teh pointer address gets converted to. On 64 bit platforms this
501 might got changed, but unfortunatly, the return types are still unsigned longs. There exists
502 a correspinding one in the AST_FILE_IO class!
503 */
504 // DQ (9/2/2015): This typedef is no longer used, we can't define the
505 // comment here (changed to be a C style comment and not be a doxygen comment).
506 /* \brief Typedef used for low level memory access.
507 */
508 // typedef unsigned char* TestType;
509
510 // DQ (9/2/2015): This typedef is no longer used, we can't define the
511 // comment here (changed to be a C style comment and not be a doxygen comment).
512 /* \brief Typedef used to hold memory addresses as values.
513 */
514 // typedef unsigned long AddressType;
515
516
517
518 // necessary, to have direct access to the p_freepointer and the private methods !
520 friend class AST_FILE_IO;
521
523 friend class SgAsmJvmStackMapFrameStorageClass;
524
526 friend class AstSpecificDataManagingClass;
527
529 friend class AstSpecificDataManagingClassStorageClass;
530 public:
532 SgAsmJvmStackMapFrame( const SgAsmJvmStackMapFrameStorageClass& source );
533
534 // private: // JJW hack
535 /*
536 name AST Memory Allocation Support Variables
537 Memory allocations support variables
538
539 These variables handle the low level support of the memory allocation scheme which permits IR nodes to be allocated
540 in large contiguous blocks to reduce memory fragmentation, improve performance, support specialized access (AST traversals),
541 and support the AST File I/O Mechanism.
542 */
543 /* */
544
545 public:
546
547 // DQ (11/21/2009): Added function to add new Regular Expression attributes and return pointer
548 // to current node (so that it will work cleanly with build functions to specify patterns).
549 // virtual SgNode* addRegExpAttribute();
556
557#ifndef _MSC_VER
558// Rasmussen (04/17/2019): Support for ATerms has been deprecated as it is no longer needed
559// and likely never fully implemented nor tested. Files remain in the src tree but are no
560// longer built.
561#define BUILD_ATERM_SUPPORT 0
562 #if BUILD_ATERM_SUPPORT
563 #ifdef ROSE_USE_ROSE_ATERM_SUPPORT
564 // DQ (10/4/2014): Adding ATerm support to ROSE.
574 // Rasmussen (1/7/2019): Added override to kill warning messages of overridden virtual function
575 virtual ATerm generate_ATerm() override;
576
578 virtual void generate_ATerm_Annotation(ATerm & term) override;
579 #endif
580 #endif // BUILD_ATERM_SUPPORT
581#endif
582 // These can't be virtual functions since we don't yet know what IR node to build (until we have read the aterm).
583 // virtual generate_AST(ATerm & term);
584 // virtual void read_ATerm_Annotation(ATerm & term);
585
586// *** COMMON CODE SECTION ENDS HERE ***
587
588
589// End of memberFunctionString
590// Start of memberFunctionString
591/* #line 706 "/workspace/src/ROSETTA/Grammar/Node.code" */
592
593 // the generated cast function
594 // friend ROSE_DLL_API SgAsmJvmStackMapFrame* isSgAsmJvmStackMapFrame ( SgNode* s );
595
596 typedef SgAsmJvmNode base_node_type;
597
598
599// End of memberFunctionString
600
601
602
603
604
605 protected:
606// Start of memberFunctionString
607SgAsmJvmStackMapVerificationTypePtrList p_stack;
608
609// End of memberFunctionString
610// Start of memberFunctionString
611SgAsmJvmStackMapVerificationTypePtrList p_locals;
612
613// End of memberFunctionString
614// Start of memberFunctionString
615uint8_t p_frame_type;
616
617// End of memberFunctionString
618// Start of memberFunctionString
619uint16_t p_offset_delta;
620
621// End of memberFunctionString
622
624 friend struct Rose::Traits::generated::describe_field_t<SgAsmJvmStackMapFrame, SgAsmJvmStackMapVerificationTypePtrList,&SgAsmJvmStackMapFrame::p_stack>;
625 friend struct Rose::Traits::generated::describe_field_t<SgAsmJvmStackMapFrame, SgAsmJvmStackMapVerificationTypePtrList,&SgAsmJvmStackMapFrame::p_locals>;
626 friend struct Rose::Traits::generated::describe_field_t<SgAsmJvmStackMapFrame, uint8_t,&SgAsmJvmStackMapFrame::p_frame_type>;
627 friend struct Rose::Traits::generated::describe_field_t<SgAsmJvmStackMapFrame, uint16_t,&SgAsmJvmStackMapFrame::p_offset_delta>;
628
629/* #line 21 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
630
631
632 };
633#endif
634
635// postdeclarations for SgAsmJvmStackMapFrame
636
637/* #line 638 "../../../src/frontend/SageIII//SgAsmJvmStackMapFrame.h" */
638
639/* #line 27 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro after subst for $POSTDECLARATIONS" */
640
641/* #line 28 "/workspace/src/ROSETTA/Grammar/grammarClassDeclarationMacros.macro" */
642
643
644/* #line 645 "../../../src/frontend/SageIII//SgAsmJvmStackMapFrame.h" */
645
646#endif // ROSE_SgAsmJvmStackMapFrame_H
647
Class holding static data and functions supporting File I/O.
Definition AST_FILE_IO.h:19
Attribute containing a regex expression as a string.
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.
Represents a frame in a stack map table.
The StackMapTable attribute is a variable-length attribute in the attributes table of a Code attribut...
Supporting class from copy mechanism within ROSE.
Definition sageCopy.h:26
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.
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.