source: webkit/trunk/Source/JavaScriptCore/jit/CallFrameShuffleData.h

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

[JSC] Remove m_calleeSaveRegisters from CodeBlock::JITData and rename it to BaselineJITData
https://bugs.webkit.org/show_bug.cgi?id=234555

Reviewed by Saam Barati.

This patch removes m_calleeSaveRegisters from CodeBlock::JITData, and moving it to each JITCode.
This is reasonable since m_calleeSaveRegisters information belongs to JITCode, not CodeBlock.
And in LLInt, Baseline, and DFG cases, m_calleeSaveRegisters is the same. So we do not have this
field in these JITCode. Only FTL can have m_calleeSaveRegisters.

By removing m_calleeSaveRegisters from CodeBlock::JITData, now it only includes Baseline JIT related
data. So this patch renames CodeBlock::JITData to BaselineJITData.

We also use TrailingArray for BaselineJITData so that we can remove one level indirection when loading
JITConstantPool from JITData.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::setupWithUnlinkedBaselineCode):
(JSC::CodeBlock::~CodeBlock):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::finalizeJITInlineCaches):
(JSC::CodeBlock::getICStatusMap):
(JSC::CodeBlock::findStubInfo):
(JSC::CodeBlock::resetBaselineJITData):
(JSC::CodeBlock::stronglyVisitStrongReferences):
(JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters):
(JSC::CodeBlock::findPC):
(JSC::CodeBlock::ensureJITDataSlow): Deleted.
(JSC::CodeBlock::setCalleeSaveRegisters): Deleted.
(JSC::CodeBlock::resetJITData): Deleted.
(JSC::CodeBlock::calleeSaveRegisters const): Deleted.

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::offsetOfBaselineJITData):
(JSC::CodeBlock::baselineJITData):
(JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters):
(JSC::CodeBlock::JITData::offsetOfJITConstantPool): Deleted.
(JSC::CodeBlock::ensureJITData): Deleted.
(JSC::CodeBlock::offsetOfJITData): Deleted.
(JSC::CodeBlock::baselineJITConstantPool): Deleted.

  • bytecode/Repatch.cpp:

(JSC::linkPolymorphicCall):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::emitRestoreCalleeSaves):
(JSC::DFG::JITCompiler::emitSaveCalleeSaves):

  • dfg/DFGOSREntry.cpp:

(JSC::DFG::prepareOSREntry):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::compileExit):

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::calleeSaveSlot):
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::adjustAndJumpToTarget):

  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::compileInThreadImpl):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::emitCall):

  • dfg/DFGStackLayoutPhase.cpp:

(JSC::DFG::StackLayoutPhase::run):

  • ftl/FTLCompile.cpp:

(JSC::FTL::compile):

  • ftl/FTLJITCode.h:

(JSC::FTL::JITCode::calleeSaveRegisters const):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::compileStub):

  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::Frame::calleeSaveRegistersForUnwinding):

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::executableFor):
(JSC::AssemblyHelpers::emitSaveOrCopyLLIntBaselineCalleeSavesFor):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::emitSaveThenMaterializeTagRegisters):
(JSC::AssemblyHelpers::emitSaveCalleeSavesFor): Deleted.
(JSC::AssemblyHelpers::emitRestoreCalleeSavesFor): Deleted.
(JSC::AssemblyHelpers::emitSaveCalleeSaves): Deleted.
(JSC::AssemblyHelpers::emitRestoreCalleeSaves): Deleted.

  • jit/BaselineJITCode.h:
  • jit/CallFrameShuffleData.cpp:
  • jit/CallFrameShuffleData.h:
  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):
(JSC::JIT::emitMaterializeMetadataAndConstantPoolRegisters):
(JSC::JIT::emitSaveCalleeSaves):
(JSC::JIT::compileAndLinkWithoutFinalizing):

  • jit/JIT.h:
  • jit/JITCode.cpp:

(JSC::JITCode::calleeSaveRegisters const):

  • jit/JITCode.h:
  • jit/JITInlines.h:

(JSC::JIT::loadConstant):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_catch):

  • jit/RegisterAtOffsetList.cpp:

(JSC::RegisterAtOffsetList::dfgCalleeSaveRegisters):

  • jit/RegisterAtOffsetList.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter.asm:
  • tools/VMInspector.cpp:

(JSC::VMInspector::dumpRegisters):

File size: 2.1 KB
Line 
1/*
2 * Copyright (C) 2015-2019 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#pragma once
27
28#if ENABLE(JIT)
29
30#include "RegisterMap.h"
31#include "ValueRecovery.h"
32
33namespace JSC {
34
35struct OpTailCall;
36
37struct CallFrameShuffleData {
38 WTF_MAKE_FAST_ALLOCATED;
39public:
40 void shrinkToFit()
41 {
42 args.shrinkToFit();
43 }
44
45 static CallFrameShuffleData createForBaselineOrLLIntTailCall(const OpTailCall&, unsigned numParameters);
46
47 Vector<ValueRecovery> args;
48 unsigned numLocals { UINT_MAX };
49 unsigned numPassedArgs { UINT_MAX };
50 unsigned numParameters { UINT_MAX }; // On our machine frame.
51 RegisterMap<ValueRecovery> registers;
52#if USE(JSVALUE64)
53 GPRReg numberTagRegister { InvalidGPRReg };
54#endif
55
56 void setupCalleeSaveRegisters(const RegisterAtOffsetList*);
57 ValueRecovery callee;
58};
59
60} // namespace JSC
61
62#endif // ENABLE(JIT)
Note: See TracBrowser for help on using the repository browser.