[JSC] Use CallLinkInfo in LLInt
https://bugs.webkit.org/show_bug.cgi?id=232746

Reviewed by Saam Barati.

JSTests:

* stress/is-callable-in-ftl-needs-to-be-aware-of-proxy.js:
* stress/sampling-profiler-wasm-name-section.js:
(platformSupportsSamplingProfiler.vm.isWasmSupported):
* stress/sampling-profiler-wasm.js:
(platformSupportsSamplingProfiler.vm.isWasmSupported):
* stress/sampling-profiler/samplingProfiler.js:
(doesTreeHaveStackTrace):
(runTest):
* wasm/function-tests/nameSection.js:

Source/JavaScriptCore:

This patch integrates normal CallLinkInfo into LLInt and remove adhoc LLIntCallLinkInfo.
So that we can simplify our IC software stack, and unifying call IC mechanism into one CallLinkInfo.

1. LLInt can fully use our polymorphic call IC, and we no longer need to reset call IC when
   tiering up from LLInt to Baseline JIT since both now uses the same CallLinkInfo data structure.
   DFG and FTL can also retrieve call information from this CallLinkInfo.
2. LLInt varargs calls get the same level of optimization to Baseline. Previously it does not have
   call IC.
3. When JIT is disabled, we disable polymorphic call IC since it requires dynamic code generation.
   In that case, we only use monomorphic one, which is the same to the old LLIntCallLinkInfo.
4. CallLinkInfo::doneLocation is set up only after Baseline JIT. We adjust call IC code so that
   we no longer rely on doneLocation when using DataIC. This allows us to smoothly tiering up
   from LLInt to Baseline JIT while using the same CallLinkInfo.
   We set up doneLocation in Baseline JIT just because DFG OSR exit requires when exiting to
   Baseline JIT code.
5. We remove CallLinkInfo from JIT constant pool, and we store CallLinkInfo in metadata so that
   LLInt and Baseline JIT quickly access to that and keeping unlinked Baseline JIT working.
6. We implement LLInt version of call IC thunks so that we can use them even when JIT is disabled.

