| 1 | /* |
| 2 | * Copyright (C) 1999-2000 Harri Porten ([email protected]) |
| 3 | * Copyright (C) 2002, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Library General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Library General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Library General Public License |
| 16 | * along with this library; see the file COPYING.LIB. If not, write to |
| 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | * Boston, MA 02110-1301, USA. |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | #ifndef Operations_h |
| 23 | #define Operations_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/runtime/Operations.h:23:9`! |
| 24 | |
| 25 | #include "Interpreter.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/Interpreter.h`/ |
| 26 | #include "JSImmediate.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSImmediate.h`/ |
| 27 | #include "JSNumberCell.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSNumberCell.h`/ |
| 28 | #include "JSString.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSString.h`/ |
| 29 | |
| 30 | namespace JSCcxx . . $ QTJSC/ { |
| 31 | |
| 32 | NEVER_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:35:9`! JSValuecxx . . $ QTJSC/JSValue# throwOutOfMemoryErrorcxx . . $ QTJSC/throwOutOfMemoryError(3fbe51058e39576a).(ExecStatecxx . . $ QTJSC/ExecState#*); |
| 33 | NEVER_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:35:9`! JSValuecxx . . $ QTJSC/JSValue# jsAddSlowCasecxx . . $ QTJSC/jsAddSlowCase(b8fa476a5be1c821).(CallFramecxx . . $ QTJSC/CallFrame#*, JSValuecxx . . $ QTJSC/JSValue#, JSValuecxx . . $ QTJSC/JSValue#); |
| 34 | JSValuecxx . . $ QTJSC/JSValue# jsTypeStringForValuecxx . . $ QTJSC/jsTypeStringForValue(3f1194ef29991aa4).(CallFramecxx . . $ QTJSC/CallFrame#*, JSValuecxx . . $ QTJSC/JSValue#); |
| 35 | bool jsIsObjectTypecxx . . $ QTJSC/jsIsObjectType(a6f765323ba532ee).(JSValuecxx . . $ QTJSC/JSValue#); |
| 36 | bool jsIsFunctionTypecxx . . $ QTJSC/jsIsFunctionType(a6f765323ba532ee).(JSValuecxx . . $ QTJSC/JSValue#); |
| 37 | |
| 38 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! JSValuecxx . . $ QTJSC/JSValue# jsStringcxx . . $ QTJSC/jsString(1d20702c49229e34).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSStringcxx . . $ QTJSC/JSString#* s1, JSStringcxx . . $ QTJSC/JSString#* s2) |
| 39 | { |
| 40 | if (!s1->lengthcxx . . $ QTJSC/JSString#length(db52760e79bf9054).()) |
| 41 | return s2; |
| 42 | if (!s2->lengthcxx . . $ QTJSC/JSString#length(db52760e79bf9054).()) |
| 43 | return s1; |
| 44 | |
| 45 | unsigned ropeLength = s1->ropeLengthcxx . . $ QTJSC/JSString#ropeLength(db52760e79bf9054).() + s2->ropeLengthcxx . . $ QTJSC/JSString#ropeLength(db52760e79bf9054).(); |
| 46 | JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData = &exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(); |
| 47 | |
| 48 | if (ropeLength <= JSStringcxx . . $ QTJSC/JSString#::s_maxInternalRopeLengthcxx . . $ QTJSC/JSString#s_maxInternalRopeLength.) |
| 49 | return new (globalData) JSStringcxx . . $ QTJSC/JSString#JSString(961e17bfe8de9f44).(globalData, ropeLength, s1, s2); |
| 50 | |
| 51 | unsigned index = 0; |
| 52 | RefPtrcxx . . $ RefPtr#<JSStringcxx . . $ QTJSC/JSString#::Ropecxx . . $ QTJSC/JSString#Rope#> rope = JSString::Rope::createOrNull(ropeLength); |
| 53 | if (UNLIKELYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:45:9`!(!rope)) |
| 54 | return throwOutOfMemoryErrorcxx . . $ QTJSC/throwOutOfMemoryError(3fbe51058e39576a).(exec); |
| 55 | rope->append(index, s1); |
| 56 | rope->append(index, s2); |
| 57 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(index == ropeLength); |
| 58 | return new (globalData) JSStringcxx . . $ QTJSC/JSString#(globalData, rope.release()); |
| 59 | } |
| 60 | |
| 61 | ALWAYS_INLINEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! JSValuecxx . . $ QTJSC/JSValue# jsStringcxx . . $ QTJSC/jsString(7bff5709425c3996).(ExecStatecxx . . $ QTJSC/ExecState#* exec, const UStringcxx . . $ QTJSC/UString#& u1, JSStringcxx . . $ QTJSC/JSString#* s2) |
| 62 | { |
| 63 | unsigned ropeLength = 1 + s2->ropeLengthcxx . . $ QTJSC/JSString#ropeLength(db52760e79bf9054).(); |
| 64 | JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData = &exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(); |
| 65 | |
| 66 | if (ropeLength <= JSStringcxx . . $ QTJSC/JSString#::s_maxInternalRopeLengthcxx . . $ QTJSC/JSString#s_maxInternalRopeLength.) |
| 67 | return new (globalData) JSStringcxx . . $ QTJSC/JSString#JSString(b609f62cc492a36e).(globalData, ropeLength, u1, s2); |
| 68 | |
| 69 | unsigned index = 0; |
| 70 | RefPtrcxx . . $ RefPtr#<JSStringcxx . . $ QTJSC/JSString#::Ropecxx . . $ QTJSC/JSString#Rope#> rope = JSString::Rope::createOrNull(ropeLength); |
| 71 | if (UNLIKELYcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:45:9`!(!rope)) |
| 72 | return throwOutOfMemoryErrorcxx . . $ QTJSC/throwOutOfMemoryError(3fbe51058e39576a).(exec); |
| 73 | rope->append(index, u1); |
| 74 | rope->append(index, s2); |
| 75 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(index == ropeLength); |
| 76 | return new (globalData) JSStringcxx . . $ QTJSC/JSString#(globalData, rope.release()); |
| 77 | } |
| 78 | |
| 79 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! JSValuecxx . . $ QTJSC/JSValue# jsStringcxx . . $ QTJSC/jsString(d78052f683f48fad).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSStringcxx . . $ QTJSC/JSString#* s1, const UStringcxx . . $ QTJSC/UString#& u2) |
| 80 | { |
| 81 | unsigned ropeLength = s1->ropeLengthcxx . . $ QTJSC/JSString#ropeLength(db52760e79bf9054).() + 1; |
| 82 | JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData = &exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(); |
| 83 | |
| 84 | if (ropeLength <= JSStringcxx . . $ QTJSC/JSString#::s_maxInternalRopeLengthcxx . . $ QTJSC/JSString#s_maxInternalRopeLength.) |
| 85 | return new (globalData) JSStringcxx . . $ QTJSC/JSString#JSString(1d49a2fa9e13bc5b).(globalData, ropeLength, s1, u2); |
| 86 | |
| 87 | unsigned index = 0; |
| 88 | RefPtrcxx . . $ RefPtr#<JSStringcxx . . $ QTJSC/JSString#::Ropecxx . . $ QTJSC/JSString#Rope#> rope = JSString::Rope::createOrNull(ropeLength); |
| 89 | if (UNLIKELYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:45:9`!(!rope)) |
| 90 | return throwOutOfMemoryErrorcxx . . $ QTJSC/throwOutOfMemoryError(3fbe51058e39576a).(exec); |
| 91 | rope->append(index, s1); |
| 92 | rope->append(index, u2); |
| 93 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(index == ropeLength); |
| 94 | return new (globalData) JSStringcxx . . $ QTJSC/JSString#(globalData, rope.release()); |
| 95 | } |
| 96 | |
| 97 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! JSValuecxx . . $ QTJSC/JSValue# jsStringcxx . . $ QTJSC/jsString(6a1e182a4f5bfc39).(ExecStatecxx . . $ QTJSC/ExecState#* exec, Registercxx . . $ QTJSC/Register#* strings, unsigned count) |
| 98 | { |
| 99 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(count >= 3); |
| 100 | |
| 101 | unsigned ropeLength = 0; |
| 102 | for (unsigned i = 0; i < count; ++i) { |
| 103 | JSValuecxx . . $ QTJSC/JSValue# v = strings[i].jsValuecxx . . $ QTJSC/Register#jsValue(888c053acf364da1).(); |
| 104 | if (LIKELYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:53:9`!(v.isString())) |
| 105 | ropeLength += asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v)->ropeLengthcxx . . $ QTJSC/JSString#ropeLength(db52760e79bf9054).(); |
| 106 | else |
| 107 | ++ropeLength; |
| 108 | } |
| 109 | |
| 110 | JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData = &exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(); |
| 111 | if (ropeLength == 3) |
| 112 | return new (globalData) JSStringcxx . . $ QTJSC/JSString#JSString(85610a7c4b5e746).(exec, strings[0].jsValuecxx . . $ QTJSC/Register#jsValue(888c053acf364da1).(), strings[1].jsValuecxx . . $ QTJSC/Register#jsValue(888c053acf364da1).(), strings[2].jsValuecxx . . $ QTJSC/Register#jsValue(888c053acf364da1).()); |
| 113 | |
| 114 | RefPtrcxx . . $ RefPtr#<JSStringcxx . . $ QTJSC/JSString#::Ropecxx . . $ QTJSC/JSString#Rope#> rope = JSString::Rope::createOrNull(ropeLength); |
| 115 | if (UNLIKELYcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:45:9`!(!rope)) |
| 116 | return throwOutOfMemoryErrorcxx . . $ QTJSC/throwOutOfMemoryError(3fbe51058e39576a).(exec); |
| 117 | |
| 118 | unsigned index = 0; |
| 119 | for (unsigned i = 0; i < count; ++i) { |
| 120 | JSValuecxx . . $ QTJSC/JSValue# v = strings[i].jsValuecxx . . $ QTJSC/Register#jsValue(888c053acf364da1).(); |
| 121 | if (LIKELYcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:53:9`!(v.isString())) |
| 122 | rope->append(index, asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v)); |
| 123 | else |
| 124 | rope->append(index, v.toStringcxx . . $ QTJSC/JSValue#toString(9c94f5abb1995042).(exec)); |
| 125 | } |
| 126 | |
| 127 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(index == ropeLength); |
| 128 | return new (globalData) JSStringcxx . . $ QTJSC/JSString#(globalData, rope.release()); |
| 129 | } |
| 130 | |
| 131 | ALWAYS_INLINEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! JSValuecxx . . $ QTJSC/JSValue# jsStringcxx . . $ QTJSC/jsString(a346bc844d0fe1c2).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# thisValue, const ArgListcxx . . $ QTJSC/ArgList#& args) |
| 132 | { |
| 133 | unsigned ropeLength = 0; |
| 134 | if (LIKELYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:53:9`!(thisValue.isString())) |
| 135 | ropeLength += asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(thisValue)->ropeLengthcxx . . $ QTJSC/JSString#ropeLength(db52760e79bf9054).(); |
| 136 | else |
| 137 | ++ropeLength; |
| 138 | for (unsigned i = 0; i < args.sizecxx . . $ QTJSC/ArgList#size(fe4d2d262d4164a8).(); ++i) { |
| 139 | JSValuecxx . . $ QTJSC/JSValue# v = args.atcxx . . $ QTJSC/ArgList#at(e9dec2041b7a6b55).(i); |
| 140 | if (LIKELYcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:53:9`!(v.isString())) |
| 141 | ropeLength += asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v)->ropeLengthcxx . . $ QTJSC/JSString#ropeLength(db52760e79bf9054).(); |
| 142 | else |
| 143 | ++ropeLength; |
| 144 | } |
| 145 | |
| 146 | RefPtrcxx . . $ RefPtr#<JSStringcxx . . $ QTJSC/JSString#::Ropecxx . . $ QTJSC/JSString#Rope#> rope = JSString::Rope::createOrNull(ropeLength); |
| 147 | if (UNLIKELYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:45:9`!(!rope)) |
| 148 | return throwOutOfMemoryErrorcxx . . $ QTJSC/throwOutOfMemoryError(3fbe51058e39576a).(exec); |
| 149 | |
| 150 | unsigned index = 0; |
| 151 | if (LIKELYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:53:9`!(thisValue.isString())) |
| 152 | rope->append(index, asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(thisValue)); |
| 153 | else |
| 154 | rope->append(index, thisValue.toStringcxx . . $ QTJSC/JSValue#toString(9c94f5abb1995042).(exec)); |
| 155 | for (unsigned i = 0; i < args.sizecxx . . $ QTJSC/ArgList#size(fe4d2d262d4164a8).(); ++i) { |
| 156 | JSValuecxx . . $ QTJSC/JSValue# v = args.atcxx . . $ QTJSC/ArgList#at(e9dec2041b7a6b55).(i); |
| 157 | if (LIKELYcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:53:9`!(v.isString())) |
| 158 | rope->append(index, asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v)); |
| 159 | else |
| 160 | rope->append(index, v.toStringcxx . . $ QTJSC/JSValue#toString(9c94f5abb1995042).(exec)); |
| 161 | } |
| 162 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(index == ropeLength); |
| 163 | |
| 164 | JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData = &exec->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(); |
| 165 | return new (globalData) JSStringcxx . . $ QTJSC/JSString#(globalData, rope.release()); |
| 166 | } |
| 167 | |
| 168 | // ECMA 11.9.3 |
| 169 | inline bool JSValuecxx . . $ QTJSC/JSValue#::equalcxx . . $ QTJSC/JSValue#equal(658e1865c47113e6).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# v1, JSValuecxx . . $ QTJSC/JSValue# v2) |
| 170 | { |
| 171 | if (v1.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).() && v2.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) |
| 172 | return v1 ==cxx . . $ QTJSC/JSValue#`operator==`(b7c0ea8ebb120a64). v2; |
| 173 | |
| 174 | return equalSlowCasecxx . . $ QTJSC/JSValue#equalSlowCase(658e1865c47113e6).(exec, v1, v2); |
| 175 | } |
| 176 | |
| 177 | ALWAYS_INLINEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! bool JSValuecxx . . $ QTJSC/JSValue#::equalSlowCaseInlinecxx . . $ QTJSC/JSValue#equalSlowCaseInline(658e1865c47113e6).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# v1, JSValuecxx . . $ QTJSC/JSValue# v2) |
| 178 | { |
| 179 | do { |
| 180 | if (v1.isNumbercxx . . $ QTJSC/JSValue#isNumber(50ce9a9e25b4a850).() && v2.isNumbercxx . . $ QTJSC/JSValue#isNumber(50ce9a9e25b4a850).()) |
| 181 | return v1.uncheckedGetNumbercxx . . $ QTJSC/JSValue#uncheckedGetNumber(21b6c25e127938e2).() == v2.uncheckedGetNumbercxx . . $ QTJSC/JSValue#uncheckedGetNumber(21b6c25e127938e2).(); |
| 182 | |
| 183 | bool s1 = v1.isStringcxx . . $ QTJSC/JSValue#isString(50ce9a9e25b4a850).(); |
| 184 | bool s2 = v2.isStringcxx . . $ QTJSC/JSValue#isString(50ce9a9e25b4a850).(); |
| 185 | if (s1 && s2) |
| 186 | return asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v1)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(exec) ==cxx . . $ QTJSC/`operator==`(11610d830df66bbf). asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v2)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(exec); |
| 187 | |
| 188 | if (v1.isUndefinedOrNullcxx . . $ QTJSC/JSValue#isUndefinedOrNull(50ce9a9e25b4a850).()) { |
| 189 | if (v2.isUndefinedOrNullcxx . . $ QTJSC/JSValue#isUndefinedOrNull(50ce9a9e25b4a850).()) |
| 190 | return true; |
| 191 | if (!v2.isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).()) |
| 192 | return false; |
| 193 | return v2.asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).()->typeInfocxx . . $ QTJSC/Structure#typeInfo(2e356ef879c79f0c).().masqueradesAsUndefinedcxx . . $ QTJSC/TypeInfo#masqueradesAsUndefined(50ce9a9e25b4a850).(); |
| 194 | } |
| 195 | |
| 196 | if (v2.isUndefinedOrNullcxx . . $ QTJSC/JSValue#isUndefinedOrNull(50ce9a9e25b4a850).()) { |
| 197 | if (!v1.isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).()) |
| 198 | return false; |
| 199 | return v1.asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).()->typeInfocxx . . $ QTJSC/Structure#typeInfo(2e356ef879c79f0c).().masqueradesAsUndefinedcxx . . $ QTJSC/TypeInfo#masqueradesAsUndefined(50ce9a9e25b4a850).(); |
| 200 | } |
| 201 | |
| 202 | if (v1.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) { |
| 203 | if (v2.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) |
| 204 | return v1 ==cxx . . $ QTJSC/JSValue#`operator==`(b7c0ea8ebb120a64). v2 |
| 205 | #ifdef QT_BUILD_SCRIPT_LIBcxx . . $ `<built-in>:481:9`! |
| 206 | || asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(v1)->compareToObjectcxx . . $ QTJSC/JSObject#compareToObject(19ab3577b45d1e70).(exec, asObjectcxx . . $ QTJSC/asObject(107e81180f8dd622).(v2)) |
| 207 | #endif |
| 208 | ; |
| 209 | JSValuecxx . . $ QTJSC/JSValue# p1 = v1.toPrimitivecxx . . $ QTJSC/JSValue#toPrimitive(9c1c7f5535dadf1e).(exec); |
| 210 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 211 | return false; |
| 212 | v1 =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). p1; |
| 213 | if (v1.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).() && v2.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) |
| 214 | return v1 ==cxx . . $ QTJSC/JSValue#`operator==`(b7c0ea8ebb120a64). v2; |
| 215 | continue; |
| 216 | } |
| 217 | |
| 218 | if (v2.isObjectcxx . . $ QTJSC/JSValue#isObject(50ce9a9e25b4a850).()) { |
| 219 | JSValuecxx . . $ QTJSC/JSValue# p2 = v2.toPrimitivecxx . . $ QTJSC/JSValue#toPrimitive(9c1c7f5535dadf1e).(exec); |
| 220 | if (exec->hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).()) |
| 221 | return false; |
| 222 | v2 =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). p2; |
| 223 | if (v1.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).() && v2.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) |
| 224 | return v1 ==cxx . . $ QTJSC/JSValue#`operator==`(b7c0ea8ebb120a64). v2; |
| 225 | continue; |
| 226 | } |
| 227 | |
| 228 | if (s1 || s2) { |
| 229 | double d1 = v1.toNumbercxx . . $ QTJSC/JSValue#toNumber(1fd034e372fd1279).(exec); |
| 230 | double d2 = v2.toNumbercxx . . $ QTJSC/JSValue#toNumber(1fd034e372fd1279).(exec); |
| 231 | return d1 == d2; |
| 232 | } |
| 233 | |
| 234 | if (v1.isBooleancxx . . $ QTJSC/JSValue#isBoolean(50ce9a9e25b4a850).()) { |
| 235 | if (v2.isNumbercxx . . $ QTJSC/JSValue#isNumber(50ce9a9e25b4a850).()) |
| 236 | return static_cast<double>(v1.getBooleancxx . . $ QTJSC/JSValue#getBoolean(50ce9a9e25b4a850).()) == v2.uncheckedGetNumbercxx . . $ QTJSC/JSValue#uncheckedGetNumber(21b6c25e127938e2).(); |
| 237 | } else if (v2.isBooleancxx . . $ QTJSC/JSValue#isBoolean(50ce9a9e25b4a850).()) { |
| 238 | if (v1.isNumbercxx . . $ QTJSC/JSValue#isNumber(50ce9a9e25b4a850).()) |
| 239 | return v1.uncheckedGetNumbercxx . . $ QTJSC/JSValue#uncheckedGetNumber(21b6c25e127938e2).() == static_cast<double>(v2.getBooleancxx . . $ QTJSC/JSValue#getBoolean(50ce9a9e25b4a850).()); |
| 240 | } |
| 241 | |
| 242 | return v1 ==cxx . . $ QTJSC/JSValue#`operator==`(b7c0ea8ebb120a64). v2; |
| 243 | } while (true); |
| 244 | } |
| 245 | |
| 246 | // ECMA 11.9.3 |
| 247 | ALWAYS_INLINEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! bool JSValuecxx . . $ QTJSC/JSValue#::strictEqualSlowCaseInlinecxx . . $ QTJSC/JSValue#strictEqualSlowCaseInline(658e1865c47113e6).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# v1, JSValuecxx . . $ QTJSC/JSValue# v2) |
| 248 | { |
| 249 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(v1.isCell() && v2.isCell()); |
| 250 | |
| 251 | if (v1.asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->isStringcxx . . $ QTJSC/JSCell#isString(50ce9a9e25b4a850).() && v2.asCellcxx . . $ QTJSC/JSValue#asCell(60510463d9a84528).()->isStringcxx . . $ QTJSC/JSCell#isString(50ce9a9e25b4a850).()) |
| 252 | return asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v1)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(exec) ==cxx . . $ QTJSC/`operator==`(11610d830df66bbf). asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v2)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(exec); |
| 253 | |
| 254 | return v1 ==cxx . . $ QTJSC/JSValue#`operator==`(b7c0ea8ebb120a64). v2; |
| 255 | } |
| 256 | |
| 257 | inline bool JSValuecxx . . $ QTJSC/JSValue#::strictEqualcxx . . $ QTJSC/JSValue#strictEqual(658e1865c47113e6).(ExecStatecxx . . $ QTJSC/ExecState#* exec, JSValuecxx . . $ QTJSC/JSValue# v1, JSValuecxx . . $ QTJSC/JSValue# v2) |
| 258 | { |
| 259 | if (v1.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).() && v2.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) |
| 260 | return v1 ==cxx . . $ QTJSC/JSValue#`operator==`(b7c0ea8ebb120a64). v2; |
| 261 | |
| 262 | if (v1.isNumbercxx . . $ QTJSC/JSValue#isNumber(50ce9a9e25b4a850).() && v2.isNumbercxx . . $ QTJSC/JSValue#isNumber(50ce9a9e25b4a850).()) |
| 263 | return v1.uncheckedGetNumbercxx . . $ QTJSC/JSValue#uncheckedGetNumber(21b6c25e127938e2).() == v2.uncheckedGetNumbercxx . . $ QTJSC/JSValue#uncheckedGetNumber(21b6c25e127938e2).(); |
| 264 | |
| 265 | if (!v1.isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).() || !v2.isCellcxx . . $ QTJSC/JSValue#isCell(50ce9a9e25b4a850).()) |
| 266 | return v1 ==cxx . . $ QTJSC/JSValue#`operator==`(b7c0ea8ebb120a64). v2; |
| 267 | |
| 268 | return strictEqualSlowCaseInlinecxx . . $ QTJSC/JSValue#strictEqualSlowCaseInline(658e1865c47113e6).(exec, v1, v2); |
| 269 | } |
| 270 | |
| 271 | ALWAYS_INLINEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! bool jsLesscxx . . $ QTJSC/jsLess(658e1865c47113e6).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame, JSValuecxx . . $ QTJSC/JSValue# v1, JSValuecxx . . $ QTJSC/JSValue# v2) |
| 272 | { |
| 273 | if (v1.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).() && v2.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) |
| 274 | return v1.asInt32cxx . . $ QTJSC/JSValue#asInt32(455f465bc33b4cdf).() < v2.asInt32cxx . . $ QTJSC/JSValue#asInt32(455f465bc33b4cdf).(); |
| 275 | |
| 276 | double n1; |
| 277 | double n2; |
| 278 | if (v1.getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(n1) && v2.getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(n2)) |
| 279 | return n1 < n2; |
| 280 | |
| 281 | JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData = &callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(); |
| 282 | if (isJSStringcxx . . $ QTJSC/isJSString(b468e0305807c4ec).(globalData, v1) && isJSStringcxx . . $ QTJSC/isJSString(b468e0305807c4ec).(globalData, v2)) |
| 283 | return asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v1)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(callFrame) <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v2)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(callFrame); |
| 284 | |
| 285 | JSValuecxx . . $ QTJSC/JSValue# p1cxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).; |
| 286 | JSValuecxx . . $ QTJSC/JSValue# p2cxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).; |
| 287 | bool wasNotString1 = v1.getPrimitiveNumbercxx . . $ QTJSC/JSValue#getPrimitiveNumber(5ae801b0dd2b44e9).(callFrame, n1, p1); |
| 288 | bool wasNotString2 = v2.getPrimitiveNumbercxx . . $ QTJSC/JSValue#getPrimitiveNumber(5ae801b0dd2b44e9).(callFrame, n2, p2); |
| 289 | |
| 290 | if (wasNotString1 | wasNotString2) |
| 291 | return n1 < n2; |
| 292 | |
| 293 | return asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(p1)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(callFrame) <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(p2)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(callFrame); |
| 294 | } |
| 295 | |
| 296 | inline bool jsLessEqcxx . . $ QTJSC/jsLessEq(658e1865c47113e6).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame, JSValuecxx . . $ QTJSC/JSValue# v1, JSValuecxx . . $ QTJSC/JSValue# v2) |
| 297 | { |
| 298 | if (v1.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).() && v2.isInt32cxx . . $ QTJSC/JSValue#isInt32(50ce9a9e25b4a850).()) |
| 299 | return v1.asInt32cxx . . $ QTJSC/JSValue#asInt32(455f465bc33b4cdf).() <= v2.asInt32cxx . . $ QTJSC/JSValue#asInt32(455f465bc33b4cdf).(); |
| 300 | |
| 301 | double n1; |
| 302 | double n2; |
| 303 | if (v1.getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(n1) && v2.getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(n2)) |
| 304 | return n1 <= n2; |
| 305 | |
| 306 | JSGlobalDatacxx . . $ QTJSC/JSGlobalData#* globalData = &callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).(); |
| 307 | if (isJSStringcxx . . $ QTJSC/isJSString(b468e0305807c4ec).(globalData, v1) && isJSStringcxx . . $ QTJSC/isJSString(b468e0305807c4ec).(globalData, v2)) |
| 308 | return !(asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v2)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(callFrame) <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v1)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(callFrame)); |
| 309 | |
| 310 | JSValuecxx . . $ QTJSC/JSValue# p1cxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).; |
| 311 | JSValuecxx . . $ QTJSC/JSValue# p2cxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).; |
| 312 | bool wasNotString1 = v1.getPrimitiveNumbercxx . . $ QTJSC/JSValue#getPrimitiveNumber(5ae801b0dd2b44e9).(callFrame, n1, p1); |
| 313 | bool wasNotString2 = v2.getPrimitiveNumbercxx . . $ QTJSC/JSValue#getPrimitiveNumber(5ae801b0dd2b44e9).(callFrame, n2, p2); |
| 314 | |
| 315 | if (wasNotString1 | wasNotString2) |
| 316 | return n1 <= n2; |
| 317 | |
| 318 | return !(asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(p2)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(callFrame) <cxx . . $ QTJSC/`operator<`(11610d830df66bbf). asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(p1)->valuecxx . . $ QTJSC/JSString#value(fc696c135aaf08bd).(callFrame)); |
| 319 | } |
| 320 | |
| 321 | // Fast-path choices here are based on frequency data from SunSpider: |
| 322 | // <times> Add case: <t1> <t2> |
| 323 | // --------------------------- |
| 324 | // 5626160 Add case: 3 3 (of these, 3637690 are for immediate values) |
| 325 | // 247412 Add case: 5 5 |
| 326 | // 20900 Add case: 5 6 |
| 327 | // 13962 Add case: 5 3 |
| 328 | // 4000 Add case: 3 5 |
| 329 | |
| 330 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! JSValuecxx . . $ QTJSC/JSValue# jsAddcxx . . $ QTJSC/jsAdd(b8fa476a5be1c821).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame, JSValuecxx . . $ QTJSC/JSValue# v1, JSValuecxx . . $ QTJSC/JSValue# v2) |
| 331 | { |
| 332 | double left = 0.0, right; |
| 333 | if (v1.getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(left) && v2.getNumbercxx . . $ QTJSC/JSValue#getNumber(c49d02341edf1b7e).(right)) |
| 334 | return jsNumbercxx . . $ QTJSC/jsNumber(88e66938454912cb).(callFrame, left + right); |
| 335 | |
| 336 | if (v1.isStringcxx . . $ QTJSC/JSValue#isString(50ce9a9e25b4a850).()) { |
| 337 | return v2.isStringcxx . . $ QTJSC/JSValue#isString(50ce9a9e25b4a850).() |
| 338 | ? jsStringcxx . . $ QTJSC/jsString(1d20702c49229e34).(callFrame, asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v1), asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v2)) |
| 339 | : jsStringcxx . . $ QTJSC/jsString(d78052f683f48fad).(callFrame, asStringcxx . . $ QTJSC/asString(3a349c2233e4a703).(v1), v2.toPrimitiveStringcxx . . $ QTJSC/JSValue#toPrimitiveString(9c94f5abb1995042).(callFrame)); |
| 340 | } |
| 341 | |
| 342 | // All other cases are pretty uncommon |
| 343 | return jsAddSlowCasecxx . . $ QTJSC/jsAddSlowCase(b8fa476a5be1c821).(callFrame, v1, v2); |
| 344 | } |
| 345 | |
| 346 | inline size_t normalizePrototypeChaincxx . . $ QTJSC/normalizePrototypeChain(946acb67c406852c).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame, JSValuecxx . . $ QTJSC/JSValue# base, JSValuecxx . . $ QTJSC/JSValue# slotBase, const Identifiercxx . . $ QTJSC/Identifier#& propertyName, size_t& slotOffset) |
| 347 | { |
| 348 | JSCellcxx . . $ QTJSC/JSCell#* cell = asCellcxx . . $ QTJSC/asCell(31485abf284d9c5).(base); |
| 349 | size_t count = 0; |
| 350 | |
| 351 | while (slotBase !=cxx . . $ QTJSC/`operator!=`(8208a731c2dadbc2). cell) { |
| 352 | JSValuecxx . . $ QTJSC/JSValue# v = cell->structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).()->prototypeForLookupcxx . . $ QTJSC/Structure#prototypeForLookup(3edd4bd77d4e7240).(callFrame); |
| 353 | |
| 354 | // If we didn't find slotBase in base's prototype chain, then base |
| 355 | // must be a proxy for another object. |
| 356 | |
| 357 | if (v.isNullcxx . . $ QTJSC/JSValue#isNull(50ce9a9e25b4a850).()) |
| 358 | return 0; |
| 359 | |
| 360 | cell = asCellcxx . . $ QTJSC/asCell(31485abf284d9c5).(v); |
| 361 | |
| 362 | // Since we're accessing a prototype in a loop, it's a good bet that it |
| 363 | // should not be treated as a dictionary. |
| 364 | if (cell->structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).()->isDictionarycxx . . $ QTJSC/Structure#isDictionary(50ce9a9e25b4a850).()) { |
| 365 | asObjectcxx . . $ QTJSC/asObject(57571c3d51f0c406).(cell)->flattenDictionaryObjectcxx . . $ QTJSC/JSObject#flattenDictionaryObject(49f6e7a06ebc5aa8).(); |
| 366 | if (slotBase ==cxx . . $ QTJSC/`operator==`(8208a731c2dadbc2). cell) |
| 367 | slotOffset = cell->structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).()->getcxx . . $ QTJSC/Structure#get(308a741d5d193e69).(propertyName); |
| 368 | } |
| 369 | |
| 370 | ++count; |
| 371 | } |
| 372 | |
| 373 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(count); |
| 374 | return count; |
| 375 | } |
| 376 | |
| 377 | inline size_t normalizePrototypeChaincxx . . $ QTJSC/normalizePrototypeChain(6e99572094d87a3e).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame, JSCellcxx . . $ QTJSC/JSCell#* base) |
| 378 | { |
| 379 | size_t count = 0; |
| 380 | while (1) { |
| 381 | JSValuecxx . . $ QTJSC/JSValue# v = base->structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).()->prototypeForLookupcxx . . $ QTJSC/Structure#prototypeForLookup(3edd4bd77d4e7240).(callFrame); |
| 382 | if (v.isNullcxx . . $ QTJSC/JSValue#isNull(50ce9a9e25b4a850).()) |
| 383 | return count; |
| 384 | |
| 385 | base = asCellcxx . . $ QTJSC/asCell(31485abf284d9c5).(v); |
| 386 | |
| 387 | // Since we're accessing a prototype in a loop, it's a good bet that it |
| 388 | // should not be treated as a dictionary. |
| 389 | if (base->structurecxx . . $ QTJSC/JSCell#structure(a25848528202c7a).()->isDictionarycxx . . $ QTJSC/Structure#isDictionary(50ce9a9e25b4a850).()) |
| 390 | asObjectcxx . . $ QTJSC/asObject(57571c3d51f0c406).(base)->flattenDictionaryObjectcxx . . $ QTJSC/JSObject#flattenDictionaryObject(49f6e7a06ebc5aa8).(); |
| 391 | |
| 392 | ++count; |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | ALWAYS_INLINEcxx . . $ `../3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! JSValuecxx . . $ QTJSC/JSValue# resolveBasecxx . . $ QTJSC/resolveBase(5fc6721f9beb1956).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame, Identifiercxx . . $ QTJSC/Identifier#& property, ScopeChainNodecxx . . $ QTJSC/ScopeChainNode#* scopeChain) |
| 397 | { |
| 398 | ScopeChainIteratorcxx . . $ QTJSC/ScopeChainIterator# iter = scopeChain->begincxx . . $ QTJSC/ScopeChainNode#begin(96529fad815ce745).(); |
| 399 | ScopeChainIteratorcxx . . $ QTJSC/ScopeChainIterator# next = iter; |
| 400 | ++cxx . . $ QTJSC/ScopeChainIterator#operator++(fdd019326dfb3ff8).next; |
| 401 | ScopeChainIteratorcxx . . $ QTJSC/ScopeChainIterator# end = scopeChain->endcxx . . $ QTJSC/ScopeChainNode#end(96529fad815ce745).(); |
| 402 | ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(iter != end); |
| 403 | |
| 404 | PropertySlotcxx . . $ QTJSC/PropertySlot# slotcxx . . $ QTJSC/PropertySlot#PropertySlot(49f6e7a06ebc5aa8).; |
| 405 | JSObjectcxx . . $ QTJSC/JSObject#* base; |
| 406 | while (true) { |
| 407 | base = *cxx . . $ QTJSC/ScopeChainIterator#`operator*`(99d346b5a13496d5).iter; |
| 408 | if (next ==cxx . . $ QTJSC/ScopeChainIterator#`operator==`(b99368ddd4a254b). end || base->getPropertySlotcxx . . $ QTJSC/JSObject#getPropertySlot(6f4ef3dbfe7d5ab9).(callFrame, property, slot)) |
| 409 | return base; |
| 410 | |
| 411 | iter =cxx . . $ QTJSC/ScopeChainIterator#`operator=`(84978a5e0f59c936). next; |
| 412 | ++cxx . . $ QTJSC/ScopeChainIterator#operator++(fdd019326dfb3ff8).next; |
| 413 | } |
| 414 | |
| 415 | ASSERT_NOT_REACHEDcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:185:9`!(); |
| 416 | return JSValuecxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).(); |
| 417 | } |
| 418 | } // namespace JSC |
| 419 | |
| 420 | #endif // Operations_h |