source: webkit/trunk/Source/JavaScriptCore/jit/Reg.cpp

Last change on this file was 236381, checked in by [email protected], 7 years ago

[JSC] Enable LLInt ASM interpreter on X64 and ARM64 in non JIT configuration
https://bugs.webkit.org/show_bug.cgi?id=189778

Reviewed by Keith Miller.

.:

ENABLE_SAMPLING_PROFILER does not depend on ENABLE_JIT now since it can be
used with LLInt ASM interpreter.

  • Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

LLInt ASM interpreter is 2x and 15% faster than CLoop interpreter on
Linux and macOS respectively. We would like to enable it for non JIT
configurations in X86_64 and ARM64.

This patch enables LLInt for non JIT builds in X86_64 and ARM64 architectures.
Previously, we switch LLInt ASM interpreter and CLoop by using ENABLE(JIT)
configuration. But it is wrong in the new scenario since we have a build
configuration that uses LLInt ASM interpreter and JIT is disabled. We introduce
ENABLE(C_LOOP) option, which represents that we use CLoop. And we replace
ENABLE(JIT) with ENABLE(C_LOOP) if the previous ENABLE(JIT) is essentially just
related to LLInt ASM interpreter and not related to JIT.

We also replace some ENABLE(JIT) configurations with ENABLE(ASSEMBLER).
ENABLE(ASSEMBLER) is now enabled even if we disable JIT since MacroAssembler
has machine register information that is used in LLInt ASM interpreter.

  • API/tests/PingPongStackOverflowTest.cpp:

(testPingPongStackOverflow):

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/MaxFrameExtentForSlowPathCall.h:
  • bytecode/CallReturnOffsetToBytecodeOffset.h: Removed. It is no longer used.
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::finishCreation):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::calleeSaveRegisters const):
(JSC::CodeBlock::numberOfLLIntBaselineCalleeSaveRegisters):
(JSC::CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters):
(JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters):

  • bytecode/Opcode.h:

(JSC::padOpcodeName):

  • heap/Heap.cpp:

(JSC::Heap::gatherJSStackRoots):
(JSC::Heap::stopThePeriphery):

  • interpreter/CLoopStack.cpp:
  • interpreter/CLoopStack.h:
  • interpreter/CLoopStackInlines.h:
  • interpreter/EntryFrame.h:
  • interpreter/Interpreter.cpp:

(JSC::Interpreter::Interpreter):
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):

  • interpreter/Interpreter.h:
  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::Frame::calleeSaveRegisters):

  • interpreter/VMEntryRecord.h:
  • jit/ExecutableAllocator.h:
  • jit/FPRInfo.h:

(WTF::printInternal):

  • jit/GPRInfo.cpp:
  • jit/GPRInfo.h:

(WTF::printInternal):

  • jit/HostCallReturnValue.cpp:

(JSC::getHostCallReturnValueWithExecState): Moved. They are used in LLInt ASM interpreter too.

  • jit/HostCallReturnValue.h:
  • jit/JITOperations.cpp:

(JSC::getHostCallReturnValueWithExecState): Deleted.

  • jit/JITOperationsMSVC64.cpp:
  • jit/Reg.cpp:
  • jit/Reg.h:
  • jit/RegisterAtOffset.cpp:
  • jit/RegisterAtOffset.h:
  • jit/RegisterAtOffsetList.cpp:
  • jit/RegisterAtOffsetList.h:
  • jit/RegisterMap.h:
  • jit/RegisterSet.cpp:
  • jit/RegisterSet.h:
  • jit/TempRegisterSet.cpp:
  • jit/TempRegisterSet.h:
  • llint/LLIntCLoop.cpp:
  • llint/LLIntCLoop.h:
  • llint/LLIntData.cpp:

(JSC::LLInt::initialize):
(JSC::LLInt::Data::performAssertions):

  • llint/LLIntData.h:
  • llint/LLIntOfflineAsmConfig.h:
  • llint/LLIntOpcode.h:
  • llint/LLIntPCRanges.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LLIntSlowPaths.h:
  • llint/LLIntThunks.cpp:
  • llint/LowLevelInterpreter.cpp:
  • llint/LowLevelInterpreter.h:
  • runtime/JSCJSValue.h:
  • runtime/MachineContext.h:
  • runtime/SamplingProfiler.cpp:

(JSC::SamplingProfiler::processUnverifiedStackTraces): Enable SamplingProfiler
for LLInt ASM interpreter with non JIT configuration.

  • runtime/TestRunnerUtils.cpp:

(JSC::optimizeNextInvocation):

  • runtime/VM.cpp:

(JSC::VM::VM):
(JSC::VM::getHostFunction):
(JSC::VM::updateSoftReservedZoneSize):
(JSC::sanitizeStackForVM):
(JSC::VM::committedStackByteCount):

  • runtime/VM.h:
  • runtime/VMInlines.h:

(JSC::VM::ensureStackCapacityFor):
(JSC::VM::isSafeToRecurseSoft const):

Source/WTF:

This patch adds ENABLE(C_LOOP) which indicates we use CLoop as the interpreter.
Previously, we used !ENABLE(JIT) for this configuration. But now, we have
a build configuration that has LLInt ASM interpreter (not CLoop) and !ENABLE(JIT).

We enable LLInt ASM interpreter for non JIT environment in X86_64 and ARM64 architectures.
And we enable ENABLE(ASSEMBLER) for non JIT environment since it offers machine register
information which is used for LLInt and SamplingProfiler.

  • wtf/Platform.h:
File size: 1.8 KB
Line 
1/*
2 * Copyright (C) 2014, 2016 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include "config.h"
27#include "Reg.h"
28
29#if ENABLE(ASSEMBLER)
30
31#include "FPRInfo.h"
32#include "GPRInfo.h"
33
34namespace JSC {
35
36const char* Reg::debugName() const
37{
38 if (!*this)
39 return nullptr;
40 if (isGPR())
41 return GPRInfo::debugName(gpr());
42 return FPRInfo::debugName(fpr());
43}
44
45void Reg::dump(PrintStream& out) const
46{
47 if (!*this)
48 out.print("<none>");
49 else if (isGPR())
50 out.print(gpr());
51 else
52 out.print(fpr());
53}
54
55} // namespace JSC
56
57#endif // ENABLE(ASSEMBLER)
58
Note: See TracBrowser for help on using the repository browser.