Speedometer2 is neutral. JetStream2 is 0.7% progressed.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/CodeLocation.h:
* assembler/LinkBuffer.cpp:
(JSC::shouldDumpDisassemblyFor): Deleted.
* assembler/LinkBuffer.h:
* assembler/MacroAssemblerCodeRef.cpp:
(JSC::shouldDumpDisassemblyFor):
* assembler/MacroAssemblerCodeRef.h:
(JSC::MacroAssemblerCodePtr::dumpWithName const):
* bytecode/BytecodeList.rb:
* bytecode/BytecodeOperandsForCheckpoint.h:
(JSC::callLinkInfoFor):
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::clearStub):
(JSC::CallLinkInfo::setMonomorphicCallee):
(JSC::CallLinkInfo::clearCallee):
(JSC::CallLinkInfo::visitWeak):
(JSC::CallLinkInfo::emitFastPathImpl):
(JSC::CallLinkInfo::emitTailCallFastPath):
(JSC::CallLinkInfo::emitTailCallDataICFastPath):
(JSC::CallLinkInfo::emitSlowPath):
(JSC::CallLinkInfo::initializeDataIC):
(JSC::CallLinkInfo::emitDirectTailCallFastPath):
(JSC::CallLinkInfo::revertCallToStub):
* bytecode/CallLinkInfo.h:
(JSC::CallLinkInfo::isLinked const):
(JSC::CallLinkInfo::stub const):
(JSC::CallLinkInfo::updateMaxArgumentCountIncludingThis):
(JSC::CallLinkInfo::forEachDependentCell const):
(JSC::CallLinkInfo::setSlowStub): Deleted.
(JSC::CallLinkInfo::clearSlowStub): Deleted.
(JSC::CallLinkInfo::addressOfMaxArgumentCountIncludingThis): Deleted.
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::computeFor):
(JSC::CallLinkStatus::computeFromLLInt): Deleted.
* bytecode/CallLinkStatus.h:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::setupWithUnlinkedBaselineCode):
(JSC::CodeBlock::finalizeLLIntInlineCaches):
(JSC::CodeBlock::finalizeJITInlineCaches):
(JSC::CodeBlock::finalizeUnconditionally):
(JSC::CodeBlock::getICStatusMap):
(JSC::CodeBlock::getCallLinkInfoForBytecodeIndex):
(JSC::CodeBlock::linkIncomingCall):
(JSC::CodeBlock::unlinkIncomingCalls):
(JSC::CodeBlock::jettison):
(JSC::CodeBlock::getArrayProfile):
(JSC::CodeBlock::updateAllArrayProfilePredictions):
* bytecode/CodeBlock.h:
* bytecode/CodeBlockInlines.h:
(JSC::CodeBlock::forEachLLIntOrBaselineCallLinkInfo):
(JSC::CodeBlock::forEachLLIntCallLinkInfo): Deleted.
* bytecode/LLIntCallLinkInfo.h: Removed.
* bytecode/Opcode.h:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::allocateSharedProfiles):
* bytecode/UnlinkedCodeBlock.h:
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::callerReturnPC):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitVirtualCall):
(JSC::AssemblyHelpers::emitVirtualCallWithoutMovingGlobalObject):
* jit/AssemblyHelpers.h:
* jit/BaselineJITCode.h:
* jit/CallFrameShuffleData.cpp:
(JSC::CallFrameShuffleData::createForBaselineOrLLIntTailCall):
* jit/CallFrameShuffleData.h:
* jit/JIT.cpp:
(JSC::JIT::addUnlinkedCallLinkInfo):
(JSC::JIT::link):
* jit/JIT.h:
* jit/JITCall.cpp:
(JSC::JIT::emit_op_ret):
(JSC::JIT::returnFromBaselineGenerator):
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileTailCall):
(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):
* jit/JITOpcodes.cpp:
(JSC::JIT::op_ret_handlerGenerator): Deleted.
* jit/JITOperations.cpp:
(JSC::JSC_DEFINE_JIT_OPERATION):
(JSC::handleHostCall): Deleted.
(JSC::virtualForWithFunction): Deleted.
* jit/Repatch.cpp:
(JSC::linkSlowPathTo):
(JSC::linkSlowFor):
(JSC::webAssemblyOwner):
(JSC::linkMonomorphicCall):
(JSC::revertCall):
(JSC::unlinkCall):
(JSC::jsToWasmICCodePtr):
(JSC::linkVirtualFor):
(JSC::linkPolymorphicCall):
* jit/Repatch.h:
* jit/RepatchInlines.h: Added.
(JSC::handleHostCall):
(JSC::linkFor):
(JSC::virtualForWithFunction):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):
(JSC::virtualThunkForRegularConstruct): Deleted.
(JSC::virtualThunkForTailConstruct): Deleted.
(JSC::virtualThunkForConstructCall): Deleted.
* jit/ThunkGenerators.h:
* llint/LLIntData.cpp:
(JSC::LLInt::initialize):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::llint_link_call):
(JSC::LLInt::llint_virtual_call):
(JSC::LLInt::handleHostCall):
(JSC::LLInt::setUpCall):
(JSC::LLInt::varargsSetup):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(JSC::LLInt::commonCallEval):
(JSC::LLInt::genericCall): Deleted.
* llint/LLIntSlowPaths.h:
* llint/LLIntThunks.cpp:
(JSC::LLInt::createJSGateThunk):
(JSC::LLInt::createTailCallGate):
(JSC::LLInt::returnLocationThunk):
* llint/LLIntThunks.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter.cpp:
(JSC::CLoopRegister::operator CallLinkInfo*):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/cloop.rb:
* offlineasm/instructions.rb:
* runtime/ExecutableBase.h:
* runtime/FunctionExecutable.h:
* runtime/Gate.h:
* runtime/VM.cpp:
(JSC::VM::getCTILinkCall):
(JSC::VM::getCTIThrowExceptionFromCallSlowPath):
(JSC::VM::getCTIVirtualCall):
* runtime/VM.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@285795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
63 files changed
tree: 35bdc255636164d6fcca5e234985e45a2f163a6e
  1. JSTests/
  2. LayoutTests/
  3. ManualTests/
  4. metadata/
  5. PerformanceTests/
  6. resources/
  7. Source/
  8. Tools/
  9. WebDriverTests/
  10. WebKit.xcworkspace/
  11. WebKitLibraries/
  12. Websites/
  13. .ccls
  14. .clang-format
  15. .dir-locals.el
  16. .editorconfig
  17. .gitattributes
  18. .gitignore
  19. ChangeLog
  20. ChangeLog-2012-05-22
  21. ChangeLog-2018-01-01
  22. CMakeLists.txt
  23. Introduction.md
  24. Makefile
  25. Makefile.shared
  26. ReadMe.md
ReadMe.md

WebKit

WebKit is a cross-platform web browser engine. On iOS and macOS, it powers Safari, Mail, iBooks, and many other applications.

Feature Status

Visit WebKit Feature Status page to see which Web API has been implemented, in development, or under consideration.

Trying the Latest

