mirror of
https://github.com/ruby/ruby.git
synced 2025-09-22 12:04:01 +02:00
Start implementing BBV primitives
This commit is contained in:
parent
f7717b1d46
commit
20f5b7426e
5 changed files with 70 additions and 27 deletions
14
ujit_core.h
14
ujit_core.h
|
@ -20,6 +20,17 @@
|
|||
// Maximum number of versions per block
|
||||
#define MAX_VERSIONS 5
|
||||
|
||||
// Tuple of (iseq, idx) used to idenfity basic blocks
|
||||
typedef struct BlockId
|
||||
{
|
||||
// Instruction sequence
|
||||
const rb_iseq_t *iseq;
|
||||
|
||||
// Instruction index
|
||||
const unsigned int idx;
|
||||
|
||||
} blockid_t;
|
||||
|
||||
// Code generation context
|
||||
typedef struct ctx_struct
|
||||
{
|
||||
|
@ -48,6 +59,7 @@ typedef struct ctx_struct
|
|||
|
||||
} ctx_t;
|
||||
|
||||
// Context object methods
|
||||
int ctx_get_opcode(ctx_t *ctx);
|
||||
VALUE ctx_get_arg(ctx_t* ctx, size_t arg_idx);
|
||||
x86opnd_t ctx_sp_opnd(ctx_t* ctx, int32_t offset_bytes);
|
||||
|
@ -55,4 +67,6 @@ x86opnd_t ctx_stack_push(ctx_t* ctx, size_t n);
|
|||
x86opnd_t ctx_stack_pop(ctx_t* ctx, size_t n);
|
||||
x86opnd_t ctx_stack_opnd(ctx_t* ctx, int32_t idx);
|
||||
|
||||
void ujit_init_core(void);
|
||||
|
||||
#endif // #ifndef UJIT_CORE_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue