Deshim VirtualExecutor in folly
[hiphop-php.git] / hphp / hhbbc / type-ops.h
blob55f884aea09a8873f25dc737bff7e2b842c40596
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-present Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #pragma once
18 #include "hphp/runtime/vm/hhbc.h"
20 namespace HPHP::HHBBC {
22 struct Type;
24 //////////////////////////////////////////////////////////////////////
27 * Operations on the typesystem that correspond to runtime operations
28 * on Cells.
30 * Unless otherwise noted, all types in this module (both parameters
31 * and returns) are required to be subtypes of TCell.
34 //////////////////////////////////////////////////////////////////////
37 * Attempt to convert `ty' to an int, with effects on types as the
38 * effects at runtime of cellToInt.
40 Type typeToInt(Type ty);
43 * Computes effects on types as for the effects at runtime of tvAdd,
44 * tvSub, etc.
46 Type typeAdd(Type, Type);
47 Type typeSub(Type, Type);
48 Type typeMul(Type, Type);
49 Type typeDiv(Type, Type);
50 Type typeMod(Type, Type);
51 Type typePow(Type, Type);
54 * Bitwise operations on types. Computes effects on types as for the
55 * runtime effects of tvBitAnd, tvBitOr, etc.
57 Type typeBitAnd(Type, Type);
58 Type typeBitOr(Type, Type);
59 Type typeBitXor(Type, Type);
60 Type typeShl(Type, Type);
61 Type typeShr(Type, Type);
63 Type typeIncDec(IncDecOp, Type);
65 //////////////////////////////////////////////////////////////////////
68 * Op= operations on types, where "Op" is determined by a SetOpOp.
70 Type typeSetOp(SetOpOp, Type, Type);
72 //////////////////////////////////////////////////////////////////////
75 * Perform a Same or NSame on types.
77 Type typeSame(const Type&, const Type&);
78 Type typeNSame(const Type&, const Type&);
80 //////////////////////////////////////////////////////////////////////