Permalink
Browse files

Replace ExprValue with ValueDescrioptor

Each node value may reside in multiple storage locations, and each
storage location may contain multiple node values. ValueDescriptor
structures are intended to describe just a single value in a
single location, and to be arranged in tables and lists for lookup
purposes.
  • Loading branch information...
bdw committed Jun 4, 2016
1 parent 9a6ca81 commit fcc270b76494260c5849430684fce95f00ba4866
Showing with 174 additions and 400 deletions.
  1. +3 −3 src/jit/compile.c
  2. +3 −3 src/jit/compile.h
  3. +0 −28 src/jit/expr.h
  4. +4 −2 src/jit/internal.h
  5. +34 −236 src/jit/register.c
  6. +23 −3 src/jit/register.h
  7. +3 −3 src/jit/tile.h
  8. +0 −10 src/jit/x64/arch.h
  9. +22 −22 src/jit/x64/emit.dasc
  10. +1 −1 src/jit/x64/tile_decl.h
  11. +80 −88 src/jit/x64/tiles.dasc
  12. +1 −1 src/types.h
View
@@ -171,19 +171,19 @@ void MVM_jit_compile_breakpoint(void) {
/* pseudotile emit functions */
void MVM_jit_compile_branch(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJitExprTree *tree,
MVMint32 node, MVMJitExprValue **value, MVMJitExprNode *args) {
MVMint32 node, MVMJitValueDescriptor **value, MVMJitExprNode *args) {
MVM_jit_emit_branch(tc, compiler, args[0] + compiler->label_offset);
}
void MVM_jit_compile_conditional_branch(MVMThreadContext *tc, MVMJitCompiler *compiler,
MVMJitExprTree *tree, MVMint32 node,
MVMJitExprValue **values, MVMJitExprNode *args) {
MVMJitValueDescriptor **values, MVMJitExprNode *args) {
MVM_jit_emit_conditional_branch(tc, compiler, args[0], args[1] + compiler->label_offset);
}
void MVM_jit_compile_label(MVMThreadContext *tc, MVMJitCompiler *compiler,
MVMJitExprTree *tree, MVMint32 node,
MVMJitExprValue **values, MVMJitExprNode *args) {
MVMJitValueDescriptor **values, MVMJitExprNode *args) {
MVM_jit_emit_label(tc, compiler, tree->graph, args[0] + compiler->label_offset);
}
View
@@ -37,10 +37,10 @@ void MVM_jit_enter_code(MVMThreadContext *tc, MVMCompUnit *cu,
/* Peseudotile compile functions */
void MVM_jit_compile_label(MVMThreadContext *tc, MVMJitCompiler *compiler,
MVMJitExprTree *tree, MVMint32 node,
MVMJitExprValue **values, MVMJitExprNode *args);
MVMJitValueDescriptor **values, MVMJitExprNode *args);
void MVM_jit_compile_branch(MVMThreadContext *tc, MVMJitCompiler *compiler,
MVMJitExprTree *tree, MVMint32 node,
MVMJitExprValue **values, MVMJitExprNode *args);
MVMJitValueDescriptor **values, MVMJitExprNode *args);
void MVM_jit_compile_conditional_branch(MVMThreadContext *tc, MVMJitCompiler *compiler,
MVMJitExprTree *tree, MVMint32 node,
MVMJitExprValue **values, MVMJitExprNode *args);
MVMJitValueDescriptor **values, MVMJitExprNode *args);
View
@@ -106,34 +106,6 @@ struct MVMJitExprOpInfo {
MVMint8 cast;
};
struct MVMJitExprValue {
/* used to signal register allocator, tiles don't look at this */
MVMJitExprVtype type;
enum {
MVM_JIT_VALUE_EMPTY,
MVM_JIT_VALUE_ALLOCATED,
MVM_JIT_VALUE_SPILLED,
MVM_JIT_VALUE_DEAD,
MVM_JIT_VALUE_IMMORTAL
} state;
/* register allocated to this value */
MVMint8 reg_cls;
MVMint8 reg_num;
/* Spill location if any */
MVMint16 spill_location;
/* size of this value */
MVMint8 size;
/* Use information for register allcoator */
MVMint32 first_created;
MVMint32 last_created;
MVMint32 last_use;
MVMint32 num_use;
};
/* Tree node information for easy access and use during compilation (a
symbol table entry of sorts) */
struct MVMJitExprNodeInfo {
View
@@ -56,8 +56,10 @@ void MVM_jit_emit_control(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMJit
MVMJitControl *ctrl);
void MVM_jit_emit_load(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMint32 location, MVMint32 reg_cls, MVMint8 reg_num, MVMint32 size);
void MVM_jit_emit_spill(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMint32 location, MVMint32 reg_cls, MVMint8 reg_num, MVMint32 size);
void MVM_jit_emit_load(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMint32 location,
MVMJitStorageClass st_cls, MVMint8 st_pos, MVMint32 size);
void MVM_jit_emit_spill(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMint32 location,
MVMJitStorageClass st_cls, MVMint8 st_pos, MVMint32 size);
void MVM_jit_emit_copy(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMint32 dst_reg_cls,
MVMint8 dst_reg_num, MVMint32 src_reg_cls, MVMint8 src_reg_num);
void MVM_jit_emit_stack_arg(MVMThreadContext *tc, MVMJitCompiler *compiler, MVMint32 stack_pos,
Oops, something went wrong.

0 comments on commit fcc270b

Please sign in to comment.