Skip to content

Commit

Permalink
WIP on confprogs, start on a parser/compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed May 18, 2019
1 parent c10a16c commit 1b4a8b2
Show file tree
Hide file tree
Showing 4 changed files with 736 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/core/instance.h
Expand Up @@ -247,6 +247,12 @@ struct MVMInstance {
* than per STable, as this doesn't happen often. */
uv_mutex_t mutex_parameterization_add;

/************************************************************************
* Configuration programs (for spesh, profiler, ...)
************************************************************************/

MVMConfigurationProgram *confprog;

/************************************************************************
* Specializer (dynamic optimization)
************************************************************************/
Expand Down
36 changes: 36 additions & 0 deletions src/core/ops.c
Expand Up @@ -12831,12 +12831,48 @@ static const MVMOpInfo MVM_op_infos[] = {

static const unsigned short MVM_op_counts = 917;

static const MVMuint16 last_op_allowed = 820;

static const MVMuint8 MVM_op_allowed_in_confprog[] = {
0x90, 0x1, 0x80, 0x3,
0x0, 0x0, 0x0, 0xFF,
0xFF, 0xF0, 0xB, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0xF0, 0xFF, 0xEF, 0x7,
0xF0, 0x1, 0x0, 0x1,
0xD, 0x5, 0x0, 0x80,
0x16, 0x0, 0x0, 0x10,
0xA0, 0x0, 0x6, 0xF8,
0x0, 0x0, 0x0, 0x0,
0x40, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x80, 0x80, 0x42,
0x7, 0x1, 0x20, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x1C, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0,};

MVM_PUBLIC const MVMOpInfo * MVM_op_get_op(unsigned short op) {
if (op >= MVM_op_counts)
return NULL;
return &MVM_op_infos[op];
}

MVM_PUBLIC const MVMuint8 MVM_op_is_allowed_in_confprog(unsigned short op) {
if (op > last_op_allowed)
return 0;
return MVM_op_allowed_in_confprog[op];
}

MVM_PUBLIC const char *MVM_op_get_mark(unsigned short op) {
if (op > 821) {
return ".s";
Expand Down

0 comments on commit 1b4a8b2

Please sign in to comment.