From 93a18c5d4160f632ecdb92af099574e9c7098c49 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 22 Apr 2016 13:16:14 +0100 Subject: Forbid HDeoptimize instructions in OSR methods. Otherwise dominated instructions will assume something that isn't necessarily correct if coming from the interpreter. bug:28335959 bug:28249238 bug:28348878 bug:28080135 Change-Id: I842bd1c6a919aff48cf6048d2ea51cf2d40f3c1d --- compiler/optimizing/graph_checker.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'compiler/optimizing/graph_checker.cc') diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 96837a8266..968e26724d 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -258,6 +258,15 @@ void GraphChecker::VisitBoundsCheck(HBoundsCheck* check) { VisitInstruction(check); } +void GraphChecker::VisitDeoptimize(HDeoptimize* deopt) { + if (GetGraph()->IsCompilingOsr()) { + AddError(StringPrintf("A graph compiled OSR cannot have a HDeoptimize instruction")); + } + + // Perform the instruction base checks too. + VisitInstruction(deopt); +} + void GraphChecker::VisitTryBoundary(HTryBoundary* try_boundary) { ArrayRef handlers = try_boundary->GetExceptionHandlers(); -- cgit v1.2.3-59-g8ed1b