Ignore:
Timestamp:
Aug 15, 2014, 2:04:31 PM (11 years ago)
Author:
[email protected]
Message:

Made native inlining errors not segfault.
https://bugs.webkit.org/show_bug.cgi?id=135988

Reviewed by Geoffrey Garen.

  • ftl/FTLAbbreviations.h:

(JSC::FTL::disposeMessage): Added.

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::compilePutById):
abstracted out Options::verboseCompilation as was the case in the rest of the file.
(JSC::FTL::LowerDFGToLLVM::compileNativeCallOrConstruct):
(JSC::FTL::LowerDFGToLLVM::getModuleByPathForSymbol):
added output error messages for llvm module loading.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

    r172176 r172648  
    19001900        unsigned stackmapID = m_stackmapIDs++;
    19011901
    1902         if (Options::verboseCompilation())
     1902        if (verboseCompilationEnabled())
    19031903            dataLog("    Emitting PutById patchpoint with stackmap #", stackmapID, "\n");
    19041904       
     
    37163716        LValue call = vmCall(callee, argument);
    37173717
    3718         if (Options::verboseCompilation())
     3718        if (verboseCompilationEnabled())
    37193719            dataLog("Native calling: ", info.dli_sname, "\n");
    37203720
     
    43834383            path.data());
    43844384
    4385         if (createMemoryBufferWithContentsOfFile(actualPath.data(), &memBuf, nullptr)) {
    4386             if (Options::verboseCompilation())
    4387                 dataLog("Failed to load module at ", actualPath.data(), "\n for symbol ", symbol.data());
     4385        char* outMsg;
     4386       
     4387        if (createMemoryBufferWithContentsOfFile(actualPath.data(), &memBuf, &outMsg)) {
     4388            if (Options::verboseFTLFailure())
     4389                dataLog("Failed to load module at ", actualPath, "\n for symbol ", symbol, "\nERROR: ", outMsg, "\n");
     4390            disposeMessage(outMsg);
    43884391            return false;
    43894392        }
     
    43914394        LModule module;
    43924395
    4393         if (parseBitcodeInContext(m_ftlState.context, memBuf, &module, nullptr)) {
     4396        if (parseBitcodeInContext(m_ftlState.context, memBuf, &module, &outMsg)) {
     4397            if (Options::verboseFTLFailure())
     4398                dataLog("Failed to parse module at ", actualPath, "\n for symbol ", symbol, "\nERROR: ", outMsg, "\n");
    43944399            disposeMemoryBuffer(memBuf);
     4400            disposeMessage(outMsg);
    43954401            return false;
    43964402        }
     
    44254431        }
    44264432
    4427         if (linkModules(m_ftlState.module, module, LLVMLinkerDestroySource, nullptr))
     4433        if (linkModules(m_ftlState.module, module, LLVMLinkerDestroySource, &outMsg)) {
     4434            if (Options::verboseFTLFailure())
     4435                dataLog("Failed to link module at ", actualPath, "\n for symbol ", symbol, "\nERROR: ", outMsg, "\n");
     4436            disposeMessage(outMsg);
    44284437            return false;
     4438        }
    44294439       
    44304440        for (CString* symbol = namedFunctions.begin(); symbol != namedFunctions.end(); ++symbol) {
Note: See TracChangeset for help on using the changeset viewer.