diff options
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/Operations.h')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/Operations.h | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/Operations.h b/src/3rdparty/webkit/JavaScriptCore/runtime/Operations.h index acfc6c2..5da9e38 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/Operations.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/Operations.h @@ -38,7 +38,7 @@ namespace JSC { // ECMA 11.9.3 inline bool JSValue::equal(ExecState* exec, JSValue v1, JSValue v2) { - if (JSImmediate::areBothImmediateIntegerNumbers(v1, v2)) + if (v1.isInt32() && v2.isInt32()) return v1 == v2; return equalSlowCase(exec, v1, v2); @@ -46,8 +46,6 @@ namespace JSC { ALWAYS_INLINE bool JSValue::equalSlowCaseInline(ExecState* exec, JSValue v1, JSValue v2) { - ASSERT(!JSImmediate::areBothImmediateIntegerNumbers(v1, v2)); - do { if (v1.isNumber() && v2.isNumber()) return v1.uncheckedGetNumber() == v2.uncheckedGetNumber(); @@ -60,13 +58,13 @@ namespace JSC { if (v1.isUndefinedOrNull()) { if (v2.isUndefinedOrNull()) return true; - if (JSImmediate::isImmediate(v2)) + if (!v2.isCell()) return false; return v2.asCell()->structure()->typeInfo().masqueradesAsUndefined(); } if (v2.isUndefinedOrNull()) { - if (JSImmediate::isImmediate(v1)) + if (!v1.isCell()) return false; return v1.asCell()->structure()->typeInfo().masqueradesAsUndefined(); } @@ -78,7 +76,7 @@ namespace JSC { if (exec->hadException()) return false; v1 = p1; - if (JSImmediate::areBothImmediateIntegerNumbers(v1, v2)) + if (v1.isInt32() && v2.isInt32()) return v1 == v2; continue; } @@ -88,7 +86,7 @@ namespace JSC { if (exec->hadException()) return false; v2 = p2; - if (JSImmediate::areBothImmediateIntegerNumbers(v1, v2)) + if (v1.isInt32() && v2.isInt32()) return v1 == v2; continue; } @@ -114,7 +112,7 @@ namespace JSC { // ECMA 11.9.3 ALWAYS_INLINE bool JSValue::strictEqualSlowCaseInline(JSValue v1, JSValue v2) { - ASSERT(!JSImmediate::isEitherImmediate(v1, v2)); + ASSERT(v1.isCell() && v2.isCell()); if (v1.asCell()->isString() && v2.asCell()->isString()) return asString(v1)->value() == asString(v2)->value(); @@ -124,13 +122,13 @@ namespace JSC { inline bool JSValue::strictEqual(JSValue v1, JSValue v2) { - if (JSImmediate::areBothImmediateIntegerNumbers(v1, v2)) + if (v1.isInt32() && v2.isInt32()) return v1 == v2; if (v1.isNumber() && v2.isNumber()) return v1.uncheckedGetNumber() == v2.uncheckedGetNumber(); - if (JSImmediate::isEitherImmediate(v1, v2)) + if (!v1.isCell() || !v2.isCell()) return v1 == v2; return strictEqualSlowCaseInline(v1, v2); @@ -138,8 +136,8 @@ namespace JSC { inline bool jsLess(CallFrame* callFrame, JSValue v1, JSValue v2) { - if (JSValue::areBothInt32Fast(v1, v2)) - return v1.getInt32Fast() < v2.getInt32Fast(); + if (v1.isInt32() && v2.isInt32()) + return v1.asInt32() < v2.asInt32(); double n1; double n2; @@ -163,8 +161,8 @@ namespace JSC { inline bool jsLessEq(CallFrame* callFrame, JSValue v1, JSValue v2) { - if (JSValue::areBothInt32Fast(v1, v2)) - return v1.getInt32Fast() <= v2.getInt32Fast(); + if (v1.isInt32() && v2.isInt32()) + return v1.asInt32() <= v2.asInt32(); double n1; double n2; @@ -213,8 +211,8 @@ namespace JSC { } if (rightIsNumber & leftIsString) { - RefPtr<UString::Rep> value = v2.isInt32Fast() ? - concatenate(asString(v1)->value().rep(), v2.getInt32Fast()) : + RefPtr<UString::Rep> value = v2.isInt32() ? + concatenate(asString(v1)->value().rep(), v2.asInt32()) : concatenate(asString(v1)->value().rep(), right); if (!value) @@ -310,20 +308,13 @@ namespace JSC { resultRep = UString::Rep::createEmptyBuffer(bufferSize); UString result(resultRep); - // Loop over the openards, writing them into the output buffer. + // Loop over the operands, writing them into the output buffer. for (unsigned i = 0; i < count; ++i) { JSValue v = strings[i].jsValue(); if (LIKELY(v.isString())) result.append(asString(v)->value()); - else if (v.isInt32Fast()) - result.appendNumeric(v.getInt32Fast()); - else { - double d; - if (v.getNumber(d)) - result.appendNumeric(d); - else - result.append(v.toString(callFrame)); - } + else + result.append(v.toString(callFrame)); } return jsString(callFrame, result); |