Commit 98ad19ba authored by Kevin Modzelewski's avatar Kevin Modzelewski

Reproduce a JIT bug that virtualenv triggers

The issue is a difference between how PhiAnalysis and TypeAnalysis
handle OSR compilations: type analysis is osr-aware but phi analysis
isn't.  I think the right solution to this is to make phi and
definedness analysis also osr aware, but I want to get these other changes
in.
parent 5b3cc779
......@@ -210,8 +210,8 @@ CompiledFunction* compileFunction(CLFunction* f, FunctionSpecialization* spec, E
ss << ") -> ";
ss << spec->rtn_type->debugName();
} else {
ss << "\033[34;1mDoing OSR-entry partial compile of " << source->parent_module->fn << ":" << name << ", starting with backedge to block "
<< entry_descriptor->backedge->target->idx;
ss << "\033[34;1mDoing OSR-entry partial compile of " << source->parent_module->fn << ":" << name
<< ", starting with backedge to block " << entry_descriptor->backedge->target->idx;
}
ss << " at effort level " << (int)effort;
ss << "\033[0m";
......
......@@ -40,6 +40,7 @@ bool USE_STRIPPED_STDLIB = true; // always true
bool ENABLE_INTERPRETER = true;
bool ENABLE_PYPA_PARSER = true;
bool USE_REGALLOC_BASIC = true;
bool PAUSE_AT_ABORT = false;
int OSR_THRESHOLD_INTERPRETER = 200;
int REOPT_THRESHOLD_INTERPRETER = 100;
......
......@@ -37,7 +37,7 @@ extern int OSR_THRESHOLD_T2, REOPT_THRESHOLD_T2;
extern int SPECULATION_THRESHOLD;
extern bool SHOW_DISASM, FORCE_INTERPRETER, FORCE_OPTIMIZE, PROFILE, DUMPJIT, TRAP, USE_STRIPPED_STDLIB,
CONTINUE_AFTER_FATAL, ENABLE_INTERPRETER, ENABLE_PYPA_PARSER, USE_REGALLOC_BASIC;
CONTINUE_AFTER_FATAL, ENABLE_INTERPRETER, ENABLE_PYPA_PARSER, USE_REGALLOC_BASIC, PAUSE_AT_ABORT;
extern bool ENABLE_ICS, ENABLE_ICGENERICS, ENABLE_ICGETITEMS, ENABLE_ICSETITEMS, ENABLE_ICDELITEMS, ENABLE_ICBINEXPS,
ENABLE_ICNONZEROS, ENABLE_ICCALLSITES, ENABLE_ICSETATTRS, ENABLE_ICGETATTRS, ENALBE_ICDELATTRS, ENABLE_ICGETGLOBALS,
......
......@@ -80,7 +80,7 @@ static int main(int argc, char** argv) {
bool stats = false;
bool unbuffered = false;
const char* command = NULL;
while ((code = getopt(argc, argv, "+OqdIibpjtrsSvnxc:Fu")) != -1) {
while ((code = getopt(argc, argv, "+OqdIibpjtrsSvnxc:FuP")) != -1) {
if (code == 'O')
FORCE_OPTIMIZE = true;
else if (code == 't')
......@@ -113,6 +113,8 @@ static int main(int argc, char** argv) {
USE_REGALLOC_BASIC = false;
} else if (code == 'x') {
ENABLE_PYPA_PARSER = false;
} else if (code == 'P') {
PAUSE_AT_ABORT = true;
} else if (code == 'F') {
CONTINUE_AFTER_FATAL = true;
} else if (code == 'c') {
......
......@@ -182,6 +182,12 @@ extern "C" void abort() {
alarm(0);
}
if (PAUSE_AT_ABORT) {
printf("PID %d about to call libc abort; pausing for a debugger...\n", getpid());
while (true) {
sleep(1);
}
}
libc_abort();
__builtin_unreachable();
}
......
# expected: fail
# - wip
# Regression test: make sure we can handle variables that are only defined
# on excluded parts of an osr compilation
def f():
if True:
for i in xrange(20000):
pass
else:
a = 1
f()
def f2():
if True:
for i in xrange(20000):
pass
else:
a = 1
if False:
print a
f2()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment