Ignore:
Timestamp:
Mar 16, 2017, 2:19:23 PM (8 years ago)
Author:
[email protected]
Message:

FTL should support global and eval code
https://bugs.webkit.org/show_bug.cgi?id=169656

Reviewed by Geoffrey Garen and Saam Barati.

JSTests:

Added basic performance tests of global and eval code. These tests will run a lot faster in with
the FTL because of the object allocation.

  • microbenchmarks/eval-code-ftl-reentry.js: Added.
  • microbenchmarks/eval-code-ftl.js: Added.
  • microbenchmarks/global-code-ftl.js: Added.
  • stress/arith-log-on-various-types.js: This was a flaky fail with concurrent JIT, so I stopped running it with concurrent JIT. The failure was its assertion about how many times something gets compiled.

Source/JavaScriptCore:

Turned off the restriction against global and eval code running in the FTL, and then fixed all of
the things that didn't work.

This is a big speed-up on microbenchmarks that I wrote for this patch. One of the reasons why we
hadn't done this earlier is that we've never seen a benchmark that needed it. Global and eval
code rarely gets FTL-hot. Still, this seems like possibly a small JetStream speed-up.

  • dfg/DFGJITCode.cpp:

(JSC::DFG::JITCode::setOSREntryBlock): I outlined this for better debugging.

  • dfg/DFGJITCode.h:

(JSC::DFG::JITCode::setOSREntryBlock): Deleted.

  • dfg/DFGNode.h:

(JSC::DFG::Node::isSemanticallySkippable): It turns out that global code often has InvalidationPoints before LoopHints. They are also skippable from the standpoint of OSR entrypoint analysis.

  • dfg/DFGOperations.cpp: Don't do any normal compiles of global code - just do OSR compiles.
  • ftl/FTLCapabilities.cpp: Enable FTL for global and eval code.

(JSC::FTL::canCompile):

  • ftl/FTLCompile.cpp: Just debugging clean-ups.

(JSC::FTL::compile):

  • ftl/FTLJITFinalizer.cpp: Implement finalize() and ensure that we only do things with the entrypoint buffer if we have one. We won't have one for eval code that we aren't OSR entering into.

(JSC::FTL::JITFinalizer::finalize):
(JSC::FTL::JITFinalizer::finalizeFunction):
(JSC::FTL::JITFinalizer::finalizeCommon):

  • ftl/FTLJITFinalizer.h:
  • ftl/FTLLink.cpp: When entering a function normally, we need the "entrypoint" to put the arity check code. Global and eval code don't need this.

(JSC::FTL::link):

  • ftl/FTLOSREntry.cpp: Fix a dataLog statement.

(JSC::FTL::prepareOSREntry):

  • ftl/FTLOSRExitCompiler.cpp: Remove dead code that happened to assert that we're exiting from a function.

(JSC::FTL::compileStub):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ftl/FTLJITFinalizer.h

    r206525 r214069  
    11/*
    2  * Copyright (C) 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    5757    bool finalize() override;
    5858    bool finalizeFunction() override;
     59   
     60    bool finalizeCommon();
    5961
    6062    std::unique_ptr<LinkBuffer> b3CodeLinkBuffer;
Note: See TracChangeset for help on using the changeset viewer.