CACAO
Data Structures | Macros | Typedefs | Functions | Variables
patcher-common.hpp File Reference

Go to the source code of this file.

Data Structures

struct  patchref_t
 
struct  patcher_function_list_t
 patcher_function_list More...
 

Macros

#define PATCHER_resolve_class   (functionptr) patcher_resolve_class
 
#define PATCHER_initialize_class   (functionptr) patcher_initialize_class
 
#define PATCHER_resolve_classref_to_classinfo   (functionptr) patcher_resolve_classref_to_classinfo
 
#define PATCHER_resolve_classref_to_vftbl   (functionptr) patcher_resolve_classref_to_vftbl
 
#define PATCHER_resolve_classref_to_index   (functionptr) patcher_resolve_classref_to_index
 
#define PATCHER_resolve_classref_to_flags   (functionptr) patcher_resolve_classref_to_flags
 
#define PATCHER_resolve_native_function   (functionptr) patcher_resolve_native_function
 
#define PATCHER_breakpoint   (functionptr) patcher_breakpoint
 
#define PATCHER_get_putstatic   (functionptr) patcher_get_putstatic
 
#define PATCHER_get_putfield   (functionptr) patcher_get_putfield
 
#define PATCHER_invokestatic_special   (functionptr) patcher_invokestatic_special
 
#define PATCHER_invokevirtual   (functionptr) patcher_invokevirtual
 
#define PATCHER_invokeinterface   (functionptr) patcher_invokeinterface
 
#define PATCHER_checkcast_interface   (functionptr) patcher_checkcast_interface
 
#define PATCHER_instanceof_interface   (functionptr) patcher_instanceof_interface
 

Typedefs

typedef struct patchref_t patchref_t
 
typedef struct
patcher_function_list_t 
patcher_function_list_t
 

Functions

void patcher_list_create (codeinfo *code)
 
void patcher_list_reset (codeinfo *code)
 
void patcher_list_free (codeinfo *code)
 
void patcher_list_show (codeinfo *code)
 Show the content of the whole patcher reference list for debugging purposes. More...
 
patchref_tpatcher_add_patch_ref (jitdata *jd, functionptr patcher, void *ref, s4 disp)
 
void patcher_resolve (codeinfo *code)
 Resolve all patchers in the current JIT run. More...
 
bool patcher_is_patched (patchref_t *pr)
 
bool patcher_is_patched_at (void *pc)
 
bool patcher_is_valid_trap_instruction_at (void *pc)
 Check if the trap instruction at the given PC is valid. More...
 
bool patcher_handler (u1 *pc)
 
void patcher_patch_code (patchref_t *pr)
 
bool patcher_resolve_class (patchref_t *pr)
 
bool patcher_initialize_class (patchref_t *pr)
 
bool patcher_resolve_classref_to_classinfo (patchref_t *pr)
 
bool patcher_resolve_classref_to_vftbl (patchref_t *pr)
 
bool patcher_resolve_classref_to_index (patchref_t *pr)
 
bool patcher_resolve_classref_to_flags (patchref_t *pr)
 
bool patcher_resolve_native_function (patchref_t *pr)
 
bool patcher_breakpoint (patchref_t *pr)
 Deals with breakpoint instructions (ICMD_BREAKPOINT) compiled into a JIT method. More...
 
bool patcher_get_putstatic (patchref_t *pr)
 
bool patcher_get_putfield (patchref_t *pr)
 
bool patcher_invokestatic_special (patchref_t *pr)
 
bool patcher_invokevirtual (patchref_t *pr)
 
bool patcher_invokeinterface (patchref_t *pr)
 
bool patcher_checkcast_interface (patchref_t *pr)
 
bool patcher_instanceof_interface (patchref_t *pr)
 

Variables

patcher_function_list_t patcher_function_list []
 

Macro Definition Documentation

#define PATCHER_breakpoint   (functionptr) patcher_breakpoint

Definition at line 131 of file patcher-common.hpp.

#define PATCHER_checkcast_interface   (functionptr) patcher_checkcast_interface

Definition at line 151 of file patcher-common.hpp.

#define PATCHER_get_putfield   (functionptr) patcher_get_putfield

Definition at line 139 of file patcher-common.hpp.

#define PATCHER_get_putstatic   (functionptr) patcher_get_putstatic

Definition at line 136 of file patcher-common.hpp.

#define PATCHER_initialize_class   (functionptr) patcher_initialize_class

Definition at line 113 of file patcher-common.hpp.

#define PATCHER_instanceof_interface   (functionptr) patcher_instanceof_interface

Definition at line 154 of file patcher-common.hpp.

#define PATCHER_invokeinterface   (functionptr) patcher_invokeinterface

Definition at line 148 of file patcher-common.hpp.

