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 ...@@ -210,8 +210,8 @@ CompiledFunction* compileFunction(CLFunction* f, FunctionSpecialization* spec, E
ss << ") -> "; ss << ") -> ";
ss << spec->rtn_type->debugName(); ss << spec->rtn_type->debugName();
} else { } else {
ss << "\033[34;1mDoing OSR-entry partial compile of " << source->parent_module->fn << ":" << name << ", starting with backedge to block " ss << "\033[34;1mDoing OSR-entry partial compile of " << source->parent_module->fn << ":" << name
<< entry_descriptor->backedge->target->idx; << ", starting with backedge to block " << entry_descriptor->backedge->target->idx;
} }
ss << " at effort level " << (int)effort; ss << " at effort level " << (int)effort;
ss << "\033[0m"; ss << "\033[0m";
......
...@@ -40,6 +40,7 @@ bool USE_STRIPPED_STDLIB = true; // always true ...@@ -40,6 +40,7 @@ bool USE_STRIPPED_STDLIB = true; // always true
bool ENABLE_INTERPRETER = true; bool ENABLE_INTERPRETER = true;
bool ENABLE_PYPA_PARSER = true; bool ENABLE_PYPA_PARSER = true;
bool USE_REGALLOC_BASIC = true; bool USE_REGALLOC_BASIC = true;
bool PAUSE_AT_ABORT = false;
int OSR_THRESHOLD_INTERPRETER = 200; int OSR_THRESHOLD_INTERPRETER = 200;
int REOPT_THRESHOLD_INTERPRETER = 100; int REOPT_THRESHOLD_INTERPRETER = 100;
......
...@@ -37,7 +37,7 @@ extern int OSR_THRESHOLD_T2, REOPT_THRESHOLD_T2; ...@@ -37,7 +37,7 @@ extern int OSR_THRESHOLD_T2, REOPT_THRESHOLD_T2;
extern int SPECULATION_THRESHOLD; extern int SPECULATION_THRESHOLD;
extern bool SHOW_DISASM, FORCE_INTERPRETER, FORCE_OPTIMIZE, PROFILE, DUMPJIT, TRAP, USE_STRIPPED_STDLIB, 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, 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, ENABLE_ICNONZEROS, ENABLE_ICCALLSITES, ENABLE_ICSETATTRS, ENABLE_ICGETATTRS, ENALBE_ICDELATTRS, ENABLE_ICGETGLOBALS,
......
...@@ -80,7 +80,7 @@ static int main(int argc, char** argv) { ...@@ -80,7 +80,7 @@ static int main(int argc, char** argv) {
bool stats = false; bool stats = false;
bool unbuffered = false; bool unbuffered = false;
const char* command = NULL; const char* command = NULL;
while ((code = getopt(argc, argv, "+OqdIibpjtrsSvnxc:Fu")) != -1) { while ((code = getopt(argc, argv, "+OqdIibpjtrsSvnxc:FuP")) != -1) {
if (code == 'O') if (code == 'O')
FORCE_OPTIMIZE = true; FORCE_OPTIMIZE = true;
else if (code == 't') else if (code == 't')
...@@ -113,6 +113,8 @@ static int main(int argc, char** argv) { ...@@ -113,6 +113,8 @@ static int main(int argc, char** argv) {
USE_REGALLOC_BASIC = false; USE_REGALLOC_BASIC = false;
} else if (code == 'x') { } else if (code == 'x') {
ENABLE_PYPA_PARSER = false; ENABLE_PYPA_PARSER = false;
} else if (code == 'P') {
PAUSE_AT_ABORT = true;
} else if (code == 'F') { } else if (code == 'F') {
CONTINUE_AFTER_FATAL = true; CONTINUE_AFTER_FATAL = true;
} else if (code == 'c') { } else if (code == 'c') {
......
...@@ -182,6 +182,12 @@ extern "C" void abort() { ...@@ -182,6 +182,12 @@ extern "C" void abort() {
alarm(0); 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(); libc_abort();
__builtin_unreachable(); __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