On macOS, download Safari Technology Preview to test the latest version of WebKit. On Linux, download Epiphany Technology Preview. On Windows, you'll have to build it yourself.

Reporting Bugs

  1. Search WebKit Bugzilla to see if there is an existing report for the bug you've encountered.
  2. Create a Bugzilla account to to report bugs (and to comment on them) if you haven't done so already.
  3. File a bug in accordance with our guidelines.

Once your bug is filed, you will receive email when it is updated at each stage in the bug life cycle. After the bug is considered fixed, you may be asked to download the latest nightly and confirm that the fix works for you.

Getting the Code

On Windows, follow the instructions on our website.

Cloning the Git SVN Repository

Run the following command to clone WebKit's Git SVN repository:

git clone git@github.com:WebKit/WebKit.git WebKit

or

git clone https://github.com/WebKit/WebKit.git WebKit

If you want to be able to track Subversion revision from your git checkout, you can run the following command to do so:

Tools/Scripts/git-webkit setup-git-svn

For information about this, and other aspects of using Git with WebKit, read the wiki page.

Checking out the Subversion Repository

If you don‘t want to use Git, run the following command to check out WebKit’s Subversion repository:

svn checkout https://svn.webkit.org/repository/webkit/trunk WebKit

Building WebKit

Building macOS Port

Install Xcode and its command line tools if you haven't done so already:

  1. Install Xcode Get Xcode from https://developer.apple.com/downloads. To build WebKit for OS X, Xcode 5.1.1 or later is required. To build WebKit for iOS Simulator, Xcode 7 or later is required.
  2. Install the Xcode Command Line Tools In Terminal, run the command: xcode-select --install

Run the following command to build a debug build with debugging symbols and assertions:

Tools/Scripts/build-webkit --debug

For performance testing, and other purposes, use --release instead.

Using Xcode

You can open WebKit.xcworkspace to build and debug WebKit within Xcode.

If you don't use a custom build location in Xcode preferences, you have to update the workspace settings to use WebKitBuild directory. In menu bar, choose File > Workspace Settings, then click the Advanced button, select “Custom”, “Relative to Workspace”, and enter WebKitBuild for both Products and Intermediates.

Embedded Builds

iOS, tvOS and watchOS are all considered embedded builds. The first time after you install a new Xcode, you will need to run:

sudo Tools/Scripts/configure-xcode-for-embedded-development

Without this step, you will see the error message: “target specifies product type ‘com.apple.product-type.tool’, but there’s no such product type for the ‘iphonesimulator’ platform.” when building target JSCLLIntOffsetsExtractor of project JavaScriptCore.

Run the following command to build a debug build with debugging symbols and assertions for embededded simulators:

Tools/Scripts/build-webkit --debug --<platform>-simulator

or embedded devices:

Tools/Scripts/build-webkit --debug --<platform>-device

where platform is ios, tvos or watchos.

Building the GTK+ Port

For production builds:

cmake -DPORT=GTK -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja
ninja
sudo ninja install

For development builds:

Tools/gtk/install-dependencies
Tools/Scripts/update-webkitgtk-libs
Tools/Scripts/build-webkit --gtk --debug

For more information on building WebKitGTK+, see the wiki page.

Building the WPE Port

For production builds:

cmake -DPORT=WPE -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja
ninja
sudo ninja install

For development builds:

Tools/wpe/install-dependencies
Tools/Scripts/update-webkitwpe-libs
Tools/Scripts/build-webkit --wpe --debug

Building Windows Port

For building WebKit on Windows, see the wiki page.

Running WebKit

With Safari and Other macOS Applications

Run the following command to launch Safari with your local build of WebKit:

Tools/Scripts/run-safari --debug

The run-safari script sets the DYLD_FRAMEWORK_PATH environment variable to point to your build products, and then launches /Applications/Safari.app. DYLD_FRAMEWORK_PATH tells the system loader to prefer your build products over the frameworks installed in /System/Library/Frameworks.

To run other applications with your local build of WebKit, run the following command:

Tools/Scripts/run-webkit-app <application-path>

iOS Simulator

Run the following command to launch iOS simulator with your local build of WebKit:

run-safari --debug --ios-simulator

In both cases, if you have built release builds instead, use --release instead of --debug.

Linux Ports

If you have a development build, you can use the run-minibrowser script, e.g.:

run-minibrowser --debug --wpe

Pass one of --gtk, --jsc-only, or --wpe to indicate the port to use.

Contribute

Congratulations! You’re up and running. Now you can begin coding in WebKit and contribute your fixes and new features to the project. For details on submitting your code to the project, read Contributing Code.