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/InitializeLLVM.cpp

    r166948 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
     
    3030
    3131#include "LLVMAPI.h"
     32#include "Options.h"
    3233#include <pthread.h>
     34#include <wtf/DataLog.h>
    3335
    3436namespace JSC {
    3537
    3638static pthread_once_t initializeLLVMOnceKey = PTHREAD_ONCE_INIT;
     39
     40static void initializeLLVMImpl()
     41{
     42    const bool verbose =
     43        Options::verboseFTLCompilation()
     44        || Options::showFTLDisassembly()
     45        || Options::verboseFTLFailure()
     46        || Options::verboseCompilation()
     47        || Options::showDFGDisassembly()
     48        || Options::showDisassembly();
     49   
     50    LLVMInitializerFunction initializer = getLLVMInitializerFunction(verbose);
     51    if (!initializer)
     52        return;
     53   
     54    bool enableFastISel = Options::enableLLVMFastISel();
     55    llvm = initializer(WTFLogAlwaysAndCrash, &enableFastISel);
     56    if (!llvm) {
     57        if (verbose)
     58            dataLog("LLVM initilization failed.\n");
     59    }
     60    if (Options::enableLLVMFastISel() && !enableFastISel) {
     61        if (verbose)
     62            dataLog("Fast ISel requested but LLVM not new enough.\n");
     63    }
     64   
     65    enableLLVMFastISel = enableFastISel;
     66}
    3767
    3868bool initializeLLVM()
Note: See TracChangeset for help on using the changeset viewer.