/* * Copyright (c) 2018-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ class HoistNoIndirectMod { int id = 0; public int increment() { id = calcNext(); return id; } public int calcNext() { return (id + 1); } public int calcSame() { return id; } public int increment_dont_hoist_FP(int n) { for (int i = 0; i < n; i++) { id = calcNext(); // shouldn't be hoisted } return id; } public int modify_and_increment_dont_hoist_FP(int n) { int p = 0; for (int i = 0; i < n; i++) { p += calcNext(); id = i; } return p; } }