fpizlo@apple.com | 12f0925 | 2017-05-18 17:46:38 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 Apple Inc. All rights reserved. |
| 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" |
| 27 | #include "Intrinsic.h" |
| 28 | |
| 29 | #include <wtf/PrintStream.h> |
| 30 | |
| 31 | namespace JSC { |
| 32 | |
| 33 | const char* intrinsicName(Intrinsic intrinsic) |
| 34 | { |
| 35 | switch (intrinsic) { |
| 36 | case NoIntrinsic: |
| 37 | return "NoIntrinsic"; |
| 38 | case AbsIntrinsic: |
| 39 | return "AbsIntrinsic"; |
| 40 | case ACosIntrinsic: |
| 41 | return "ACosIntrinsic"; |
| 42 | case ASinIntrinsic: |
| 43 | return "ASinIntrinsic"; |
| 44 | case ATanIntrinsic: |
| 45 | return "ATanIntrinsic"; |
| 46 | case ACoshIntrinsic: |
| 47 | return "ACoshIntrinsic"; |
| 48 | case ASinhIntrinsic: |
| 49 | return "ASinhIntrinsic"; |
| 50 | case ATanhIntrinsic: |
| 51 | return "ATanhIntrinsic"; |
| 52 | case MinIntrinsic: |
| 53 | return "MinIntrinsic"; |
| 54 | case MaxIntrinsic: |
| 55 | return "MaxIntrinsic"; |
| 56 | case SqrtIntrinsic: |
| 57 | return "SqrtIntrinsic"; |
| 58 | case SinIntrinsic: |
| 59 | return "SinIntrinsic"; |
| 60 | case CbrtIntrinsic: |
| 61 | return "CbrtIntrinsic"; |
| 62 | case Clz32Intrinsic: |
| 63 | return "Clz32Intrinsic"; |
| 64 | case CosIntrinsic: |
| 65 | return "CosIntrinsic"; |
| 66 | case TanIntrinsic: |
| 67 | return "TanIntrinsic"; |
| 68 | case CoshIntrinsic: |
| 69 | return "CoshIntrinsic"; |
| 70 | case SinhIntrinsic: |
| 71 | return "SinhIntrinsic"; |
| 72 | case TanhIntrinsic: |
| 73 | return "TanhIntrinsic"; |
utatane.tea@gmail.com | 8dae608 | 2017-06-12 03:58:23 +0000 | [diff] [blame] | 74 | case ArrayIndexOfIntrinsic: |
| 75 | return "ArrayIndexOfIntrinsic"; |
fpizlo@apple.com | 12f0925 | 2017-05-18 17:46:38 +0000 | [diff] [blame] | 76 | case ArrayPushIntrinsic: |
| 77 | return "ArrayPushIntrinsic"; |
| 78 | case ArrayPopIntrinsic: |
| 79 | return "ArrayPopIntrinsic"; |
| 80 | case ArraySliceIntrinsic: |
| 81 | return "ArraySliceIntrinsic"; |
| 82 | case CharCodeAtIntrinsic: |
| 83 | return "CharCodeAtIntrinsic"; |
| 84 | case CharAtIntrinsic: |
| 85 | return "CharAtIntrinsic"; |
| 86 | case FromCharCodeIntrinsic: |
| 87 | return "FromCharCodeIntrinsic"; |
| 88 | case PowIntrinsic: |
| 89 | return "PowIntrinsic"; |
| 90 | case FloorIntrinsic: |
| 91 | return "FloorIntrinsic"; |
| 92 | case CeilIntrinsic: |
| 93 | return "CeilIntrinsic"; |
| 94 | case RoundIntrinsic: |
| 95 | return "RoundIntrinsic"; |
| 96 | case ExpIntrinsic: |
| 97 | return "ExpIntrinsic"; |
| 98 | case Expm1Intrinsic: |
| 99 | return "Expm1Intrinsic"; |
| 100 | case LogIntrinsic: |
| 101 | return "LogIntrinsic"; |
| 102 | case Log10Intrinsic: |
| 103 | return "Log10Intrinsic"; |
| 104 | case Log1pIntrinsic: |
| 105 | return "Log1pIntrinsic"; |
| 106 | case Log2Intrinsic: |
| 107 | return "Log2Intrinsic"; |
| 108 | case RegExpExecIntrinsic: |
| 109 | return "RegExpExecIntrinsic"; |
| 110 | case RegExpTestIntrinsic: |
| 111 | return "RegExpTestIntrinsic"; |
| 112 | case RegExpTestFastIntrinsic: |
| 113 | return "RegExpTestFastIntrinsic"; |
| 114 | case StringPrototypeValueOfIntrinsic: |
| 115 | return "StringPrototypeValueOfIntrinsic"; |
| 116 | case StringPrototypeReplaceIntrinsic: |
| 117 | return "StringPrototypeReplaceIntrinsic"; |
| 118 | case StringPrototypeReplaceRegExpIntrinsic: |
| 119 | return "StringPrototypeReplaceRegExpIntrinsic"; |
| 120 | case StringPrototypeToLowerCaseIntrinsic: |
| 121 | return "StringPrototypeToLowerCaseIntrinsic"; |
| 122 | case NumberPrototypeToStringIntrinsic: |
| 123 | return "NumberPrototypeToStringIntrinsic"; |
| 124 | case IMulIntrinsic: |
| 125 | return "IMulIntrinsic"; |
| 126 | case RandomIntrinsic: |
| 127 | return "RandomIntrinsic"; |
| 128 | case FRoundIntrinsic: |
| 129 | return "FRoundIntrinsic"; |
| 130 | case TruncIntrinsic: |
| 131 | return "TruncIntrinsic"; |
| 132 | case IsTypedArrayViewIntrinsic: |
| 133 | return "IsTypedArrayViewIntrinsic"; |
| 134 | case BoundThisNoArgsFunctionCallIntrinsic: |
| 135 | return "BoundThisNoArgsFunctionCallIntrinsic"; |
| 136 | case JSMapGetIntrinsic: |
| 137 | return "JSMapGetIntrinsic"; |
| 138 | case JSMapHasIntrinsic: |
| 139 | return "JSMapHasIntrinsic"; |
| 140 | case JSSetHasIntrinsic: |
| 141 | return "JSSetHasIntrinsic"; |
| 142 | case HasOwnPropertyIntrinsic: |
| 143 | return "HasOwnPropertyIntrinsic"; |
| 144 | case AtomicsAddIntrinsic: |
| 145 | return "AtomicsAddIntrinsic"; |
| 146 | case AtomicsAndIntrinsic: |
| 147 | return "AtomicsAndIntrinsic"; |
| 148 | case AtomicsCompareExchangeIntrinsic: |
| 149 | return "AtomicsCompareExchangeIntrinsic"; |
| 150 | case AtomicsExchangeIntrinsic: |
| 151 | return "AtomicsExchangeIntrinsic"; |
| 152 | case AtomicsIsLockFreeIntrinsic: |
| 153 | return "AtomicsIsLockFreeIntrinsic"; |
| 154 | case AtomicsLoadIntrinsic: |
| 155 | return "AtomicsLoadIntrinsic"; |
| 156 | case AtomicsOrIntrinsic: |
| 157 | return "AtomicsOrIntrinsic"; |
| 158 | case AtomicsStoreIntrinsic: |
| 159 | return "AtomicsStoreIntrinsic"; |
| 160 | case AtomicsSubIntrinsic: |
| 161 | return "AtomicsSubIntrinsic"; |
| 162 | case AtomicsWaitIntrinsic: |
| 163 | return "AtomicsWaitIntrinsic"; |
| 164 | case AtomicsWakeIntrinsic: |
| 165 | return "AtomicsWakeIntrinsic"; |
| 166 | case AtomicsXorIntrinsic: |
| 167 | return "AtomicsXorIntrinsic"; |
| 168 | case ParseIntIntrinsic: |
| 169 | return "ParseIntIntrinsic"; |
| 170 | case TypedArrayLengthIntrinsic: |
| 171 | return "TypedArrayLengthIntrinsic"; |
| 172 | case TypedArrayByteLengthIntrinsic: |
| 173 | return "TypedArrayByteLengthIntrinsic"; |
| 174 | case TypedArrayByteOffsetIntrinsic: |
| 175 | return "TypedArrayByteOffsetIntrinsic"; |
| 176 | case DFGTrueIntrinsic: |
| 177 | return "DFGTrueIntrinsic"; |
| 178 | case OSRExitIntrinsic: |
| 179 | return "OSRExitIntrinsic"; |
| 180 | case IsFinalTierIntrinsic: |
| 181 | return "IsFinalTierIntrinsic"; |
| 182 | case SetInt32HeapPredictionIntrinsic: |
| 183 | return "SetInt32HeapPredictionIntrinsic"; |
| 184 | case CheckInt32Intrinsic: |
| 185 | return "CheckInt32Intrinsic"; |
| 186 | case FiatInt52Intrinsic: |
| 187 | return "FiatInt52Intrinsic"; |
| 188 | } |
| 189 | RELEASE_ASSERT_NOT_REACHED(); |
| 190 | return nullptr; |
| 191 | } |
| 192 | |
| 193 | } // namespace JSC |
| 194 | |
| 195 | namespace WTF { |
| 196 | |
| 197 | void printInternal(PrintStream& out, JSC::Intrinsic intrinsic) |
| 198 | { |
| 199 | out.print(JSC::intrinsicName(intrinsic)); |
| 200 | } |
| 201 | |
| 202 | } // namespace WTF |
| 203 | |