fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 1 | /* |
fpizlo@apple.com | e799b86 | 2016-03-01 21:18:42 +0000 | [diff] [blame] | 2 | * Copyright (C) 2013-2016 Apple Inc. All rights reserved. |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 3 | * |
| 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.org | beb0de4 | 2014-02-17 19:00:03 +0000 | [diff] [blame] | 27 | #include "DFGUseKind.h" |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 28 | |
| 29 | #if ENABLE(DFG_JIT) |
| 30 | |
fpizlo@apple.com | fb7eff2 | 2014-02-11 01:45:50 +0000 | [diff] [blame] | 31 | #include "JSCInlines.h" |
fpizlo@apple.com | b426f86 | 2014-02-10 02:51:13 +0000 | [diff] [blame] | 32 | |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 33 | namespace WTF { |
| 34 | |
| 35 | using namespace JSC::DFG; |
| 36 | |
| 37 | void printInternal(PrintStream& out, UseKind useKind) |
| 38 | { |
| 39 | switch (useKind) { |
| 40 | case UntypedUse: |
| 41 | out.print("Untyped"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 42 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 43 | case Int32Use: |
| 44 | out.print("Int32"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 45 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 46 | case KnownInt32Use: |
| 47 | out.print("KnownInt32"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 48 | return; |
fpizlo@apple.com | 7b33e0c | 2014-04-15 20:26:16 +0000 | [diff] [blame] | 49 | case Int52RepUse: |
| 50 | out.print("Int52Rep"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 51 | return; |
mark.lam@apple.com | 39e9c98 | 2016-04-25 17:48:46 +0000 | [diff] [blame] | 52 | case AnyIntUse: |
| 53 | out.print("AnyInt"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 54 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 55 | case NumberUse: |
| 56 | out.print("Number"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 57 | return; |
fpizlo@apple.com | 318af07 | 2015-06-05 04:59:28 +0000 | [diff] [blame] | 58 | case RealNumberUse: |
| 59 | out.print("RealNumber"); |
| 60 | return; |
fpizlo@apple.com | 7b33e0c | 2014-04-15 20:26:16 +0000 | [diff] [blame] | 61 | case DoubleRepUse: |
| 62 | out.print("DoubleRep"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 63 | return; |
fpizlo@apple.com | 7b33e0c | 2014-04-15 20:26:16 +0000 | [diff] [blame] | 64 | case DoubleRepRealUse: |
| 65 | out.print("DoubleRepReal"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 66 | return; |
mark.lam@apple.com | 39e9c98 | 2016-04-25 17:48:46 +0000 | [diff] [blame] | 67 | case DoubleRepAnyIntUse: |
| 68 | out.print("DoubleRepAnyInt"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 69 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 70 | case BooleanUse: |
| 71 | out.print("Boolean"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 72 | return; |
fpizlo@apple.com | 7289af3 | 2015-08-21 03:59:33 +0000 | [diff] [blame] | 73 | case KnownBooleanUse: |
| 74 | out.print("KnownBoolean"); |
| 75 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 76 | case CellUse: |
| 77 | out.print("Cell"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 78 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 79 | case KnownCellUse: |
| 80 | out.print("KnownCell"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 81 | return; |
fpizlo@apple.com | 1283577 | 2015-09-21 20:49:04 +0000 | [diff] [blame] | 82 | case CellOrOtherUse: |
| 83 | out.print("CellOrOther"); |
| 84 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 85 | case ObjectUse: |
| 86 | out.print("Object"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 87 | return; |
utatane.tea@gmail.com | 0350d7d | 2016-09-16 21:17:33 +0000 | [diff] [blame] | 88 | case ArrayUse: |
| 89 | out.print("Array"); |
| 90 | return; |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 91 | case FunctionUse: |
| 92 | out.print("Function"); |
| 93 | return; |
fpizlo@apple.com | 0fa8386 | 2013-09-06 19:01:21 +0000 | [diff] [blame] | 94 | case FinalObjectUse: |
| 95 | out.print("FinalObject"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 96 | return; |
fpizlo@apple.com | e799b86 | 2016-03-01 21:18:42 +0000 | [diff] [blame] | 97 | case RegExpObjectUse: |
| 98 | out.print("RegExpObject"); |
| 99 | return; |
utatane.tea@gmail.com | 4a748b1 | 2016-09-17 06:32:50 +0000 | [diff] [blame] | 100 | case ProxyObjectUse: |
| 101 | out.print("ProxyObject"); |
| 102 | return; |
| 103 | case DerivedArrayUse: |
| 104 | out.print("DerivedArray"); |
| 105 | return; |
sbarati@apple.com | 21fc86e | 2016-09-06 23:22:01 +0000 | [diff] [blame] | 106 | case MapObjectUse: |
| 107 | out.print("MapObjectUse"); |
| 108 | return; |
| 109 | case SetObjectUse: |
| 110 | out.print("SetObjectUse"); |
| 111 | return; |
utatane.tea@gmail.com | 288e68f | 2017-09-13 07:02:13 +0000 | [diff] [blame] | 112 | case WeakMapObjectUse: |
| 113 | out.print("WeakMapObjectUse"); |
| 114 | return; |
| 115 | case WeakSetObjectUse: |
| 116 | out.print("WeakSetObjectUse"); |
| 117 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 118 | case ObjectOrOtherUse: |
| 119 | out.print("ObjectOrOther"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 120 | return; |
oliver@apple.com | bd15be8 | 2013-07-25 04:03:42 +0000 | [diff] [blame] | 121 | case StringIdentUse: |
| 122 | out.print("StringIdent"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 123 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 124 | case StringUse: |
| 125 | out.print("String"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 126 | return; |
fpizlo@apple.com | 9133174 | 2016-03-07 02:07:28 +0000 | [diff] [blame] | 127 | case StringOrOtherUse: |
| 128 | out.print("StringOrOther"); |
| 129 | return; |
fpizlo@apple.com | 0e6e154 | 2013-03-18 18:09:22 +0000 | [diff] [blame] | 130 | case KnownStringUse: |
| 131 | out.print("KnownString"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 132 | return; |
fpizlo@apple.com | 2b150e78 | 2015-08-27 23:59:57 +0000 | [diff] [blame] | 133 | case KnownPrimitiveUse: |
| 134 | out.print("KnownPrimitive"); |
| 135 | return; |
utatane.tea@gmail.com | fccd136 | 2015-08-11 22:02:09 +0000 | [diff] [blame] | 136 | case SymbolUse: |
| 137 | out.print("Symbol"); |
| 138 | return; |
ticaiolima@gmail.com | 29b84da | 2018-04-11 05:49:31 +0000 | [diff] [blame] | 139 | case BigIntUse: |
| 140 | out.print("BigInt"); |
| 141 | return; |
fpizlo@apple.com | 0e6e154 | 2013-03-18 18:09:22 +0000 | [diff] [blame] | 142 | case StringObjectUse: |
| 143 | out.print("StringObject"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 144 | return; |
fpizlo@apple.com | 0e6e154 | 2013-03-18 18:09:22 +0000 | [diff] [blame] | 145 | case StringOrStringObjectUse: |
| 146 | out.print("StringOrStringObject"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 147 | return; |
fpizlo@apple.com | 385a33a | 2014-03-18 20:53:07 +0000 | [diff] [blame] | 148 | case NotStringVarUse: |
| 149 | out.print("NotStringVar"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 150 | return; |
mark.lam@apple.com | 4a3a656 | 2017-11-12 15:34:23 +0000 | [diff] [blame] | 151 | case NotSymbolUse: |
| 152 | out.print("NotSymbol"); |
| 153 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 154 | case NotCellUse: |
| 155 | out.print("NotCell"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 156 | return; |
sbarati@apple.com | 3785549 | 2018-07-20 19:16:29 +0000 | [diff] [blame] | 157 | case KnownOtherUse: |
| 158 | out.print("KnownOther"); |
| 159 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 160 | case OtherUse: |
| 161 | out.print("Other"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 162 | return; |
fpizlo@apple.com | e079bb5 | 2014-03-05 07:41:03 +0000 | [diff] [blame] | 163 | case MiscUse: |
| 164 | out.print("Misc"); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 165 | return; |
| 166 | case LastUseKind: |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 167 | RELEASE_ASSERT_NOT_REACHED(); |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 168 | return; |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 169 | } |
fpizlo@apple.com | a398a56 | 2014-08-06 21:32:55 +0000 | [diff] [blame] | 170 | RELEASE_ASSERT_NOT_REACHED(); |
fpizlo@apple.com | 7a1964c | 2013-02-21 22:59:02 +0000 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | } // namespace WTF |
| 174 | |
| 175 | #endif // ENABLE(DFG_JIT) |
| 176 | |