mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Commit WIP
This commit is contained in:
parent
ac1aa84c1a
commit
c5f3126428
1 changed files with 21 additions and 8 deletions
29
yjit_core.h
29
yjit_core.h
|
@ -20,10 +20,12 @@
|
||||||
// Maximum number of temp value types we keep track of
|
// Maximum number of temp value types we keep track of
|
||||||
#define MAX_TEMP_TYPES 8
|
#define MAX_TEMP_TYPES 8
|
||||||
|
|
||||||
|
// Maximum number of local variable types we keep track of
|
||||||
|
#define MAX_LOCAL_TYPES 8
|
||||||
|
|
||||||
// Default versioning context (no type information)
|
// Default versioning context (no type information)
|
||||||
#define DEFAULT_CTX ( (ctx_t){ 0 } )
|
#define DEFAULT_CTX ( (ctx_t){ 0 } )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Represent the type of a value (local/stack/self) in YJIT
|
Represent the type of a value (local/stack/self) in YJIT
|
||||||
*/
|
*/
|
||||||
|
@ -38,11 +40,10 @@ typedef struct yjit_val_type
|
||||||
// NOTE: we could switch this to an enum,
|
// NOTE: we could switch this to an enum,
|
||||||
// but then we also need a value for "unknown type"
|
// but then we also need a value for "unknown type"
|
||||||
uint8_t is_fixnum : 1;
|
uint8_t is_fixnum : 1;
|
||||||
uint8_t is_bool : 1; // is this useful?
|
//uint8_t is_array : 1; // for opt_aref
|
||||||
uint8_t is_array : 1; // for opt_aref
|
//uint8_t is_hash : 1; // for opt_aref
|
||||||
uint8_t is_hash : 1; // for opt_aref
|
//uint8_t is_symbol : 1;
|
||||||
uint8_t is_symbol : 1;
|
//uint8_t is_string : 1;
|
||||||
uint8_t is_string : 1;
|
|
||||||
|
|
||||||
} val_type_t;
|
} val_type_t;
|
||||||
STATIC_ASSERT(val_type_size, sizeof(val_type_t) == 1);
|
STATIC_ASSERT(val_type_size, sizeof(val_type_t) == 1);
|
||||||
|
@ -63,7 +64,7 @@ typedef enum yjit_temp_loc
|
||||||
{
|
{
|
||||||
TEMP_STACK = 0,
|
TEMP_STACK = 0,
|
||||||
TEMP_SELF,
|
TEMP_SELF,
|
||||||
TEMP_LOCAL, // Local with index
|
//TEMP_LOCAL, // Local with index
|
||||||
//TEMP_CONST, // Small constant
|
//TEMP_CONST, // Small constant
|
||||||
|
|
||||||
} temp_loc_t;
|
} temp_loc_t;
|
||||||
|
@ -74,7 +75,7 @@ typedef struct yjit_temp_mapping
|
||||||
uint8_t kind: 2;
|
uint8_t kind: 2;
|
||||||
|
|
||||||
// Index of the local variale,
|
// Index of the local variale,
|
||||||
// or small non-negative constant
|
// or small non-negative constant in [0, 63]
|
||||||
uint8_t idx : 6;
|
uint8_t idx : 6;
|
||||||
|
|
||||||
} temp_mapping_t;
|
} temp_mapping_t;
|
||||||
|
@ -113,9 +114,21 @@ typedef struct yjit_context
|
||||||
// This represents how far the JIT's SP is from the "real" SP
|
// This represents how far the JIT's SP is from the "real" SP
|
||||||
int16_t sp_offset;
|
int16_t sp_offset;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// FIXME: no longer need this bit after type mapping refactoring
|
||||||
// Whether we know self is a heap object
|
// Whether we know self is a heap object
|
||||||
bool self_is_object : 1;
|
bool self_is_object : 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} ctx_t;
|
} ctx_t;
|
||||||
|
|
||||||
// Tuple of (iseq, idx) used to idenfity basic blocks
|
// Tuple of (iseq, idx) used to idenfity basic blocks
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue