JVM
constantpool.h File Reference
#include <stdint.h>
#include "javaclass.h"
Include dependency graph for constantpool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cp_info
 

Typedefs

typedef struct cp_info cp_info
 

Enumerations

enum  ConstantPoolTag {
  CONSTANT_Class = 7, CONSTANT_Fieldref = 9, CONSTANT_Methodref = 10, CONSTANT_InterfaceMethodref = 11,
  CONSTANT_String = 8, CONSTANT_Integer = 3, CONSTANT_Float = 4, CONSTANT_Long = 5,
  CONSTANT_Double = 6, CONSTANT_NameAndType = 12, CONSTANT_Utf8 = 1, CONSTANT_MethodHandle = 15,
  CONSTANT_MethodType = 16, CONSTANT_InvokeDynamic = 18
}
 

Functions

const char * decodeTag (uint8_t tag)
 Decodes ConstantPoolTag enumeration elements. More...
 
char readConstantPoolEntry (JavaClass *jc, cp_info *entry)
 Reads a cp_info from the file. More...
 
void printConstantPool (JavaClass *jc)
 Function to print all the constants from the constant pool of the class file. More...
 

Typedef Documentation

§ cp_info

typedef struct cp_info cp_info

Enumeration Type Documentation

§ ConstantPoolTag

Enumerator
CONSTANT_Class 
CONSTANT_Fieldref 
CONSTANT_Methodref 
CONSTANT_InterfaceMethodref 
CONSTANT_String 
CONSTANT_Integer 
CONSTANT_Float 
CONSTANT_Long 
CONSTANT_Double 
CONSTANT_NameAndType 
CONSTANT_Utf8 
CONSTANT_MethodHandle 
CONSTANT_MethodType 
CONSTANT_InvokeDynamic 

Function Documentation

§ decodeTag()

const char* decodeTag ( uint8_t  tag)

Decodes ConstantPoolTag enumeration elements.

Parameters
uint8_ttag - identifier of the enumeration to be translated.
Returns
const char* - pointer to char containing the decoded tag
Here is the caller graph for this function:

§ printConstantPool()

void printConstantPool ( JavaClass jc)

Function to print all the constants from the constant pool of the class file.

Parameters
JavaClass*jc - pointer to JavaClass structure that must already be loaded
Here is the call graph for this function:
Here is the caller graph for this function:

§ readConstantPoolEntry()

char readConstantPoolEntry ( JavaClass jc,
cp_info entry 
)

Reads a cp_info from the file.

This function identifies the structure indicated by the tag byte and selects the corresponding reading type

Parameters
JavaClass*jc - pointer to the structure to be read.
cp_info*entry - where the data read is written
Returns
char - retuns 0 if something unexpected happened or failure, 1 in case of success
Here is the call graph for this function:
Here is the caller graph for this function: