Skip to content

Commit

Permalink
Add support for all native int's in lexprimspec
Browse files Browse the repository at this point in the history
This was missing the non-64 bit signed ints as well as all unsigned
types.
  • Loading branch information
samcv committed Jun 17, 2018
1 parent bbf38a9 commit ccb8436
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/6model/6model.h
Expand Up @@ -86,6 +86,13 @@ struct MVMStorageSpec {
#define MVM_STORAGE_SPEC_BP_INT 1
#define MVM_STORAGE_SPEC_BP_NUM 2
#define MVM_STORAGE_SPEC_BP_STR 3
#define MVM_STORAGE_SPEC_BP_INT8 4
#define MVM_STORAGE_SPEC_BP_INT16 5
#define MVM_STORAGE_SPEC_BP_INT32 6
#define MVM_STORAGE_SPEC_BP_UINT8 7
#define MVM_STORAGE_SPEC_BP_UINT16 8
#define MVM_STORAGE_SPEC_BP_UINT32 9
#define MVM_STORAGE_SPEC_BP_UINT64 10

/* can_box bit field values. */
#define MVM_STORAGE_SPEC_CAN_BOX_INT 1
Expand Down Expand Up @@ -290,10 +297,10 @@ struct MVMSTable {
/* Information - if any - about how we can turn something of this type
* into a boolean. */
MVMBoolificationSpec *boolification_spec;

/* The HLL that this type is owned by, if any. */
MVMHLLConfig *hll_owner;

/* The role that the type plays in the HLL, if any. */
MVMint64 hll_role;

Expand Down
16 changes: 15 additions & 1 deletion src/core/frame.c
Expand Up @@ -1738,9 +1738,23 @@ MVMuint16 MVM_frame_lexical_primspec(MVMThreadContext *tc, MVMFrame *f, MVMStrin
return MVM_STORAGE_SPEC_BP_STR;
case MVM_reg_obj:
return MVM_STORAGE_SPEC_BP_NONE;
case MVM_reg_int8:
return MVM_STORAGE_SPEC_BP_INT8;
case MVM_reg_int16:
return MVM_STORAGE_SPEC_BP_INT16;
case MVM_reg_int32:
return MVM_STORAGE_SPEC_BP_INT32;
case MVM_reg_uint8:
return MVM_STORAGE_SPEC_BP_UINT8;
case MVM_reg_uint16:
return MVM_STORAGE_SPEC_BP_UINT16;
case MVM_reg_uint32:
return MVM_STORAGE_SPEC_BP_UINT32;
case MVM_reg_uint64:
return MVM_STORAGE_SPEC_BP_UINT64;
default:
{
char *c_name = MVM_string_utf8_encode_C_string(tc, name);
char *c_name = MVM_string_utf8_encode_C_string(tc, name);
char *waste[] = { c_name, NULL };
MVM_exception_throw_adhoc_free(tc, waste,
"Unhandled lexical type '%s' in lexprimspec for '%s'",
Expand Down

0 comments on commit ccb8436

Please sign in to comment.