#define PATCHER_invokestatic_special   (functionptr) patcher_invokestatic_special

Definition at line 142 of file patcher-common.hpp.

#define PATCHER_invokevirtual   (functionptr) patcher_invokevirtual

Definition at line 145 of file patcher-common.hpp.

#define PATCHER_resolve_class   (functionptr) patcher_resolve_class

Definition at line 110 of file patcher-common.hpp.

#define PATCHER_resolve_classref_to_classinfo   (functionptr) patcher_resolve_classref_to_classinfo

Definition at line 116 of file patcher-common.hpp.

#define PATCHER_resolve_classref_to_flags   (functionptr) patcher_resolve_classref_to_flags

Definition at line 125 of file patcher-common.hpp.

#define PATCHER_resolve_classref_to_index   (functionptr) patcher_resolve_classref_to_index

Definition at line 122 of file patcher-common.hpp.

#define PATCHER_resolve_classref_to_vftbl   (functionptr) patcher_resolve_classref_to_vftbl

Definition at line 119 of file patcher-common.hpp.

#define PATCHER_resolve_native_function   (functionptr) patcher_resolve_native_function

Definition at line 128 of file patcher-common.hpp.

Typedef Documentation

typedef struct patchref_t patchref_t

Definition at line 31 of file patcher-common.hpp.

Function Documentation

patchref_t* patcher_add_patch_ref ( jitdata jd,
functionptr  patcher,
void ref,
s4  disp 
)

Definition at line 171 of file patcher-common.cpp.

bool patcher_breakpoint ( patchref_t pr)

Deals with breakpoint instructions (ICMD_BREAKPOINT) compiled into a JIT method.

This patcher might never patch back the original machine code because breakpoints are kept active.

Definition at line 479 of file patcher-common.cpp.

bool patcher_checkcast_interface ( patchref_t pr)

Definition at line 526 of file patcher.cpp.

bool patcher_get_putfield ( patchref_t pr)

Definition at line 308 of file patcher.cpp.

bool patcher_get_putstatic ( patchref_t pr)

Definition at line 264 of file patcher.cpp.

bool patcher_handler ( u1 pc)

Definition at line 286 of file patcher-common.cpp.

bool patcher_initialize_class ( patchref_t pr)

Definition at line 381 of file patcher-common.cpp.

bool patcher_instanceof_interface ( patchref_t pr)

Definition at line 572 of file patcher.cpp.

bool patcher_invokeinterface ( patchref_t pr)

Definition at line 477 of file patcher.cpp.

bool patcher_invokestatic_special ( patchref_t pr)

Definition at line 392 of file patcher.cpp.

bool patcher_invokevirtual ( patchref_t pr)

Definition at line 433 of file patcher.cpp.

bool patcher_is_patched ( patchref_t pr)
bool patcher_is_patched_at ( void pc)

Definition at line 249 of file patcher-common.cpp.

bool patcher_is_valid_trap_instruction_at ( void pc)

Check if the trap instruction at the given PC is valid.

Parameters
pcProgram counter.
Returns
true if valid, false otherwise.

Definition at line 72 of file patcher.cpp.

void patcher_list_create ( codeinfo code)

Definition at line 70 of file patcher-common.cpp.

void patcher_list_free ( codeinfo code)

Definition at line 97 of file patcher-common.cpp.

void patcher_list_reset ( codeinfo code)

Definition at line 83 of file patcher-common.cpp.

void patcher_list_show ( codeinfo code)

Show the content of the whole patcher reference list for debugging purposes.

Parameters
codeThe codeinfo containing the patcher list.

Definition at line 150 of file patcher-common.cpp.

void patcher_patch_code ( patchref_t pr)

Definition at line 114 of file patcher.cpp.

void patcher_resolve ( codeinfo code)

Resolve all patchers in the current JIT run.

Parameters
jdJIT data-structure

Definition at line 235 of file patcher-common.cpp.

bool patcher_resolve_class ( patchref_t pr)

Definition at line 411 of file patcher-common.cpp.

bool patcher_resolve_classref_to_classinfo ( patchref_t pr)

Definition at line 148 of file patcher.cpp.

bool patcher_resolve_classref_to_flags ( patchref_t pr)

Definition at line 225 of file patcher.cpp.

bool patcher_resolve_classref_to_index ( patchref_t pr)

Definition at line 372 of file patcher.cpp.

bool patcher_resolve_classref_to_vftbl ( patchref_t pr)

Definition at line 188 of file patcher.cpp.

bool patcher_resolve_native_function ( patchref_t pr)

Definition at line 440 of file patcher-common.cpp.

Variable Documentation

patcher_function_list_t patcher_function_list[]

Definition at line 607 of file patcher.cpp.