Discussion:
vex: r3334 - in /branches/VEX_JIT_HACKS/priv: host_x86_isel.c ir_defs.c ir_opt.c
(too old to reply)
s***@valgrind.org
2017-03-28 08:52:20 UTC
Permalink
Raw Message
Author: iraisr
Date: Tue Mar 28 09:52:20 2017
New Revision: 3334

Log:
Obvious fixes for the new approach

Modified:
branches/VEX_JIT_HACKS/priv/host_x86_isel.c
branches/VEX_JIT_HACKS/priv/ir_defs.c
branches/VEX_JIT_HACKS/priv/ir_opt.c

Modified: branches/VEX_JIT_HACKS/priv/host_x86_isel.c
==============================================================================
--- branches/VEX_JIT_HACKS/priv/host_x86_isel.c (original)
+++ branches/VEX_JIT_HACKS/priv/host_x86_isel.c Tue Mar 28 09:52:20 2017
@@ -4458,7 +4458,8 @@
/* Copy BB's type env. */
/* TODO-JIT: Currently works only with no if-then-else statements. */
vassert(bb->id_seq == 1);
- env->stmts = bb->stmts;
+ env->type_env = bb->tyenv;
+ env->stmts = bb->stmts;

/* Make up an IRTemp -> virtual HReg mapping. This doesn't
change as we go along. */

Modified: branches/VEX_JIT_HACKS/priv/ir_defs.c
==============================================================================
--- branches/VEX_JIT_HACKS/priv/ir_defs.c (original)
+++ branches/VEX_JIT_HACKS/priv/ir_defs.c Tue Mar 28 09:52:20 2017
@@ -3775,9 +3775,9 @@

void setIRTempDefined(IRTempDefSet* def_set, IRTemp tmp)
{
- vassert(!isIRTempDefined(def_set, tmp));
+ UInt slots_required = (tmp + sizeof(UChar)) / sizeof(UChar);

- if (tmp / sizeof(UChar) >= def_set->slots_size) {
+ if (slots_required >= def_set->slots_size) {
UChar* new_set = LibVEX_Alloc_inline(2 * def_set->slots_size);
for (UInt i = 0; i < def_set->slots_used; i++) {
new_set[i] = def_set->set[i];
@@ -3786,13 +3786,15 @@
def_set->slots_size *= 2;
}

- if (tmp / sizeof(UChar) >= def_set->slots_used) {
- for (UInt i = def_set->slots_used; i < tmp / sizeof(UChar); i++) {
+ if (slots_required > def_set->slots_used) {
+ for (UInt i = def_set->slots_used; i < slots_required; i++) {
def_set->set[i] = 0;
}
- def_set->slots_used = tmp / sizeof(UChar);
+ def_set->slots_used = slots_required;
}

+ vassert(!isIRTempDefined(def_set, tmp));
+
UInt mask = (1 << (tmp % sizeof(UChar)));
def_set->set[tmp / sizeof(UChar)] |= mask;
}

Modified: branches/VEX_JIT_HACKS/priv/ir_opt.c
==============================================================================
--- branches/VEX_JIT_HACKS/priv/ir_opt.c (original)
+++ branches/VEX_JIT_HACKS/priv/ir_opt.c Tue Mar 28 09:52:20 2017
@@ -3030,6 +3030,7 @@
{
SubstEnv* env = newSubstEnv(in->tyenv, in->stmts, NULL);
IRSB* out = emptyIRSB();
+ out->tyenv = deepCopyIRTypeEnv(in->tyenv);
out->stmts = subst_and_fold_Stmts(env, in->stmts);
out->id_seq = in->id_seq;
out->next = subst_Expr( env, in->next );

Loading...