ValueUsage.h (1094B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * vim: set ts=8 sts=2 et sw=2 tw=80: 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef frontend_ValueUsage_h 8 #define frontend_ValueUsage_h 9 10 namespace js { 11 namespace frontend { 12 13 // Used to control whether the expression result is used. This enables various 14 // optimizations, for example it allows to emit JSOp::CallIgnoresRv for function 15 // calls. 16 enum class ValueUsage { 17 // Assume the value of the current expression may be used. This is always 18 // correct but prohibits optimizations like JSOp::CallIgnoresRv. 19 WantValue, 20 21 // Pass this when emitting an expression if the expression's value is 22 // definitely unused by later instructions. You must make sure the next 23 // instruction is JSOp::Pop, a jump to a JSOp::Pop, or something similar. 24 IgnoreValue 25 }; 26 27 } /* namespace frontend */ 28 } /* namespace js */ 29 30 #endif /* frontend_ValueUsage_h */