Skip to content

Commit

Permalink
Add sp_decont op
Browse files Browse the repository at this point in the history
One of the more common instructions not compiled by the expr compiler.
  • Loading branch information
bdw committed Aug 2, 2017
1 parent cdf2b2e commit 2dbb62f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build/Makefile.in
Expand Up @@ -574,8 +574,9 @@ src/jit/x64/emit@obj@: src/jit/x64/emit.c $(DYNASM_HEADERS)
src/jit/x64/emit.c: src/jit/x64/emit.dasc src/jit/x64/tiles.dasc $(MINILUA) $(DYNASM_SCRIPTS)
$(DYNASM) $(DASM_FLAGS) -o $@ src/jit/x64/emit.dasc


# Expression list tables
src/jit/core_expr_tables.h: src/jit/core.expr tools/expr-template-compiler.pl src/core/oplist src/jit/expr_ops.h
src/jit/core_expr_tables.h: src/jit/core.expr src/jit/macro.expr tools/expr-template-compiler.pl src/core/oplist src/jit/expr_ops.h
$(PERL) -Itools/ tools/expr-template-compiler.pl -o $@ src/jit/core.expr

# Architecture-specific tiles
Expand Down
7 changes: 7 additions & 0 deletions src/jit/core.expr
Expand Up @@ -203,3 +203,10 @@
(arglist 1 (carg (tc) ptr)))
(^exit)))

(template: sp_decont!
(ifv
(all 3
(nz $1) (^is_conc_obj $1) (nz (^getf (^stable $1) MVMSTable container_spec)))
(callv (^getf (^getf (^stable $1) MVMSTable container_spec) MVMContainerSpec fetch)
(arglist 3 (carg (tc) reg) (carg $1 reg) (carg $0 reg)))
(store $0 $1 ptr_sz)))
2 changes: 1 addition & 1 deletion src/jit/expr.c
Expand Up @@ -743,7 +743,7 @@ MVMJitExprTree * MVM_jit_expr_tree_build(MVMThreadContext *tc, MVMJitGraph *jg,
case MVM_SPESH_ANN_DEOPT_ONE_INS:
/* we should only see this in guards, which we don't do just
* yet, although we will. At the very least, this implies a flush. */
MVM_jit_log(tc, "WARNING expr tree is asked to handle DEOPT_ONE / DEOPT_INLINE (ins=%s) and can't really",
MVM_jit_log(tc, "WARNING expr tree is asked to handle DEOPT_ONE / DEOPT_INLINE (ins=%s) and can't really\n",
ins->info->name);
break;
case MVM_SPESH_ANN_DEOPT_ALL_INS:
Expand Down
4 changes: 4 additions & 0 deletions src/jit/macro.expr
Expand Up @@ -48,8 +48,12 @@


(macro: ^repr (,obj) (^getf (^stable ,obj) MVMSTable REPR))

(macro: ^is_type_obj (,a)
(nz (and (^getf ,a MVMObject header.flags) (^objflag MVM_CF_TYPE_OBJECT))))
(macro: ^is_conc_obj (,a)
(zr (and (^getf ,a MVMObject header.flags) (^objflag MVM_CF_TYPE_OBJECT))))

(macro: ^stable_cont_func (,obj ,func)
(^getf
(^getf (^stable ,obj) MVMSTable container_spec)
Expand Down

0 comments on commit 2dbb62f

Please sign in to comment.