diff options
author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2021-03-30 15:37:20 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:32 -0400 |
commit | c5f31264287a1c587448e9a437603da1b8497e67 (patch) | |
tree | 3d525a75c35987d58e526abcd25373e387e9571e /yjit_core.h | |
parent | ac1aa84c1a866ee58c1f75874ceb226b297d676d (diff) |
Commit WIP
Diffstat (limited to 'yjit_core.h')
-rw-r--r-- | yjit_core.h | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/yjit_core.h b/yjit_core.h index 5a407bf37a..3a937e198c 100644 --- a/yjit_core.h +++ b/yjit_core.h @@ -20,10 +20,12 @@ // Maximum number of temp value types we keep track of #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) #define DEFAULT_CTX ( (ctx_t){ 0 } ) - /** 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, // but then we also need a value for "unknown type" uint8_t is_fixnum : 1; - uint8_t is_bool : 1; // is this useful? - uint8_t is_array : 1; // for opt_aref - uint8_t is_hash : 1; // for opt_aref - uint8_t is_symbol : 1; - uint8_t is_string : 1; + //uint8_t is_array : 1; // for opt_aref + //uint8_t is_hash : 1; // for opt_aref + //uint8_t is_symbol : 1; + //uint8_t is_string : 1; } val_type_t; STATIC_ASSERT(val_type_size, sizeof(val_type_t) == 1); @@ -63,7 +64,7 @@ typedef enum yjit_temp_loc { TEMP_STACK = 0, TEMP_SELF, - TEMP_LOCAL, // Local with index + //TEMP_LOCAL, // Local with index //TEMP_CONST, // Small constant } temp_loc_t; @@ -74,7 +75,7 @@ typedef struct yjit_temp_mapping uint8_t kind: 2; // Index of the local variale, - // or small non-negative constant + // or small non-negative constant in [0, 63] uint8_t idx : 6; } temp_mapping_t; @@ -113,9 +114,21 @@ typedef struct yjit_context // This represents how far the JIT's SP is from the "real" SP int16_t sp_offset; + + + + + + // FIXME: no longer need this bit after type mapping refactoring // Whether we know self is a heap object bool self_is_object : 1; + + + + + + } ctx_t; // Tuple of (iseq, idx) used to idenfity basic blocks |