oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 1 | /* |
fpizlo@apple.com | 9339889 | 2015-07-10 21:19:51 +0000 | [diff] [blame] | 2 | * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 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 | |
ryanhaddad@apple.com | 22104f5 | 2016-09-28 17:08:17 +0000 | [diff] [blame] | 26 | #pragma once |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 27 | |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 28 | #if ENABLE(FTL_JIT) |
| 29 | |
fpizlo@apple.com | e362fbc | 2015-12-03 20:01:57 +0000 | [diff] [blame] | 30 | #include "B3OpaqueByproducts.h" |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 31 | #include "DFGCommonData.h" |
fpizlo@apple.com | 6e69796 | 2015-10-12 17:56:26 +0000 | [diff] [blame] | 32 | #include "FTLLazySlowPath.h" |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 33 | #include "FTLOSRExit.h" |
| 34 | #include "JITCode.h" |
| 35 | |
fpizlo@apple.com | 9339889 | 2015-07-10 21:19:51 +0000 | [diff] [blame] | 36 | namespace JSC { |
| 37 | |
| 38 | class TrackedReferences; |
| 39 | |
| 40 | namespace FTL { |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 41 | |
| 42 | class JITCode : public JSC::JITCode { |
| 43 | public: |
| 44 | JITCode(); |
| 45 | ~JITCode(); |
fpizlo@apple.com | f74e4ae | 2015-11-18 23:05:34 +0000 | [diff] [blame] | 46 | |
commit-queue@webkit.org | 2cb9c25 | 2016-12-13 19:38:13 +0000 | [diff] [blame^] | 47 | CodePtr addressForCall(ArityCheckMode) override; |
msaboff@apple.com | 9589433 | 2014-01-29 19:18:54 +0000 | [diff] [blame] | 48 | void* executableAddressAtOffset(size_t offset) override; |
| 49 | void* dataAddressAtOffset(size_t offset) override; |
| 50 | unsigned offsetOf(void* pointerIntoCode) override; |
| 51 | size_t size() override; |
| 52 | bool contains(void*) override; |
fpizlo@apple.com | f74e4ae | 2015-11-18 23:05:34 +0000 | [diff] [blame] | 53 | |
fpizlo@apple.com | f74e4ae | 2015-11-18 23:05:34 +0000 | [diff] [blame] | 54 | void initializeB3Code(CodeRef); |
fpizlo@apple.com | e362fbc | 2015-12-03 20:01:57 +0000 | [diff] [blame] | 55 | void initializeB3Byproducts(std::unique_ptr<B3::OpaqueByproducts>); |
commit-queue@webkit.org | 2cb9c25 | 2016-12-13 19:38:13 +0000 | [diff] [blame^] | 56 | void initializeAddressForCall(CodePtr); |
| 57 | void initializeArityCheckEntrypoint(CodeRef); |
| 58 | |
fpizlo@apple.com | 9339889 | 2015-07-10 21:19:51 +0000 | [diff] [blame] | 59 | void validateReferences(const TrackedReferences&) override; |
sbarati@apple.com | 9aacac4 | 2015-10-08 19:37:28 +0000 | [diff] [blame] | 60 | |
| 61 | RegisterSet liveRegistersToPreserveAtExceptionHandlingCallSite(CodeBlock*, CallSiteIndex) override; |
fpizlo@apple.com | f74e4ae | 2015-11-18 23:05:34 +0000 | [diff] [blame] | 62 | |
utatane.tea@gmail.com | 4392696 | 2016-11-27 06:08:16 +0000 | [diff] [blame] | 63 | std::optional<CodeOrigin> findPC(CodeBlock*, void* pc) override; |
sbarati@apple.com | d3d0c00 | 2016-01-30 01:11:05 +0000 | [diff] [blame] | 64 | |
fpizlo@apple.com | f74e4ae | 2015-11-18 23:05:34 +0000 | [diff] [blame] | 65 | CodeRef b3Code() const { return m_b3Code; } |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 66 | |
andersca@apple.com | e782bf1 | 2014-12-06 21:04:31 +0000 | [diff] [blame] | 67 | JITCode* ftl() override; |
| 68 | DFG::CommonData* dfgCommon() override; |
sbarati@apple.com | a582c18 | 2015-12-05 00:04:01 +0000 | [diff] [blame] | 69 | static ptrdiff_t commonDataOffset() { return OBJECT_OFFSETOF(JITCode, common); } |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 70 | |
| 71 | DFG::CommonData common; |
| 72 | SegmentedVector<OSRExit, 8> osrExit; |
sbarati@apple.com | cda241d | 2015-10-19 20:29:45 +0000 | [diff] [blame] | 73 | SegmentedVector<OSRExitDescriptor, 8> osrExitDescriptors; |
fpizlo@apple.com | 6e69796 | 2015-10-12 17:56:26 +0000 | [diff] [blame] | 74 | Vector<std::unique_ptr<LazySlowPath>> lazySlowPaths; |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 75 | |
| 76 | private: |
fpizlo@apple.com | f74e4ae | 2015-11-18 23:05:34 +0000 | [diff] [blame] | 77 | CodePtr m_addressForCall; |
fpizlo@apple.com | f74e4ae | 2015-11-18 23:05:34 +0000 | [diff] [blame] | 78 | CodeRef m_b3Code; |
fpizlo@apple.com | e362fbc | 2015-12-03 20:01:57 +0000 | [diff] [blame] | 79 | std::unique_ptr<B3::OpaqueByproducts> m_b3Byproducts; |
commit-queue@webkit.org | 2cb9c25 | 2016-12-13 19:38:13 +0000 | [diff] [blame^] | 80 | CodeRef m_arityCheckEntrypoint; |
oliver@apple.com | ea77149 | 2013-07-25 03:58:38 +0000 | [diff] [blame] | 81 | }; |
| 82 | |
| 83 | } } // namespace JSC::FTL |
| 84 | |
| 85 | #endif // ENABLE(FLT_JIT) |