Alien-LibJIT
view release on metacpan or search on metacpan
libjit/ChangeLog view on Meta::CPAN
* jit/jit-rules-x86.sel: selectors for call instructions.
2004-05-24 Rhys Weatherley <rweather@southern-storm.com.au>
* include/jit/jit-insn.h, include/jit/jit-opcode.h, jit/jit-block.c,
jit/jit-dump.c, jit/jit-except.c, jit/jit-function.c, jit/jit-insn.c,
jit/jit-internal.h, jit/jit-interp.c, jit/jit-interp.h,
jit/jit-opcode.c, jit/jit-rules-arm.c, jit/jit-rules-interp.c,
jit/jit-rules-x86.c, jit/jit-rules.h, jit/jit-setjmp.h:
rewrite the exception region routines to make them easier
to use from CLI and JVM style systems.
* jit/jit-rules-interp.c (_jit_gen_start_block): set the address
of the exception handler for interpreted code.
* include/jit/jit-plus.h, jitplus/jit-plus-function.cpp:
add missing functions to the C++ API.
2004-05-22 Rhys Weatherley <rweather@southern-storm.com.au>
* jit/jit-block.c (_jit_block_peephole_branch): don't allow
libjit/doc/libjit.texi view on Meta::CPAN
@item
Large set of mathematical and trigonometric operations
(sqrt, sin, cos, min, abs, etc) for inlining floating-point library functions.
@item
Simplified type layout and exception handling mechanisms, upon which a
variety of different object models can be built.
@item
Support for nested functions, able to access their parent's local variables
(for implementing Pascal-style languages).
@end itemize
@c -----------------------------------------------------------------------
@node Tutorials, Tutorial 1, Features, Top
@chapter Tutorials in using libjit
@cindex Tutorials
In this chapter, we describe how to use @code{libjit} with a number of
short tutorial exercises. Full source for these tutorials can be found
libjit/doc/mangling_rules.txt view on Meta::CPAN
<bit-size> ::= <hex> <hex> # sizes < 256
::= _ <hex>+ _ # sizes >= 256
<parameter> ::= <type>
::= <repeat-count> <backref>
<repeat-count> ::= 'T' # single repeat
::= 'N' <digit> # repeats of 2..9
::= 'N' <number> '_' # repeats of 10 or more
::= 'n' <digit> # alt-style, repeats of 1..9
::= 'n' <number> '_' # alt-style, repeats of 10+
<backref> ::= <digit> # backrefs 0..9
::= <number> '_' # backrefs of 10 or more
GCC 3.2 name mangling grammar (extracted from gcc sources):
----------------------------------------------------------
<substitution> ::= St
# ::std
libjit/dpas/dpas-scanner.l view on Meta::CPAN
}
++text;
}
lval->int_const.value = value;
dpas_infer_type(lval);
}
/*
* Forward declaration.
*/
static void dpas_skip_comment(int star_style);
%}
%option outfile="lex.yy.c"
%option noyywrap
%option nounput
%option case-insensitive
DIGIT [0-9]
HEX [0-9A-Fa-f]
libjit/dpas/dpas-scanner.l view on Meta::CPAN
dpas_linenum = saved_linenum;
yy_switch_to_buffer(saved_buffer);
/* Delete the buffer that we used on the file we just parsed */
yy_delete_buffer(new_buffer);
}
/*
* Skip a comment in the input stream.
*/
static void dpas_skip_comment(int star_style)
{
int ch;
for(;;)
{
ch = input();
if(ch == EOF)
{
break;
}
else if(ch == '}' && !star_style)
{
break;
}
else if(ch == '*' && star_style)
{
ch = input();
while(ch == '*')
{
ch = input();
}
if(ch == EOF || ch == ')')
{
break;
}
libjit/jit/jit-elf-read.c view on Meta::CPAN
return context->registered_symbols[index]->value;
}
}
/* If we get here, then we could not resolve the symbol */
printf("%s: could not resolve `%s'\n", name, symbol_name);
return 0;
}
/*
* Perform a DT_REL style relocation on an ELF binary.
*/
static int perform_rel
(jit_context_t context, jit_readelf_t readelf,
int print_failures, const char *name, Elf_Rel *reloc)
{
void *address;
void *value;
/* Get the address to apply the relocation at */
address = jit_readelf_map_vaddr(readelf, (jit_nuint)(reloc->r_offset));
libjit/jit/jit-elf-read.c view on Meta::CPAN
{
printf("%s: relocation type %d was not recognized\n",
name, (int)(ELF_R_TYPE(reloc->r_info)));
}
return 0;
}
return 1;
}
/*
* Perform a DT_RELA style relocation on an ELF binary.
*/
static int perform_rela
(jit_context_t context, jit_readelf_t readelf,
int print_failures, const char *name, Elf_Rela *reloc)
{
void *address;
void *value;
/* Get the address to apply the relocation at */
address = jit_readelf_map_vaddr(readelf, (jit_nuint)(reloc->r_offset));
libjit/jit/jit-elf-read.c view on Meta::CPAN
(Elf_Rela *)table))
{
ok = 0;
}
table += (jit_nuint)entry_size;
table_size -= entry_size;
}
}
/* Apply the "PLT" relocations in the dynamic section, which
may be either DT_REL or DT_RELA style relocations */
if(dynamic_for_type(readelf, DT_JMPREL, &address) &&
dynamic_for_type(readelf, DT_PLTRELSZ, &table_size) &&
dynamic_for_type(readelf, DT_PLTREL, &entry_size))
{
if(entry_size == DT_REL)
{
if(dynamic_for_type(readelf, DT_RELENT, &entry_size) && entry_size)
{
table = (unsigned char *)jit_readelf_map_vaddr
(readelf, (jit_nuint)address);
( run in 0.518 second using v1.01-cache-2.11-cpan-49f99fa48dc )