Ignore:
Timestamp:
Dec 2, 2016, 4:35:25 PM (8 years ago)
Author:
Chris Dumez
Message:

Unreviewed, rolling out r209275 and r209276.
https://bugs.webkit.org/show_bug.cgi?id=165348

"broke the arm build" (Requested by keith_miller on #webkit).

Reverted changesets:

"Add Wasm floating point nearest and trunc"
https://bugs.webkit.org/show_bug.cgi?id=165339
http://trac.webkit.org/changeset/209275

"Unreviewed, forgot to change instruction after renaming."
http://trac.webkit.org/changeset/209276

Patch by Commit Queue <[email protected]> on 2016-12-02

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r209275 r209283  
    25112511static JSValue box(ExecState* exec, VM& vm, JSValue wasmValue)
    25122512{
    2513 
    25142513    JSString* type = jsCast<JSString*>(wasmValue.get(exec, makeIdentifier(vm, "type")));
    25152514    JSValue value = wasmValue.get(exec, makeIdentifier(vm, "value"));
    2516 
    2517     auto unboxString = [&] (const char* hexFormat, const char* decFormat, auto& result) {
    2518         if (!value.isString())
    2519             return false;
    2520 
    2521         const char* str = toCString(jsCast<JSString*>(value)->value(exec)).data();
    2522         int scanResult;
    2523         int length = std::strlen(str);
    2524         if ((length > 2 && (str[0] == '0' && str[1] == 'x'))
    2525             || (length > 3 && (str[0] == '-' && str[1] == '0' && str[2] == 'x')))
    2526 #if COMPILER(CLANG)
    2527 #pragma clang diagnostic push
    2528 #pragma clang diagnostic ignored "-Wformat-nonliteral"
    2529 #endif
    2530             scanResult = sscanf(str, hexFormat, &result);
    2531         else
    2532             scanResult = sscanf(str, decFormat, &result);
    2533 #if COMPILER(CLANG)
    2534 #pragma clang diagnostic pop
    2535 #endif
    2536         RELEASE_ASSERT(scanResult != EOF);
    2537         return true;
    2538     };
    25392515
    25402516    const String& typeString = type->value(exec);
    25412517    if (typeString == "i64") {
    25422518        int64_t result;
    2543         if (!unboxString("%llx", "%lld", result))
    2544             CRASH();
     2519        const char* str = toCString(jsCast<JSString*>(value)->value(exec)).data();
     2520        int scanResult;
     2521        if (std::strlen(str) > 2 && str[0] == '0' && str[1] == 'x')
     2522            scanResult = sscanf(str, "%llx", &result);
     2523        else
     2524            scanResult = sscanf(str, "%lld", &result);
     2525        RELEASE_ASSERT(scanResult != EOF);
    25452526        return JSValue::decode(result);
    25462527    }
     2528    RELEASE_ASSERT(value.isNumber());
    25472529
    25482530    if (typeString == "i32") {
    2549         int32_t result;
    2550         if (!unboxString("%x", "%d", result))
    2551             result = value.asInt32();
    2552         return JSValue::decode(static_cast<uint32_t>(result));
    2553     }
    2554 
    2555     if (typeString == "f32") {
    2556         float result;
    2557         if (!unboxString("%a", "%f", result))
    2558             result = value.toFloat(exec);
    2559         return JSValue::decode(bitwise_cast<uint32_t>(result));
    2560     }
     2531        RELEASE_ASSERT(value.isInt32());
     2532        return JSValue::decode(static_cast<uint32_t>(value.asInt32()));
     2533    }
     2534
     2535    if (typeString == "f32")
     2536        return JSValue::decode(bitwise_cast<uint32_t>(value.toFloat(exec)));
    25612537
    25622538    RELEASE_ASSERT(typeString == "f64");
    2563     double result;
    2564     if (!unboxString("%la", "%lf", result))
    2565         result = value.asNumber();
    2566     return JSValue::decode(bitwise_cast<uint64_t>(result));
     2539    return JSValue::decode(bitwise_cast<uint64_t>(value.asNumber()));
    25672540}
    25682541
Note: See TracChangeset for help on using the changeset viewer.