Commit 0d59de2f authored by Marius Wachtler's avatar Marius Wachtler

Add -I command line option to force the interpreter to execute the code higher...

Add -I command line option to force the interpreter to execute the code higher level tiers get disabled
parent 2df05571
...@@ -381,7 +381,7 @@ Value ASTInterpreter::visit_jump(AST_Jump* node) { ...@@ -381,7 +381,7 @@ Value ASTInterpreter::visit_jump(AST_Jump* node) {
if (ENABLE_OSR && backedge) { if (ENABLE_OSR && backedge) {
++edgecount; ++edgecount;
if (edgecount > OSR_THRESHOLD) { if (edgecount > OSR_THRESHOLD && !FORCE_INTERPRETER) {
eraseDeadSymbols(); eraseDeadSymbols();
const OSREntryDescriptor* found_entry = nullptr; const OSREntryDescriptor* found_entry = nullptr;
...@@ -1081,7 +1081,7 @@ const void* interpreter_instr_addr = (void*)&ASTInterpreter::execute; ...@@ -1081,7 +1081,7 @@ const void* interpreter_instr_addr = (void*)&ASTInterpreter::execute;
Box* astInterpretFunction(CompiledFunction* cf, int nargs, Box* closure, Box* generator, Box* arg1, Box* arg2, Box* astInterpretFunction(CompiledFunction* cf, int nargs, Box* closure, Box* generator, Box* arg1, Box* arg2,
Box* arg3, Box** args) { Box* arg3, Box** args) {
if (unlikely(cf->times_called > REOPT_THRESHOLD && ENABLE_REOPT)) { if (unlikely(cf->times_called > REOPT_THRESHOLD && ENABLE_REOPT && !FORCE_INTERPRETER)) {
CompiledFunction* optimized = reoptCompiledFuncInternal(cf); CompiledFunction* optimized = reoptCompiledFuncInternal(cf);
if (closure && generator) if (closure && generator)
return optimized->closure_generator_call((BoxedClosure*)closure, (BoxedGenerator*)generator, arg1, arg2, return optimized->closure_generator_call((BoxedClosure*)closure, (BoxedGenerator*)generator, arg1, arg2,
......
...@@ -94,6 +94,8 @@ ScopeInfo* SourceInfo::getScopeInfo() { ...@@ -94,6 +94,8 @@ ScopeInfo* SourceInfo::getScopeInfo() {
} }
EffortLevel::EffortLevel initialEffort() { EffortLevel::EffortLevel initialEffort() {
if (FORCE_INTERPRETER)
return EffortLevel::INTERPRETED;
if (FORCE_OPTIMIZE) if (FORCE_OPTIMIZE)
return EffortLevel::MAXIMAL; return EffortLevel::MAXIMAL;
if (ENABLE_INTERPRETER) if (ENABLE_INTERPRETER)
......
...@@ -29,6 +29,7 @@ int PYTHON_VERSION_HEX = version_hex(PYTHON_VERSION_MAJOR, PYTHON_VERSION_MINOR, ...@@ -29,6 +29,7 @@ int PYTHON_VERSION_HEX = version_hex(PYTHON_VERSION_MAJOR, PYTHON_VERSION_MINOR,
int MAX_OPT_ITERATIONS = 1; int MAX_OPT_ITERATIONS = 1;
bool FORCE_INTERPRETER = false;
bool FORCE_OPTIMIZE = false; bool FORCE_OPTIMIZE = false;
bool SHOW_DISASM = false; bool SHOW_DISASM = false;
bool PROFILE = false; bool PROFILE = false;
......
...@@ -31,8 +31,8 @@ inline int version_hex(int major, int minor, int micro, int level = 0, int seria ...@@ -31,8 +31,8 @@ inline int version_hex(int major, int minor, int micro, int level = 0, int seria
extern int MAX_OPT_ITERATIONS; extern int MAX_OPT_ITERATIONS;
extern bool SHOW_DISASM, FORCE_OPTIMIZE, PROFILE, DUMPJIT, TRAP, USE_STRIPPED_STDLIB, ENABLE_INTERPRETER, extern bool SHOW_DISASM, FORCE_INTERPRETER, FORCE_OPTIMIZE, PROFILE, DUMPJIT, TRAP, USE_STRIPPED_STDLIB,
ENABLE_PYPA_PARSER, USE_REGALLOC_BASIC; ENABLE_INTERPRETER, ENABLE_PYPA_PARSER, USE_REGALLOC_BASIC;
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,
......
...@@ -58,7 +58,7 @@ int main(int argc, char** argv) { ...@@ -58,7 +58,7 @@ int main(int argc, char** argv) {
bool force_repl = false; bool force_repl = false;
bool repl = true; bool repl = true;
bool stats = false; bool stats = false;
while ((code = getopt(argc, argv, "+Oqcdibpjtrsvnx")) != -1) { while ((code = getopt(argc, argv, "+OqcdIibpjtrsvnx")) != -1) {
if (code == 'O') if (code == 'O')
FORCE_OPTIMIZE = true; FORCE_OPTIMIZE = true;
else if (code == 't') else if (code == 't')
...@@ -71,6 +71,8 @@ int main(int argc, char** argv) { ...@@ -71,6 +71,8 @@ int main(int argc, char** argv) {
// caching = true; // caching = true;
else if (code == 'd') else if (code == 'd')
SHOW_DISASM = true; SHOW_DISASM = true;
else if (code == 'I')
FORCE_INTERPRETER = true;
else if (code == 'i') else if (code == 'i')
force_repl = true; force_repl = true;
else if (code == 'n') { else if (code == 'n') {
......
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