1270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz/* 2270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * Copyright (C) 2015 The Android Open Source Project 3270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * 4270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * Licensed under the Apache License, Version 2.0 (the "License"); 5270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * you may not use this file except in compliance with the License. 6270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * You may obtain a copy of the License at 7270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * 8270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * http://www.apache.org/licenses/LICENSE-2.0 9270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * 10270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * Unless required by applicable law or agreed to in writing, software 11270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * distributed under the License is distributed on an "AS IS" BASIS, 12270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * See the License for the specific language governing permissions and 14270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * limitations under the License. 15270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz */ 16270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz 17270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz/** 18270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz * Helper class used by smali test classes. 19270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz */ 20270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertzpublic class CatchHandlerOnEntryHelper { 21270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz 22270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz public static void throwExceptionDuringDeopt(int i) { 23270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz if (i == 0) { 247403503d9ba33463e850b7e87a1b0430372d7003Andreas Gampe DeoptimizationController.startDeoptimization(); 25270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz throw new RuntimeException("Test exception"); 26270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz } else { 277403503d9ba33463e850b7e87a1b0430372d7003Andreas Gampe DeoptimizationController.stopDeoptimization(); 28270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz } 29270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz } 30270a0e16c3b8e5b95cbfdbd8996ac137c7c6322bSebastien Hertz} 31