Commit 053a23d6 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #610 from kmod/disable_deopt

Temporarily disable type speculation
parents 2e879e2f f7ea6f5f
...@@ -115,6 +115,10 @@ private: ...@@ -115,6 +115,10 @@ private:
assert(old_type); assert(old_type);
assert(speculation != TypeAnalysis::NONE); assert(speculation != TypeAnalysis::NONE);
if (VERBOSITY() >= 3)
printf("Would maybe try to speculate but deopt is currently broken\n");
return old_type;
if (speculated_cls != NULL && speculated_cls->is_constant) { if (speculated_cls != NULL && speculated_cls->is_constant) {
ConcreteCompilerType* speculated_type = unboxedType(typeFromClass(speculated_cls)); ConcreteCompilerType* speculated_type = unboxedType(typeFromClass(speculated_cls));
if (VERBOSITY() >= 2) { if (VERBOSITY() >= 2) {
......
...@@ -739,7 +739,7 @@ void CompiledFunction::speculationFailed() { ...@@ -739,7 +739,7 @@ void CompiledFunction::speculationFailed() {
printf("%p\n", clfunc->versions[i]); printf("%p\n", clfunc->versions[i]);
} }
} }
assert(found); RELEASE_ASSERT(found, "");
} }
} }
......
...@@ -165,6 +165,14 @@ extern "C" Box* deopt(AST_expr* expr, Box* value) { ...@@ -165,6 +165,14 @@ extern "C" Box* deopt(AST_expr* expr, Box* value) {
static StatCounter num_deopt("num_deopt"); static StatCounter num_deopt("num_deopt");
num_deopt.log(); num_deopt.log();
printf("Deopt!\n");
print_ast(expr);
printf("\n");
dump(value);
printf("\n");
RELEASE_ASSERT(0, "deopt is currently broken...");
FrameStackState frame_state = getFrameStackState(); FrameStackState frame_state = getFrameStackState();
auto execution_point = getExecutionPoint(); auto execution_point = getExecutionPoint();
......
# skip-if: '-O' in EXTRA_JIT_ARGS # skip-if: '-O' in EXTRA_JIT_ARGS
# expected: statfail
# statcheck: 4 <= noninit_count('num_deopt') < 50 # statcheck: 4 <= noninit_count('num_deopt') < 50
# statcheck: 1 <= stats["num_osr_exits"] <= 2 # statcheck: 1 <= stats["num_osr_exits"] <= 2
......
# skip-if: '-O' in EXTRA_JIT_ARGS # skip-if: '-O' in EXTRA_JIT_ARGS
# expected: statfail
# statcheck: 4 <= noninit_count('num_deopt') < 50 # statcheck: 4 <= noninit_count('num_deopt') < 50
# statcheck: 1 <= stats["num_osr_exits"] <= 2 # statcheck: 1 <= stats["num_osr_exits"] <= 2
......
# skip-if: '-O' in EXTRA_JIT_ARGS # skip-if: '-O' in EXTRA_JIT_ARGS
# expected: statfail
# statcheck: 4 <= noninit_count('num_deopt') < 50 # statcheck: 4 <= noninit_count('num_deopt') < 50
# statcheck: 1 <= stats["num_osr_exits"] <= 2 # statcheck: 1 <= stats["num_osr_exits"] <= 2
...@@ -81,3 +82,25 @@ def main(): ...@@ -81,3 +82,25 @@ def main():
if i == 1500: if i == 1500:
c.pid = 1.0 c.pid = 1.0
main() main()
# This test tries to OSR up to the highest tier and then deopt from there:
def test_deopt_from_maximal(C):
c = C()
c.a = 1
def f(c):
n = 1000000
while n:
c.a
n -= 1
f(c)
c.a = None
f(c)
# Test for both old-style and new-style classes:
class C:
pass
class D(object):
pass
test_deopt_from_maximal(C)
test_deopt_from_maximal(D)
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