blob: c56429c6ae924f26b58aeb1237dc311494baf598 [file] [log] [blame]
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +00001/*
fpizlo@apple.come799b862016-03-01 21:18:42 +00002 * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +00003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include "config.h"
ossy@webkit.orgbeb0de42014-02-17 19:00:03 +000027#include "DFGUseKind.h"
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +000028
29#if ENABLE(DFG_JIT)
30
fpizlo@apple.comfb7eff22014-02-11 01:45:50 +000031#include "JSCInlines.h"
fpizlo@apple.comb426f862014-02-10 02:51:13 +000032
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +000033namespace WTF {
34
35using namespace JSC::DFG;
36
37void printInternal(PrintStream& out, UseKind useKind)
38{
39 switch (useKind) {
40 case UntypedUse:
41 out.print("Untyped");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000042 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +000043 case Int32Use:
44 out.print("Int32");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000045 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +000046 case KnownInt32Use:
47 out.print("KnownInt32");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000048 return;
fpizlo@apple.com7b33e0c2014-04-15 20:26:16 +000049 case Int52RepUse:
50 out.print("Int52Rep");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000051 return;
mark.lam@apple.com39e9c982016-04-25 17:48:46 +000052 case AnyIntUse:
53 out.print("AnyInt");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000054 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +000055 case NumberUse:
56 out.print("Number");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000057 return;
fpizlo@apple.com318af072015-06-05 04:59:28 +000058 case RealNumberUse:
59 out.print("RealNumber");
60 return;
fpizlo@apple.com7b33e0c2014-04-15 20:26:16 +000061 case DoubleRepUse:
62 out.print("DoubleRep");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000063 return;
fpizlo@apple.com7b33e0c2014-04-15 20:26:16 +000064 case DoubleRepRealUse:
65 out.print("DoubleRepReal");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000066 return;
mark.lam@apple.com39e9c982016-04-25 17:48:46 +000067 case DoubleRepAnyIntUse:
68 out.print("DoubleRepAnyInt");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000069 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +000070 case BooleanUse:
71 out.print("Boolean");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000072 return;
fpizlo@apple.com7289af32015-08-21 03:59:33 +000073 case KnownBooleanUse:
74 out.print("KnownBoolean");
75 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +000076 case CellUse:
77 out.print("Cell");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000078 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +000079 case KnownCellUse:
80 out.print("KnownCell");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000081 return;
fpizlo@apple.com12835772015-09-21 20:49:04 +000082 case CellOrOtherUse:
83 out.print("CellOrOther");
84 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +000085 case ObjectUse:
86 out.print("Object");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000087 return;
utatane.tea@gmail.com0350d7d2016-09-16 21:17:33 +000088 case ArrayUse:
89 out.print("Array");
90 return;
fpizlo@apple.coma398a562014-08-06 21:32:55 +000091 case FunctionUse:
92 out.print("Function");
93 return;
fpizlo@apple.com0fa83862013-09-06 19:01:21 +000094 case FinalObjectUse:
95 out.print("FinalObject");
fpizlo@apple.coma398a562014-08-06 21:32:55 +000096 return;
fpizlo@apple.come799b862016-03-01 21:18:42 +000097 case RegExpObjectUse:
98 out.print("RegExpObject");
99 return;
utatane.tea@gmail.com4a748b12016-09-17 06:32:50 +0000100 case ProxyObjectUse:
101 out.print("ProxyObject");
102 return;
103 case DerivedArrayUse:
104 out.print("DerivedArray");
105 return;
sbarati@apple.com21fc86e2016-09-06 23:22:01 +0000106 case MapObjectUse:
107 out.print("MapObjectUse");
108 return;
109 case SetObjectUse:
110 out.print("SetObjectUse");
111 return;
utatane.tea@gmail.com288e68f2017-09-13 07:02:13 +0000112 case WeakMapObjectUse:
113 out.print("WeakMapObjectUse");
114 return;
115 case WeakSetObjectUse:
116 out.print("WeakSetObjectUse");
117 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +0000118 case ObjectOrOtherUse:
119 out.print("ObjectOrOther");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000120 return;
oliver@apple.combd15be82013-07-25 04:03:42 +0000121 case StringIdentUse:
122 out.print("StringIdent");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000123 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +0000124 case StringUse:
125 out.print("String");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000126 return;
fpizlo@apple.com91331742016-03-07 02:07:28 +0000127 case StringOrOtherUse:
128 out.print("StringOrOther");
129 return;
fpizlo@apple.com0e6e1542013-03-18 18:09:22 +0000130 case KnownStringUse:
131 out.print("KnownString");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000132 return;
fpizlo@apple.com2b150e782015-08-27 23:59:57 +0000133 case KnownPrimitiveUse:
134 out.print("KnownPrimitive");
135 return;
utatane.tea@gmail.comfccd1362015-08-11 22:02:09 +0000136 case SymbolUse:
137 out.print("Symbol");
138 return;
ticaiolima@gmail.com29b84da2018-04-11 05:49:31 +0000139 case BigIntUse:
140 out.print("BigInt");
141 return;
fpizlo@apple.com0e6e1542013-03-18 18:09:22 +0000142 case StringObjectUse:
143 out.print("StringObject");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000144 return;
fpizlo@apple.com0e6e1542013-03-18 18:09:22 +0000145 case StringOrStringObjectUse:
146 out.print("StringOrStringObject");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000147 return;
fpizlo@apple.com385a33a2014-03-18 20:53:07 +0000148 case NotStringVarUse:
149 out.print("NotStringVar");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000150 return;
mark.lam@apple.com4a3a6562017-11-12 15:34:23 +0000151 case NotSymbolUse:
152 out.print("NotSymbol");
153 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +0000154 case NotCellUse:
155 out.print("NotCell");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000156 return;
sbarati@apple.com37855492018-07-20 19:16:29 +0000157 case KnownOtherUse:
158 out.print("KnownOther");
159 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +0000160 case OtherUse:
161 out.print("Other");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000162 return;
fpizlo@apple.come079bb52014-03-05 07:41:03 +0000163 case MiscUse:
164 out.print("Misc");
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000165 return;
166 case LastUseKind:
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +0000167 RELEASE_ASSERT_NOT_REACHED();
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000168 return;
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +0000169 }
fpizlo@apple.coma398a562014-08-06 21:32:55 +0000170 RELEASE_ASSERT_NOT_REACHED();
fpizlo@apple.com7a1964c2013-02-21 22:59:02 +0000171}
172
173} // namespace WTF
174
175#endif // ENABLE(DFG_JIT)
176