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

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

[JSC] Implement a B3::Compilation replacement for wasm-llint
https://bugs.webkit.org/show_bug.cgi?id=220585

Patch by Xan López <Xan Lopez> on 2021-01-18
Reviewed by Yusuke Suzuki.

Move B3Compilation, B3OpaqueByproducts and B3OpaqueByproduct to
jit/. They are used by non-B3 code and they are not really B3
specific. Also rename B3CompilationPtrTag to JITCompilationPtrTag.

  • CMakeLists.txt: add new source files.
  • JavaScriptCore.xcodeproj/project.pbxproj: ditto.
  • Sources.txt: ditto.
  • b3/B3Compile.cpp:

(JSC::B3::compile): use JITCompilationPtrTag.

  • b3/B3Compile.h: change includes.
  • b3/B3DataSection.h: ditto.
  • b3/B3Procedure.cpp: ditto.
  • b3/B3Procedure.h: ditto.
  • b3/air/testair.cpp: use JITCompilationPtrTag.
  • b3/testb3.h: change includes.

(invoke):

  • b3/testb3_6.cpp:

(testInterpreter): use JITCompilationPtrTag.
(testEntrySwitchSimple): ditto.
(testEntrySwitchNoEntrySwitch): ditto.
(testEntrySwitchWithCommonPaths): ditto.
(testEntrySwitchWithCommonPathsAndNonTrivialEntrypoint): ditto.
(testEntrySwitchLoop): ditto.

  • ftl/FTLJITCode.h: use JSC::OpaqueByproducts.
  • ftl/FTLOutput.h: change includes.
  • jit/JITCompilation.cpp: Renamed from Source/JavaScriptCore/b3/B3Compilation.cpp.

(JSC::Compilation::Compilation):

  • jit/JITCompilation.h: Renamed from Source/JavaScriptCore/b3/B3Compilation.h.

(JSC::Compilation::code const):
(JSC::Compilation::codeRef const):

  • jit/JITOpaqueByproduct.h: Renamed from Source/JavaScriptCore/b3/B3OpaqueByproduct.h.
  • jit/JITOpaqueByproducts.cpp: Renamed from Source/JavaScriptCore/b3/B3OpaqueByproducts.cpp.
  • jit/JITOpaqueByproducts.h: Renamed from Source/JavaScriptCore/b3/B3OpaqueByproducts.h.
  • runtime/JSCPtrTag.h: rename B3CompilationPtrTag to JITCompilationPtrTag.
  • wasm/WasmB3IRGenerator.h: use JSC::OpaqueByproducts.
  • wasm/WasmBBQPlan.cpp: use JSC::Compilation.

(JSC::Wasm::BBQPlan::work):
(JSC::Wasm::BBQPlan::didCompleteCompilation):

  • wasm/WasmBinding.h: change includes.
  • wasm/WasmCallee.h: ditto.
  • wasm/WasmFormat.h: use JSC::Compilation.
  • wasm/WasmLLIntPlan.cpp: ditto.

(JSC::Wasm::LLIntPlan::didCompleteCompilation):

  • wasm/WasmLLIntPlan.h: use JITCompilationPtrTag.
  • wasm/WasmModule.h: ditto.
  • wasm/WasmOMGForOSREntryPlan.cpp: use JSC::Compilation.

(JSC::Wasm::OMGForOSREntryPlan::work):

  • wasm/WasmOMGPlan.cpp: ditto.

(JSC::Wasm::OMGPlan::work):

  • wasm/WasmParser.h: change includes.
  • wasm/js/WasmToJS.h: ditto.
File size: 1.8 KB
Line 
1/*
2 * Copyright (C) 2015-2018 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 "JITCompilation.h"
28
29#if ENABLE(JIT)
30
31#include "JITOpaqueByproducts.h"
32
33namespace JSC {
34
35Compilation::Compilation(MacroAssemblerCodeRef<JITCompilationPtrTag> codeRef, std::unique_ptr<OpaqueByproducts> byproducts)
36 : m_codeRef(codeRef)
37 , m_byproducts(WTFMove(byproducts))
38{
39}
40
41Compilation::Compilation(Compilation&& other)
42 : m_codeRef(WTFMove(other.m_codeRef))
43 , m_byproducts(WTFMove(other.m_byproducts))
44{
45}
46
47Compilation::~Compilation()
48{
49}
50
51} // namespace JSC
52
53#endif // ENABLE(JIT)
54
Note: See TracBrowser for help on using the repository browser.