Ignore:
Timestamp:
Apr 17, 2018, 5:05:07 PM (7 years ago)
Author:
Matt Lewis
Message:

Unreviewed, rolling out r230697, r230720, and r230724.
https://bugs.webkit.org/show_bug.cgi?id=184717

These caused multiple failures on the Test262 testers.
(Requested by mlewis13 on #webkit).

Reverted changesets:

"[WebAssembly][Modules] Prototype wasm import"
https://bugs.webkit.org/show_bug.cgi?id=184600
https://trac.webkit.org/changeset/230697

"[WebAssembly][Modules] Implement function import from wasm
modules"
https://bugs.webkit.org/show_bug.cgi?id=184689
https://trac.webkit.org/changeset/230720

"[JSC] Rename runWebAssembly to runWebAssemblySuite"
https://bugs.webkit.org/show_bug.cgi?id=184703
https://trac.webkit.org/changeset/230724

Patch by Commit Queue <[email protected]> on 2018-04-17

File:
1 edited

Legend:

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

    r230720 r230741  
    187187}
    188188
    189 template<typename Vector>
    190 static bool fillBufferWithContentsOfFile(const String& fileName, Vector& buffer);
     189static bool fillBufferWithContentsOfFile(const String& fileName, Vector<char>& buffer);
    191190static RefPtr<Uint8Array> fillBufferWithContentsOfFile(const String& fileName);
    192191
     
    197196template<typename Func>
    198197int runJSC(CommandLine, bool isWorker, const Func&);
    199 static void checkException(ExecState*, GlobalObject*, bool isLastFile, bool hasException, JSValue, CommandLine&, bool& success);
     198static void checkException(GlobalObject*, bool isLastFile, bool hasException, JSValue, CommandLine&, bool& success);
    200199
    201200class Message : public ThreadSafeRefCounted<Message> {
     
    846845}
    847846
    848 template<typename Vector>
    849 static void convertShebangToJSComment(Vector& buffer)
     847static void convertShebangToJSComment(Vector<char>& buffer)
    850848{
    851849    if (buffer.size() >= 2) {
     
    885883}
    886884
    887 template<typename Vector>
    888 static bool fillBufferWithContentsOfFile(FILE* file, Vector& buffer)
     885static bool fillBufferWithContentsOfFile(FILE* file, Vector<char>& buffer)
    889886{
    890887    // We might have injected "use strict"; at the top.
     
    924921}
    925922
    926 template<typename Vector>
    927 static bool fetchModuleFromLocalFileSystem(const String& fileName, Vector& buffer)
     923static bool fetchModuleFromLocalFileSystem(const String& fileName, Vector<char>& buffer)
    928924{
    929925    // We assume that fileName is always an absolute path.
     
    976972
    977973    // Here, now we consider moduleKey as the fileName.
    978     Vector<uint8_t> buffer;
    979     if (!fetchModuleFromLocalFileSystem(moduleKey, buffer)) {
     974    Vector<char> utf8;
     975    if (!fetchModuleFromLocalFileSystem(moduleKey, utf8)) {
    980976        auto result = deferred->reject(exec, createError(exec, makeString("Could not open file '", moduleKey, "'.")));
    981977        scope.releaseAssertNoException();
     
    983979    }
    984980
    985 #if ENABLE(WEBASSEMBLY)
    986     // FileSystem does not have mime-type header. The JSC shell recognizes WebAssembly's magic header.
    987     if (buffer.size() >= 4) {
    988         if (buffer[0] == '\0' && buffer[1] == 'a' && buffer[2] == 's' && buffer[3] == 'm') {
    989             auto result = deferred->resolve(exec, JSSourceCode::create(vm, SourceCode(WebAssemblySourceProvider::create(WTFMove(buffer), SourceOrigin { moduleKey }, moduleKey))));
    990             scope.releaseAssertNoException();
    991             return result;
    992         }
    993     }
    994 #endif
    995 
    996     auto result = deferred->resolve(exec, JSSourceCode::create(vm, makeSource(stringFromUTF(buffer), SourceOrigin { moduleKey }, moduleKey, TextPosition(), SourceProviderSourceType::Module)));
     981    auto result = deferred->resolve(exec, JSSourceCode::create(vm, makeSource(stringFromUTF(utf8), SourceOrigin { moduleKey }, moduleKey, TextPosition(), SourceProviderSourceType::Module)));
    997982    scope.releaseAssertNoException();
    998983    return result;
     
    16331618                    if (evaluationException)
    16341619                        result = evaluationException->value();
    1635                     checkException(globalObject->globalExec(), globalObject, true, evaluationException, result, commandLine, success);
     1620                    checkException(globalObject, true, evaluationException, result, commandLine, success);
    16361621                    if (!success)
    16371622                        exit(1);
     
    22602245}
    22612246
    2262 static void checkException(ExecState* exec, GlobalObject* globalObject, bool isLastFile, bool hasException, JSValue value, CommandLine& options, bool& success)
     2247static void checkException(GlobalObject* globalObject, bool isLastFile, bool hasException, JSValue value, CommandLine& options, bool& success)
    22632248{
    22642249    VM& vm = globalObject->vm();
     
    22722257        success = success && !hasException;
    22732258        if (options.m_dump && !hasException)
    2274             printf("End: %s\n", value.toWTFString(exec).utf8().data());
     2259            printf("End: %s\n", value.toWTFString(globalObject->globalExec()).utf8().data());
    22752260        if (hasException)
    22762261            dumpException(globalObject, value);
     
    23252310
    23262311            JSFunction* fulfillHandler = JSNativeStdFunction::create(vm, globalObject, 1, String(), [&, isLastFile](ExecState* exec) {
    2327                 checkException(exec, globalObject, isLastFile, false, exec->argument(0), options, success);
     2312                checkException(globalObject, isLastFile, false, exec->argument(0), options, success);
    23282313                return JSValue::encode(jsUndefined());
    23292314            });
    23302315
    23312316            JSFunction* rejectHandler = JSNativeStdFunction::create(vm, globalObject, 1, String(), [&, isLastFile](ExecState* exec) {
    2332                 checkException(exec, globalObject, isLastFile, true, exec->argument(0), options, success);
     2317                checkException(globalObject, isLastFile, true, exec->argument(0), options, success);
    23332318                return JSValue::encode(jsUndefined());
    23342319            });
     
    23432328            if (evaluationException)
    23442329                returnValue = evaluationException->value();
    2345             checkException(globalObject->globalExec(), globalObject, isLastFile, evaluationException, returnValue, options, success);
     2330            checkException(globalObject, isLastFile, evaluationException, returnValue, options, success);
    23462331        }
    23472332
Note: See TracChangeset for help on using the changeset viewer.