Ignore:
Timestamp:
Apr 7, 2015, 12:41:12 PM (10 years ago)
Author:
[email protected]
Message:

Make it possible to enable LLVM FastISel
https://bugs.webkit.org/show_bug.cgi?id=143489

Reviewed by Michael Saboff.

The decision to enable FastISel is made by Options.h|cpp, but the LLVM library can disable it if it finds that it is built
against a version of LLVM that doesn't support it. Thereafter, JSC::enableLLVMFastISel is the flag that tells the system
if we should enable it.

  • ftl/FTLCompile.cpp:

(JSC::FTL::mmAllocateDataSection):

  • llvm/InitializeLLVM.cpp:

(JSC::initializeLLVMImpl):

  • llvm/InitializeLLVM.h:
  • llvm/InitializeLLVMLinux.cpp:

(JSC::getLLVMInitializerFunction):
(JSC::initializeLLVMImpl): Deleted.

  • llvm/InitializeLLVMMac.cpp:

(JSC::getLLVMInitializerFunction):
(JSC::initializeLLVMImpl): Deleted.

  • llvm/InitializeLLVMPOSIX.cpp:

(JSC::getLLVMInitializerFunctionPOSIX):
(JSC::initializeLLVMPOSIX): Deleted.

  • llvm/InitializeLLVMPOSIX.h:
  • llvm/InitializeLLVMWin.cpp:

(JSC::getLLVMInitializerFunction):
(JSC::initializeLLVMImpl): Deleted.

  • llvm/LLVMAPI.cpp:
  • llvm/LLVMAPI.h:
  • llvm/library/LLVMExports.cpp:

(initCommandLine):
(initializeAndGetJSCLLVMAPI):

  • runtime/Options.cpp:

(JSC::Options::initialize):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/llvm/InitializeLLVMPOSIX.cpp

    r180622 r182483  
    11/*
    2  * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3636namespace JSC {
    3737
    38 typedef void (*LoggerFunction)(const char*, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
    39 typedef LLVMAPI* (*InitializerFunction)(LoggerFunction);
    40 
    41 void initializeLLVMPOSIX(const char* libraryName)
     38LLVMInitializerFunction getLLVMInitializerFunctionPOSIX(const char* libraryName, bool verbose)
    4239{
    43     const bool verbose =
    44         Options::verboseFTLCompilation()
    45         || Options::showFTLDisassembly()
    46         || Options::verboseFTLFailure()
    47         || Options::verboseCompilation()
    48         || Options::showDFGDisassembly()
    49         || Options::showDisassembly();
    50    
    5140    int flags = RTLD_NOW;
    5241   
     
    6453        if (verbose)
    6554            dataLog("Failed to load LLVM library at ", libraryName, ": ", dlerror(), "\n");
    66         return;
     55        return nullptr;
    6756    }
    6857   
    6958    const char* symbolName = "initializeAndGetJSCLLVMAPI";
    70     InitializerFunction initializer = bitwise_cast<InitializerFunction>(
     59    LLVMInitializerFunction initializer = bitwise_cast<LLVMInitializerFunction>(
    7160        dlsym(library, symbolName));
    7261    if (!initializer) {
    7362        if (verbose)
    7463            dataLog("Failed to find ", symbolName, " in ", libraryName, ": ", dlerror());
    75         return;
     64        return nullptr;
    7665    }
    7766   
    78     llvm = initializer(WTFLogAlwaysAndCrash);
    79     if (!llvm) {
    80         if (verbose)
    81             dataLog("LLVM initilization failed.\n");
    82     }
     67    return initializer;
    8368}
    8469
Note: See TracChangeset for help on using the changeset viewer.