Move JSC::Register inline methods into RegisterInlines.h.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2019 06:59:36 +0000 (06:59 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Oct 2019 06:59:36 +0000 (06:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=203391

Reviewed by Yusuke Suzuki and Keith Miller.

Source/JavaScriptCore:

We're doing this because:
1. RegisterInlines.h is the canonical place to put inline Register methods.
2. It helps reduce build time.
   e.g. build-jsc went from 208.02 to 196.81 seconds (about a 5% reduction).
3. This enables experimental work to box JSCells in JSValue.

This patch also handles the fallout of this change, which necessitates more
inline methods being moved from <file>.h to their respective <file>Inlines.h.

JSArray.h used to include ButterflyInlines.h and JSCellInlines.h.  This is a
violation of inclusion ordering (.h should not #include Inlines.h).  This
violation has been removed.

* API/JSAPIGlobalObject.mm:
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.h:
(JSC::CallFrame::r): Deleted.
(JSC::CallFrame::uncheckedR): Deleted.
* bytecode/MetadataTable.cpp:
* ftl/FTLLowerDFGToB3.cpp:
* interpreter/CallFrame.h:
(JSC::CallFrame::guaranteedJSValueCallee const): Deleted.
(JSC::CallFrame::jsCallee const): Deleted.
(JSC::CallFrame::codeBlock const): Deleted.
(JSC::CallFrame::unsafeCodeBlock const): Deleted.
(JSC::CallFrame::scope const): Deleted.
(JSC::CallFrame::topOfFrame): Deleted.
(JSC::CallFrame::setScope): Deleted.
(JSC::CallFrame::setCallee): Deleted.
(JSC::CallFrame::setCodeBlock): Deleted.
* interpreter/CallFrameInlines.h:
(JSC::CallFrame::r):
(JSC::CallFrame::uncheckedR):
(JSC::CallFrame::guaranteedJSValueCallee const):
(JSC::CallFrame::jsCallee const):
(JSC::CallFrame::codeBlock const):
(JSC::CallFrame::unsafeCodeBlock const):
(JSC::CallFrame::lexicalGlobalObject const):
(JSC::CallFrame::setCallee):
(JSC::CallFrame::setCodeBlock):
(JSC::CallFrame::setScope):
(JSC::CallFrame::scope const):
(JSC::CallFrame::topOfFrame):
* interpreter/Interpreter.cpp:
* interpreter/ProtoCallFrame.h:
(JSC::ProtoCallFrame::init): Deleted.
* interpreter/ProtoCallFrameInlines.h: Added.
(JSC::ProtoCallFrame::init):
(JSC::ProtoCallFrame::callee const):
(JSC::ProtoCallFrame::setCallee):
(JSC::ProtoCallFrame::codeBlock const):
(JSC::ProtoCallFrame::setCodeBlock):
* interpreter/Register.h:
(JSC::Register::callFrame const): Deleted.
(JSC::Register::codeBlock const): Deleted.
(JSC::Register::asanUnsafeCodeBlock const): Deleted.
* interpreter/RegisterInlines.h: Added.
(JSC::Register::callFrame const):
(JSC::Register::codeBlock const):
(JSC::Register::asanUnsafeCodeBlock const):
(JSC::Register::object const):
(JSC::Register::operator=):
(JSC::Register::scope const):
* interpreter/StackVisitor.cpp:
* jit/AssemblyHelpers.h:
* llint/LLIntSlowPaths.cpp:
* runtime/ArrayStorage.h:
(JSC::ArrayStorage::optimalVectorLength): Deleted.
* runtime/ArrayStorageInlines.h: Added.
(JSC::ArrayStorage::availableVectorLength):
(JSC::ArrayStorage::optimalVectorLength):
(JSC::ArrayStorage::totalSize const):
* runtime/ButterflyInlines.h:
* runtime/ClassInfo.h:
* runtime/GetVM.h: Added.
* runtime/JSArray.h:
* runtime/JSArrayInlines.h:
* runtime/JSCellInlines.h:
* runtime/JSGlobalObject.h:
* runtime/JSObject.h:
(JSC::Register::object const): Deleted.
(JSC::Register::operator=): Deleted.
* runtime/JSObjectInlines.h:
* runtime/JSScope.h:
(JSC::Register::operator=): Deleted.
(JSC::Register::scope const): Deleted.
(JSC::CallFrame::lexicalGlobalObject const): Deleted.
* runtime/JSString.h:
* runtime/PropertyNameArray.h:
* runtime/PropertySlot.h:
* runtime/VMInlines.h:
* tools/HeapVerifier.cpp:
* wasm/js/WebAssemblyFunction.cpp:

Source/WebCore:

No new tests needed because there is no behavior change.

* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251584 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 files changed:
Source/JavaScriptCore/API/JSAPIGlobalObject.mm
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/bytecode/CodeBlock.h
Source/JavaScriptCore/bytecode/MetadataTable.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/interpreter/CallFrame.h
Source/JavaScriptCore/interpreter/CallFrameInlines.h
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/interpreter/ProtoCallFrame.h
Source/JavaScriptCore/interpreter/ProtoCallFrameInlines.h [new file with mode: 0644]
Source/JavaScriptCore/interpreter/Register.h
Source/JavaScriptCore/interpreter/RegisterInlines.h [new file with mode: 0644]
Source/JavaScriptCore/interpreter/StackVisitor.cpp
Source/JavaScriptCore/jit/AssemblyHelpers.h
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/runtime/ArrayStorage.h
Source/JavaScriptCore/runtime/ArrayStorageInlines.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/ButterflyInlines.h
Source/JavaScriptCore/runtime/ClassInfo.h
Source/JavaScriptCore/runtime/GetVM.h [new file with mode: 0644]
Source/JavaScriptCore/runtime/JSArray.h
Source/JavaScriptCore/runtime/JSArrayInlines.h
Source/JavaScriptCore/runtime/JSCellInlines.h
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSObject.h
Source/JavaScriptCore/runtime/JSObjectInlines.h
Source/JavaScriptCore/runtime/JSScope.h
Source/JavaScriptCore/runtime/JSString.h
Source/JavaScriptCore/runtime/PropertyNameArray.h
Source/JavaScriptCore/runtime/PropertySlot.h
Source/JavaScriptCore/runtime/VMInlines.h
Source/JavaScriptCore/tools/HeapVerifier.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm

index 5cd9b38..f619bda 100644 (file)
@@ -29,6 +29,7 @@
 #if JSC_OBJC_API_ENABLED
 
 #import "APICast.h"
+#import "CallFrameInlines.h"
 #import "CatchScope.h"
 #import "Completion.h"
 #import "Error.h"
index ce1b8c3..4823817 100644 (file)
@@ -678,6 +678,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
     interpreter/EntryFrame.h
     interpreter/FrameTracers.h
     interpreter/Register.h
+    interpreter/RegisterInlines.h
     interpreter/ShadowChicken.h
     interpreter/StackVisitor.h
     interpreter/VMEntryRecord.h
@@ -752,6 +753,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
     runtime/ArrayConventions.h
     runtime/ArrayPrototype.h
     runtime/ArrayStorage.h
+    runtime/ArrayStorageInlines.h
     runtime/AuxiliaryBarrier.h
     runtime/AuxiliaryBarrierInlines.h
     runtime/BasicBlockLocation.h
@@ -821,6 +823,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
     runtime/GenericTypedArrayView.h
     runtime/GenericTypedArrayViewInlines.h
     runtime/GetPutInfo.h
+    runtime/GetVM.h
     runtime/GlobalExecutable.h
     runtime/HashMapImpl.h
     runtime/Identifier.h
index 25e4bd8..dea4d7f 100644 (file)
@@ -1,3 +1,105 @@
+2019-10-24  Mark Lam  <mark.lam@apple.com>
+
+        Move JSC::Register inline methods into RegisterInlines.h.
+        https://bugs.webkit.org/show_bug.cgi?id=203391
+
+        Reviewed by Yusuke Suzuki and Keith Miller.
+
+        We're doing this because:
+        1. RegisterInlines.h is the canonical place to put inline Register methods.
+        2. It helps reduce build time.
+           e.g. build-jsc went from 208.02 to 196.81 seconds (about a 5% reduction).
+        3. This enables experimental work to box JSCells in JSValue.
+
+        This patch also handles the fallout of this change, which necessitates more
+        inline methods being moved from <file>.h to their respective <file>Inlines.h.
+
+        JSArray.h used to include ButterflyInlines.h and JSCellInlines.h.  This is a
+        violation of inclusion ordering (.h should not #include Inlines.h).  This
+        violation has been removed.
+
+        * API/JSAPIGlobalObject.mm:
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bytecode/CodeBlock.h:
+        (JSC::CallFrame::r): Deleted.
+        (JSC::CallFrame::uncheckedR): Deleted.
+        * bytecode/MetadataTable.cpp:
+        * ftl/FTLLowerDFGToB3.cpp:
+        * interpreter/CallFrame.h:
+        (JSC::CallFrame::guaranteedJSValueCallee const): Deleted.
+        (JSC::CallFrame::jsCallee const): Deleted.
+        (JSC::CallFrame::codeBlock const): Deleted.
+        (JSC::CallFrame::unsafeCodeBlock const): Deleted.
+        (JSC::CallFrame::scope const): Deleted.
+        (JSC::CallFrame::topOfFrame): Deleted.
+        (JSC::CallFrame::setScope): Deleted.
+        (JSC::CallFrame::setCallee): Deleted.
+        (JSC::CallFrame::setCodeBlock): Deleted.
+        * interpreter/CallFrameInlines.h:
+        (JSC::CallFrame::r):
+        (JSC::CallFrame::uncheckedR):
+        (JSC::CallFrame::guaranteedJSValueCallee const):
+        (JSC::CallFrame::jsCallee const):
+        (JSC::CallFrame::codeBlock const):
+        (JSC::CallFrame::unsafeCodeBlock const):
+        (JSC::CallFrame::lexicalGlobalObject const):
+        (JSC::CallFrame::setCallee):
+        (JSC::CallFrame::setCodeBlock):
+        (JSC::CallFrame::setScope):
+        (JSC::CallFrame::scope const):
+        (JSC::CallFrame::topOfFrame):
+        * interpreter/Interpreter.cpp:
+        * interpreter/ProtoCallFrame.h:
+        (JSC::ProtoCallFrame::init): Deleted.
+        * interpreter/ProtoCallFrameInlines.h: Added.
+        (JSC::ProtoCallFrame::init):
+        (JSC::ProtoCallFrame::callee const):
+        (JSC::ProtoCallFrame::setCallee):
+        (JSC::ProtoCallFrame::codeBlock const):
+        (JSC::ProtoCallFrame::setCodeBlock):
+        * interpreter/Register.h:
+        (JSC::Register::callFrame const): Deleted.
+        (JSC::Register::codeBlock const): Deleted.
+        (JSC::Register::asanUnsafeCodeBlock const): Deleted.
+        * interpreter/RegisterInlines.h: Added.
+        (JSC::Register::callFrame const):
+        (JSC::Register::codeBlock const):
+        (JSC::Register::asanUnsafeCodeBlock const):
+        (JSC::Register::object const):
+        (JSC::Register::operator=):
+        (JSC::Register::scope const):
+        * interpreter/StackVisitor.cpp:
+        * jit/AssemblyHelpers.h:
+        * llint/LLIntSlowPaths.cpp:
+        * runtime/ArrayStorage.h:
+        (JSC::ArrayStorage::optimalVectorLength): Deleted.
+        * runtime/ArrayStorageInlines.h: Added.
+        (JSC::ArrayStorage::availableVectorLength):
+        (JSC::ArrayStorage::optimalVectorLength):
+        (JSC::ArrayStorage::totalSize const):
+        * runtime/ButterflyInlines.h:
+        * runtime/ClassInfo.h:
+        * runtime/GetVM.h: Added.
+        * runtime/JSArray.h:
+        * runtime/JSArrayInlines.h:
+        * runtime/JSCellInlines.h:
+        * runtime/JSGlobalObject.h:
+        * runtime/JSObject.h:
+        (JSC::Register::object const): Deleted.
+        (JSC::Register::operator=): Deleted.
+        * runtime/JSObjectInlines.h:
+        * runtime/JSScope.h:
+        (JSC::Register::operator=): Deleted.
+        (JSC::Register::scope const): Deleted.
+        (JSC::CallFrame::lexicalGlobalObject const): Deleted.
+        * runtime/JSString.h:
+        * runtime/PropertyNameArray.h:
+        * runtime/PropertySlot.h:
+        * runtime/VMInlines.h:
+        * tools/HeapVerifier.cpp:
+        * wasm/js/WebAssemblyFunction.cpp:
+
 2019-10-24  Zan Dobersek  <zdobersek@igalia.com>
 
         REGRESSION(r251468): Build, test failures in 32-bit JSC after BytecodeIndex refactoring
index e664e40..c7fe3a3 100644 (file)
                FE1BD0211E72027900134BC9 /* CellProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1BD0201E72027000134BC9 /* CellProfile.h */; };
                FE1BD0251E72053800134BC9 /* HeapVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1BD0231E72052F00134BC9 /* HeapVerifier.h */; };
                FE1C0FFD1B193E9800B53FCA /* Exception.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1C0FFC1B193E9800B53FCA /* Exception.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               FE1D6D6D2362544B007A5C26 /* RegisterInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1D6D6C2362544A007A5C26 /* RegisterInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               FE1D6D6F236258FE007A5C26 /* GetVM.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1D6D6E236258FE007A5C26 /* GetVM.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               FE1D6D7123625AB1007A5C26 /* ArrayStorageInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1D6D7023625AB0007A5C26 /* ArrayStorageInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               FE1D6D752362649F007A5C26 /* ProtoCallFrameInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1D6D742362649D007A5C26 /* ProtoCallFrameInlines.h */; };
                FE1E2C3F2240DD5800F6B729 /* MacroAssemblerARM64E.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1E2C3E2240D30B00F6B729 /* MacroAssemblerARM64E.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FE1E2C402240DD6200F6B729 /* ARM64EAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1E2C3D2240D2F600F6B729 /* ARM64EAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FE20CE9E15F04A9500DF3430 /* LLIntCLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FE1BD0231E72052F00134BC9 /* HeapVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeapVerifier.h; sourceTree = "<group>"; };
                FE1C0FFC1B193E9800B53FCA /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = "<group>"; };
                FE1C0FFE1B194FD100B53FCA /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Exception.cpp; sourceTree = "<group>"; };
+               FE1D6D6C2362544A007A5C26 /* RegisterInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterInlines.h; sourceTree = "<group>"; };
+               FE1D6D6E236258FE007A5C26 /* GetVM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetVM.h; sourceTree = "<group>"; };
+               FE1D6D7023625AB0007A5C26 /* ArrayStorageInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayStorageInlines.h; sourceTree = "<group>"; };
+               FE1D6D742362649D007A5C26 /* ProtoCallFrameInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtoCallFrameInlines.h; sourceTree = "<group>"; };
                FE1E2C3C2240C1EF00F6B729 /* JSCPtrTag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCPtrTag.cpp; sourceTree = "<group>"; };
                FE1E2C3D2240D2F600F6B729 /* ARM64EAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARM64EAssembler.h; sourceTree = "<group>"; };
                FE1E2C3E2240D30B00F6B729 /* MacroAssemblerARM64E.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerARM64E.h; sourceTree = "<group>"; };
                                1429D77B0ED20D7300B89619 /* Interpreter.h */,
                                E39D9D841D39000600667282 /* InterpreterInlines.h */,
                                65FB5115184EE8F800C12B70 /* ProtoCallFrame.h */,
+                               FE1D6D742362649D007A5C26 /* ProtoCallFrameInlines.h */,
                                149B24FF0D8AF6D1009CB8C7 /* Register.h */,
+                               FE1D6D6C2362544A007A5C26 /* RegisterInlines.h */,
                                DC17E8131C9C7FD4008A6AB3 /* ShadowChicken.cpp */,
                                DC17E8141C9C7FD4008A6AB3 /* ShadowChicken.h */,
                                DC17E8151C9C7FD4008A6AB3 /* ShadowChickenInlines.h */,
                                F692A84D0255597D01FF60F7 /* ArrayPrototype.cpp */,
                                F692A84E0255597D01FF60F7 /* ArrayPrototype.h */,
                                0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */,
+                               FE1D6D7023625AB0007A5C26 /* ArrayStorageInlines.h */,
                                8B6016F31F3E3CC000F9DE6A /* AsyncFromSyncIteratorPrototype.cpp */,
                                8B6016F41F3E3CC000F9DE6A /* AsyncFromSyncIteratorPrototype.h */,
                                5B70CFDD1DB69E5C00EC23F9 /* AsyncFunctionConstructor.cpp */,
                                0F2B66B317B6B5AB00A7AE3F /* GenericTypedArrayViewInlines.h */,
                                14788EE521501B2900A561C8 /* GetPutInfo.cpp */,
                                796465681B952FF0003059EE /* GetPutInfo.h */,
+                               FE1D6D6E236258FE007A5C26 /* GetVM.h */,
                                BC02E9B80E184545000F9297 /* GetterSetter.cpp */,
                                BC337BDE0E1AF0B80076918A /* GetterSetter.h */,
                                E355D38E2244686C008F1AD6 /* GlobalExecutable.cpp */,
                                0FEC85041BDACDAC0080FF74 /* B3BlockWorklist.h in Headers */,
                                DCFDFBD91D1F5D9B00FE3D72 /* B3BottomProvider.h in Headers */,
                                0F6B8AE31C4EFE1700969052 /* B3BreakCriticalEdges.h in Headers */,
+                               FE1D6D752362649F007A5C26 /* ProtoCallFrameInlines.h in Headers */,
                                DC9A0C201D2D9CB30085124E /* B3CaseCollection.h in Headers */,
                                DC9A0C1F1D2D9CB10085124E /* B3CaseCollectionInlines.h in Headers */,
                                0F338DFA1BE96AA80013C88F /* B3CCallValue.h in Headers */,
                                0F338E1E1BF286EA0013C88F /* B3LowerMacros.h in Headers */,
                                4319DA041C1BE40D001D260B /* B3LowerMacrosAfterOptimizations.h in Headers */,
                                0FEC851E1BDACDAC0080FF74 /* B3LowerToAir.h in Headers */,
+                               FE1D6D6D2362544B007A5C26 /* RegisterInlines.h in Headers */,
                                43AB26C61C1A535900D82AE6 /* B3MathExtras.h in Headers */,
                                0FEC85201BDACDAC0080FF74 /* B3MemoryValue.h in Headers */,
                                0F2C63C41E69EF9400C13839 /* B3MemoryValueInlines.h in Headers */,
                                0F32BD111BB34F190093A57F /* HeapHelperPool.h in Headers */,
                                C2DA778318E259990066FCB6 /* HeapInlines.h in Headers */,
                                2AD8932B17E3868F00668276 /* HeapIterationScope.h in Headers */,
+                               FE1D6D7123625AB1007A5C26 /* ArrayStorageInlines.h in Headers */,
                                A5339EC91BB4B4600054F005 /* HeapObserver.h in Headers */,
                                A5398FAB1C750DA40060A963 /* HeapProfiler.h in Headers */,
                                A54C2AB11C6544F200A18D78 /* HeapSnapshot.h in Headers */,
                                BCD202C40E1706A7002C7E82 /* RegExpPrototype.h in Headers */,
                                BC18C45D0E16F5CD00B34460 /* Register.h in Headers */,
                                E328C6C91DA432F900D255FD /* RegisterAtOffset.h in Headers */,
+                               FE1D6D6F236258FE007A5C26 /* GetVM.h in Headers */,
                                E328C6C81DA4306100D255FD /* RegisterAtOffsetList.h in Headers */,
                                969A072B0ED1CE6900F1F681 /* RegisterID.h in Headers */,
                                9688CB160ED12B4E001D6499 /* RegisterInfo.h in Headers */,
                                33B2A548226543BF005A0F79 /* FTLLowerDFGToB3.cpp in Sources */,
                                5C4196622270E0000047B7CD /* InspectorBackendDispatcherCompatibility.cpp in Sources */,
                                536B319E1F735F160037FC33 /* LowLevelInterpreter.cpp in Sources */,
-                               FE1D6D4523580E1F007A5C26 /* Options.cpp in Sources */,
                                0FF4274A158EBE91004CB9FF /* udis86.c in Sources */,
                                0FF42740158EBE8B004CB9FF /* udis86_decode.c in Sources */,
                                0FF4274D158EBFE6004CB9FF /* udis86_itab_holder.c in Sources */,
index 996a87d..d2c0698 100644 (file)
@@ -1032,30 +1032,6 @@ private:
     std::unique_ptr<RareData> m_rareData;
 };
 
-inline Register& CallFrame::r(int index)
-{
-    CodeBlock* codeBlock = this->codeBlock();
-    if (codeBlock->isConstantRegisterIndex(index))
-        return *reinterpret_cast<Register*>(&codeBlock->constantRegister(index));
-    return this[index];
-}
-
-inline Register& CallFrame::r(VirtualRegister reg)
-{
-    return r(reg.offset());
-}
-
-inline Register& CallFrame::uncheckedR(int index)
-{
-    RELEASE_ASSERT(index < FirstConstantRegisterIndex);
-    return this[index];
-}
-
-inline Register& CallFrame::uncheckedR(VirtualRegister reg)
-{
-    return uncheckedR(reg.offset());
-}
-
 template <typename ExecutableType>
 Exception* ScriptExecutable::prepareForExecution(VM& vm, JSFunction* function, JSScope* scope, CodeSpecializationKind kind, CodeBlock*& resultCodeBlock)
 {
index 815a7c5..a320894 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "MetadataTable.h"
 
-#include "CodeBlock.h"
 #include "JSCInlines.h"
 #include "OpcodeInlines.h"
 #include "UnlinkedMetadataTableInlines.h"
index 60b004f..d210449 100644 (file)
@@ -39,6 +39,7 @@
 #include "B3SlotBaseValue.h"
 #include "B3StackmapGenerationParams.h"
 #include "B3ValueInlines.h"
+#include "ButterflyInlines.h"
 #include "CallFrameShuffler.h"
 #include "CodeBlockWithJITType.h"
 #include "DFGAbstractInterpreterInlines.h"
index 31c9bff..cfb7718 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
  *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
- *  Copyright (C) 2003-2018 Apple Inc. All rights reserved.
+ *  Copyright (C) 2003-2019 Apple Inc. All rights reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Library General Public
@@ -104,26 +104,14 @@ namespace JSC  {
         // yet sure if the callee is a cell. In general, a JS callee is guaranteed
         // to be a cell, however, there is a brief window where we need to check
         // to see if it's a cell, and if it's not, we throw an exception.
-        JSValue guaranteedJSValueCallee() const
-        {
-            ASSERT(!callee().isWasm());
-            return this[CallFrameSlot::callee].jsValue();
-        }
-        JSObject* jsCallee() const
-        {
-            ASSERT(!callee().isWasm());
-            return this[CallFrameSlot::callee].object();
-        }
+        inline JSValue guaranteedJSValueCallee() const;
+        inline JSObject* jsCallee() const;
         CalleeBits callee() const { return CalleeBits(this[CallFrameSlot::callee].pointer()); }
         SUPPRESS_ASAN CalleeBits unsafeCallee() const { return CalleeBits(this[CallFrameSlot::callee].asanUnsafePointer()); }
-        CodeBlock* codeBlock() const { return this[CallFrameSlot::codeBlock].Register::codeBlock(); }
+        CodeBlock* codeBlock() const;
         CodeBlock** addressOfCodeBlock() const { return bitwise_cast<CodeBlock**>(this + CallFrameSlot::codeBlock); }
-        SUPPRESS_ASAN CodeBlock* unsafeCodeBlock() const { return this[CallFrameSlot::codeBlock].Register::asanUnsafeCodeBlock(); }
-        JSScope* scope(int scopeRegisterOffset) const
-        {
-            ASSERT(this[scopeRegisterOffset].Register::scope());
-            return this[scopeRegisterOffset].Register::scope();
-        }
+        inline SUPPRESS_ASAN CodeBlock* unsafeCodeBlock() const;
+        inline JSScope* scope(int scopeRegisterOffset) const;
 
         JS_EXPORT_PRIVATE bool isAnyWasmCallee();
 
@@ -183,18 +171,13 @@ namespace JSC  {
         // CodeOrigin(BytecodeIndex(0)) if we're in native code.
         JS_EXPORT_PRIVATE CodeOrigin codeOrigin();
 
-        Register* topOfFrame()
-        {
-            if (!codeBlock())
-                return registers();
-            return topOfFrameInternal();
-        }
+        inline Register* topOfFrame();
     
         const Instruction* currentVPC() const; // This only makes sense in the LLInt and baseline.
         void setCurrentVPC(const Instruction*);
 
         void setCallerFrame(CallFrame* frame) { callerFrameAndPC().callerFrame = frame; }
-        void setScope(int scopeRegisterOffset, JSScope* scope) { static_cast<Register*>(this)[scopeRegisterOffset] = scope; }
+        inline void setScope(int scopeRegisterOffset, JSScope*);
 
         static void initDeprecatedCallFrameForDebugger(CallFrame* globalExec, JSCallee* globalCallee);
 
@@ -269,8 +252,8 @@ namespace JSC  {
         bool isWasmFrame() const;
 
         void setArgumentCountIncludingThis(int count) { static_cast<Register*>(this)[CallFrameSlot::argumentCount].payload() = count; }
-        void setCallee(JSObject* callee) { static_cast<Register*>(this)[CallFrameSlot::callee] = callee; }
-        void setCodeBlock(CodeBlock* codeBlock) { static_cast<Register*>(this)[CallFrameSlot::codeBlock] = codeBlock; }
+        inline void setCallee(JSObject*);
+        inline void setCodeBlock(CodeBlock*);
         void setReturnPC(void* value) { callerFrameAndPC().returnPC = reinterpret_cast<const Instruction*>(value); }
 
         String friendlyFunctionName();
@@ -323,8 +306,6 @@ namespace JSC  {
         SUPPRESS_ASAN const CallerFrameAndPC& unsafeCallerFrameAndPC() const { return *reinterpret_cast<const CallerFrameAndPC*>(this); }
     };
 
-// Helper function to get VM& from JSGlobalObject* if JSGlobalObject.h is not included.
-VM& getVM(JSGlobalObject*);
 JS_EXPORT_PRIVATE bool isFromJSCode(void* returnAddress);
 
 #if USE(BUILTIN_FRAME_ADDRESS)
index c0cbbd5..a97deca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 #include "CallFrame.h"
 #include "JSCallee.h"
 #include "JSGlobalObject.h"
+#include "RegisterInlines.h"
 
 namespace JSC {
 
+inline Register& CallFrame::r(int index)
+{
+    CodeBlock* codeBlock = this->codeBlock();
+    if (codeBlock->isConstantRegisterIndex(index))
+        return *reinterpret_cast<Register*>(&codeBlock->constantRegister(index));
+    return this[index];
+}
+
+inline Register& CallFrame::r(VirtualRegister reg)
+{
+    return r(reg.offset());
+}
+
+inline Register& CallFrame::uncheckedR(int index)
+{
+    RELEASE_ASSERT(index < FirstConstantRegisterIndex);
+    return this[index];
+}
+
+inline Register& CallFrame::uncheckedR(VirtualRegister reg)
+{
+    return uncheckedR(reg.offset());
+}
+
+inline JSValue CallFrame::guaranteedJSValueCallee() const
+{
+    ASSERT(!callee().isWasm());
+    return this[CallFrameSlot::callee].jsValue();
+}
+
+inline JSObject* CallFrame::jsCallee() const
+{
+    ASSERT(!callee().isWasm());
+    return this[CallFrameSlot::callee].object();
+}
+
+inline CodeBlock* CallFrame::codeBlock() const
+{
+    return this[CallFrameSlot::codeBlock].Register::codeBlock();
+}
+
+inline SUPPRESS_ASAN CodeBlock* CallFrame::unsafeCodeBlock() const
+{
+    return this[CallFrameSlot::codeBlock].Register::asanUnsafeCodeBlock();
+}
+
+inline JSGlobalObject* CallFrame::lexicalGlobalObject(VM& vm) const
+{
+    UNUSED_PARAM(vm);
+#if ENABLE(WEBASSEMBLY)
+    if (callee().isWasm())
+        return lexicalGlobalObjectFromWasmCallee(vm);
+#endif
+    return jsCallee()->globalObject();
+}
+
 inline bool CallFrame::isStackOverflowFrame() const
 {
     if (callee().isWasm())
@@ -43,4 +100,32 @@ inline bool CallFrame::isWasmFrame() const
     return callee().isWasm();
 }
 
+inline void CallFrame::setCallee(JSObject* callee)
+{
+    static_cast<Register*>(this)[CallFrameSlot::callee] = callee;
+}
+
+inline void CallFrame::setCodeBlock(CodeBlock* codeBlock)
+{
+    static_cast<Register*>(this)[CallFrameSlot::codeBlock] = codeBlock;
+}
+
+inline void CallFrame::setScope(int scopeRegisterOffset, JSScope* scope)
+{
+    static_cast<Register*>(this)[scopeRegisterOffset] = scope;
+}
+
+inline JSScope* CallFrame::scope(int scopeRegisterOffset) const
+{
+    ASSERT(this[scopeRegisterOffset].Register::scope());
+    return this[scopeRegisterOffset].Register::scope();
+}
+
+inline Register* CallFrame::topOfFrame()
+{
+    if (!codeBlock())
+        return registers();
+    return topOfFrameInternal();
+}
+
 } // namespace JSC
index e8673bf..c391608 100644 (file)
@@ -66,7 +66,7 @@
 #include "ObjectPrototype.h"
 #include "Parser.h"
 #include "ProgramCodeBlock.h"
-#include "ProtoCallFrame.h"
+#include "ProtoCallFrameInlines.h"
 #include "RegExpObject.h"
 #include "Register.h"
 #include "RegisterAtOffsetList.h"
index 7dbc51c..7cf6de9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013-2018 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2013-2019 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -47,16 +47,13 @@ public:
     JSValue *args;
     JSGlobalObject* globalObject;
 
-    void init(CodeBlock*, JSGlobalObject*, JSObject*, JSValue, int, JSValue* otherArgs = 0);
+    inline void init(CodeBlock*, JSGlobalObject*, JSObject*, JSValue, int, JSValue* otherArgs = 0);
 
-    CodeBlock* codeBlock() const { return codeBlockValue.Register::codeBlock(); }
-    void setCodeBlock(CodeBlock* codeBlock) { codeBlockValue = codeBlock; }
+    inline CodeBlock* codeBlock() const;
+    inline void setCodeBlock(CodeBlock*);
 
-    JSObject* callee() const { return calleeValue.Register::object(); }
-    void setCallee(JSObject* callee)
-    {
-        calleeValue = callee;
-    }
+    inline JSObject* callee() const;
+    inline void setCallee(JSObject*);
     void setGlobalObject(JSGlobalObject* object)
     {
         globalObject = object;
@@ -86,23 +83,4 @@ public:
     }
 };
 
-inline void ProtoCallFrame::init(CodeBlock* codeBlock, JSGlobalObject* globalObject, JSObject* callee, JSValue thisValue, int argCountIncludingThis, JSValue* otherArgs)
-{
-    this->args = otherArgs;
-    this->setCodeBlock(codeBlock);
-    this->setCallee(callee);
-    this->setGlobalObject(globalObject);
-    this->setArgumentCountIncludingThis(argCountIncludingThis);
-    if (codeBlock && argCountIncludingThis < codeBlock->numParameters())
-        this->hasArityMismatch = true;
-    else
-        this->hasArityMismatch = false;
-
-    // Round up argCountIncludingThis to keep the stack frame size aligned.
-    size_t paddedArgsCount = roundArgumentCountToAlignFrame(argCountIncludingThis);
-    this->setPaddedArgCount(paddedArgsCount);
-    this->clearCurrentVPC();
-    this->setThisValue(thisValue);
-}
-
 } // namespace JSC
diff --git a/Source/JavaScriptCore/interpreter/ProtoCallFrameInlines.h b/Source/JavaScriptCore/interpreter/ProtoCallFrameInlines.h
new file mode 100644 (file)
index 0000000..e73556e
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ProtoCallFrame.h"
+#include "RegisterInlines.h"
+
+namespace JSC {
+
+inline void ProtoCallFrame::init(CodeBlock* codeBlock, JSGlobalObject* globalObject, JSObject* callee, JSValue thisValue, int argCountIncludingThis, JSValue* otherArgs)
+{
+    this->args = otherArgs;
+    this->setCodeBlock(codeBlock);
+    this->setCallee(callee);
+    this->setGlobalObject(globalObject);
+    this->setArgumentCountIncludingThis(argCountIncludingThis);
+    if (codeBlock && argCountIncludingThis < codeBlock->numParameters())
+        this->hasArityMismatch = true;
+    else
+        this->hasArityMismatch = false;
+
+    // Round up argCountIncludingThis to keep the stack frame size aligned.
+    size_t paddedArgsCount = roundArgumentCountToAlignFrame(argCountIncludingThis);
+    this->setPaddedArgCount(paddedArgsCount);
+    this->clearCurrentVPC();
+    this->setThisValue(thisValue);
+}
+
+inline JSObject* ProtoCallFrame::callee() const
+{
+    return calleeValue.Register::object();
+}
+
+inline void ProtoCallFrame::setCallee(JSObject* callee)
+{
+    calleeValue = callee;
+}
+
+inline CodeBlock* ProtoCallFrame::codeBlock() const
+{
+    return codeBlockValue.Register::codeBlock();
+}
+
+inline void ProtoCallFrame::setCodeBlock(CodeBlock* codeBlock)
+{
+    codeBlockValue = codeBlock;
+}
+
+} // namespace JSC
index 8073ae9..43adc91 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2008-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -51,17 +51,17 @@ namespace JSC {
         JSValue asanUnsafeJSValue() const;
         EncodedJSValue encodedJSValue() const;
         
-        Register& operator=(CallFrame*);
-        Register& operator=(CodeBlock*);
-        Register& operator=(JSScope*);
-        Register& operator=(JSObject*);
+        ALWAYS_INLINE Register& operator=(CallFrame*);
+        ALWAYS_INLINE Register& operator=(CodeBlock*);
+        ALWAYS_INLINE Register& operator=(JSScope*);
+        ALWAYS_INLINE Register& operator=(JSObject*);
 
         int32_t i() const;
-        CallFrame* callFrame() const;
-        CodeBlock* codeBlock() const;
-        CodeBlock* asanUnsafeCodeBlock() const;
-        JSObject* object() const;
-        JSScope* scope() const;
+        ALWAYS_INLINE CallFrame* callFrame() const;
+        ALWAYS_INLINE CodeBlock* codeBlock() const;
+        ALWAYS_INLINE CodeBlock* asanUnsafeCodeBlock() const;
+        ALWAYS_INLINE JSObject* object() const;
+        ALWAYS_INLINE JSScope* scope() const;
         int32_t unboxedInt32() const;
         int32_t asanUnsafeUnboxedInt32() const;
         int64_t unboxedInt52() const;
@@ -136,38 +136,11 @@ namespace JSC {
 
     // Interpreter functions
 
-    ALWAYS_INLINE Register& Register::operator=(CallFrame* callFrame)
-    {
-        u.callFrame = callFrame;
-        return *this;
-    }
-
-    ALWAYS_INLINE Register& Register::operator=(CodeBlock* codeBlock)
-    {
-        u.codeBlock = codeBlock;
-        return *this;
-    }
-
     ALWAYS_INLINE int32_t Register::i() const
     {
         return jsValue().asInt32();
     }
 
-    ALWAYS_INLINE CallFrame* Register::callFrame() const
-    {
-        return u.callFrame;
-    }
-    
-    ALWAYS_INLINE CodeBlock* Register::codeBlock() const
-    {
-        return u.codeBlock;
-    }
-
-    SUPPRESS_ASAN ALWAYS_INLINE CodeBlock* Register::asanUnsafeCodeBlock() const
-    {
-        return u.codeBlock;
-    }
-
     ALWAYS_INLINE int32_t Register::unboxedInt32() const
     {
         return payload();
diff --git a/Source/JavaScriptCore/interpreter/RegisterInlines.h b/Source/JavaScriptCore/interpreter/RegisterInlines.h
new file mode 100644 (file)
index 0000000..f4e4d0c
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "CodeBlock.h"
+#include "JSScope.h"
+#include "Register.h"
+
+namespace JSC {
+
+ALWAYS_INLINE CallFrame* Register::callFrame() const
+{
+    return u.callFrame;
+}
+
+ALWAYS_INLINE CodeBlock* Register::codeBlock() const
+{
+    return u.codeBlock;
+}
+
+SUPPRESS_ASAN ALWAYS_INLINE CodeBlock* Register::asanUnsafeCodeBlock() const
+{
+    return u.codeBlock;
+}
+
+ALWAYS_INLINE JSObject* Register::object() const
+{
+    return asObject(jsValue());
+}
+
+ALWAYS_INLINE Register& Register::operator=(CallFrame* callFrame)
+{
+    u.callFrame = callFrame;
+    return *this;
+}
+
+ALWAYS_INLINE Register& Register::operator=(CodeBlock* codeBlock)
+{
+    u.codeBlock = codeBlock;
+    return *this;
+}
+
+ALWAYS_INLINE Register& Register::operator=(JSObject* object)
+{
+    u.value = JSValue::encode(JSValue(object));
+    return *this;
+}
+
+ALWAYS_INLINE Register& Register::operator=(JSScope* scope)
+{
+    *this = JSValue(scope);
+    return *this;
+}
+
+ALWAYS_INLINE JSScope* Register::scope() const
+{
+    return jsCast<JSScope*>(unboxedCell());
+}
+
+} // namespace JSC
index a583b48..cdbdf7d 100644 (file)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "StackVisitor.h"
 
-#include "CallFrameInlines.h"
 #include "ClonedArguments.h"
 #include "DebuggerPrimitives.h"
 #include "InlineCallFrame.h"
index bc59535..ca21195 100644 (file)
@@ -35,6 +35,7 @@
 #include "InlineCallFrame.h"
 #include "JITAllocator.h"
 #include "JITCode.h"
+#include "JSCellInlines.h"
 #include "MacroAssembler.h"
 #include "MarkedSpace.h"
 #include "RegisterAtOffsetList.h"
index 23129fa..4421121 100644 (file)
@@ -64,7 +64,7 @@
 #include "ObjectPropertyConditionSet.h"
 #include "OpcodeInlines.h"
 #include "ProgramCodeBlock.h"
-#include "ProtoCallFrame.h"
+#include "ProtoCallFrameInlines.h"
 #include "RegExpObject.h"
 #include "ShadowChicken.h"
 #include "StructureRareDataInlines.h"
index 258b429..9064165 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012, 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -103,10 +103,7 @@ public:
         return totalSizeFor(m_indexBias, propertyCapacity, vectorLength());
     }
 
-    size_t totalSize(Structure* structure) const
-    {
-        return totalSize(structure->outOfLineCapacity());
-    }
+    inline size_t totalSize(Structure*) const;
 
     static unsigned availableVectorLength(unsigned indexBias, size_t propertyCapacity, unsigned vectorLength)
     {
@@ -117,41 +114,19 @@ public:
         return vectorLength;
     }
 
-    static unsigned availableVectorLength(unsigned indexBias, Structure* structure, unsigned vectorLength)
-    {
-        return availableVectorLength(indexBias, structure->outOfLineCapacity(), vectorLength);
-    }
+    inline static unsigned availableVectorLength(unsigned indexBias, Structure*, unsigned vectorLength);
 
-    unsigned availableVectorLength(size_t propertyCapacity, unsigned vectorLength)
-    {
-        return availableVectorLength(m_indexBias, propertyCapacity, vectorLength);
-    }
+    inline unsigned availableVectorLength(size_t propertyCapacity, unsigned vectorLength);
 
-    unsigned availableVectorLength(Structure* structure, unsigned vectorLength)
-    {
-        return availableVectorLength(structure->outOfLineCapacity(), vectorLength);
-    }
+    inline unsigned availableVectorLength(Structure*, unsigned vectorLength);
 
-    static unsigned optimalVectorLength(unsigned indexBias, size_t propertyCapacity, unsigned vectorLength)
-    {
-        vectorLength = std::max(BASE_ARRAY_STORAGE_VECTOR_LEN, vectorLength);
-        return availableVectorLength(indexBias, propertyCapacity, vectorLength);
-    }
+    inline static unsigned optimalVectorLength(unsigned indexBias, size_t propertyCapacity, unsigned vectorLength);
 
-    static unsigned optimalVectorLength(unsigned indexBias, Structure* structure, unsigned vectorLength)
-    {
-        return optimalVectorLength(indexBias, structure->outOfLineCapacity(), vectorLength);
-    }
+    inline static unsigned optimalVectorLength(unsigned indexBias, Structure*, unsigned vectorLength);
 
-    unsigned optimalVectorLength(size_t propertyCapacity, unsigned vectorLength)
-    {
-        return optimalVectorLength(m_indexBias, propertyCapacity, vectorLength);
-    }
+    inline unsigned optimalVectorLength(size_t propertyCapacity, unsigned vectorLength);
 
-    unsigned optimalVectorLength(Structure* structure, unsigned vectorLength)
-    {
-        return optimalVectorLength(structure->outOfLineCapacity(), vectorLength);
-    }
+    inline unsigned optimalVectorLength(Structure*, unsigned vectorLength);
 
     WriteBarrier<SparseArrayValueMap> m_sparseMap;
     unsigned m_indexBias;
diff --git a/Source/JavaScriptCore/runtime/ArrayStorageInlines.h b/Source/JavaScriptCore/runtime/ArrayStorageInlines.h
new file mode 100644 (file)
index 0000000..7256844
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "ArrayStorage.h"
+#include "StructureInlines.h"
+
+namespace JSC {
+
+inline unsigned ArrayStorage::availableVectorLength(unsigned indexBias, Structure* structure, unsigned vectorLength)
+{
+    return availableVectorLength(indexBias, structure->outOfLineCapacity(), vectorLength);
+}
+
+inline unsigned ArrayStorage::availableVectorLength(size_t propertyCapacity, unsigned vectorLength)
+{
+    return availableVectorLength(m_indexBias, propertyCapacity, vectorLength);
+}
+
+inline unsigned ArrayStorage::availableVectorLength(Structure* structure, unsigned vectorLength)
+{
+    return availableVectorLength(structure->outOfLineCapacity(), vectorLength);
+}
+
+inline unsigned ArrayStorage::optimalVectorLength(unsigned indexBias, size_t propertyCapacity, unsigned vectorLength)
+{
+    vectorLength = std::max(BASE_ARRAY_STORAGE_VECTOR_LEN, vectorLength);
+    return availableVectorLength(indexBias, propertyCapacity, vectorLength);
+}
+
+inline unsigned ArrayStorage::optimalVectorLength(unsigned indexBias, Structure* structure, unsigned vectorLength)
+{
+    return optimalVectorLength(indexBias, structure->outOfLineCapacity(), vectorLength);
+}
+
+inline unsigned ArrayStorage::optimalVectorLength(size_t propertyCapacity, unsigned vectorLength)
+{
+    return optimalVectorLength(m_indexBias, propertyCapacity, vectorLength);
+}
+
+inline unsigned ArrayStorage::optimalVectorLength(Structure* structure, unsigned vectorLength)
+{
+    return optimalVectorLength(structure->outOfLineCapacity(), vectorLength);
+}
+
+inline size_t ArrayStorage::totalSize(Structure* structure) const
+{
+    return totalSize(structure->outOfLineCapacity());
+}
+
+} // namespace JSC
index 8960df0..a95b5ff 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2012-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#include "ArrayStorage.h"
+#include "ArrayStorageInlines.h"
 #include "Butterfly.h"
 #include "JSObject.h"
 #include "Structure.h"
index 7815e42..fe6c6b7 100644 (file)
@@ -22,7 +22,6 @@
 
 #pragma once
 
-#include "CallFrame.h"
 #include "ConstructData.h"
 #include "JSCast.h"
 #include <wtf/PtrTag.h>
diff --git a/Source/JavaScriptCore/runtime/GetVM.h b/Source/JavaScriptCore/runtime/GetVM.h
new file mode 100644 (file)
index 0000000..f18a158
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+namespace JSC {
+
+class JSGlobalObject;
+class VM;
+
+// Helper function to get VM& from JSGlobalObject* if JSGlobalObject.h is not included.
+VM& getVM(JSGlobalObject*);
+
+} // namespace JSC
index 2f9ee0c..317949c 100644 (file)
@@ -22,8 +22,8 @@
 
 #include "ArgList.h"
 #include "ArrayConventions.h"
-#include "ButterflyInlines.h"
-#include "JSCellInlines.h"
+#include "Butterfly.h"
+#include "JSCell.h"
 #include "JSObject.h"
 
 namespace JSC {
index a8c1708..5f36084 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2016 Apple Inc. All rights reserved.
+ *  Copyright (C) 2016-2019 Apple Inc. All rights reserved.
  *
  *  This library is free software; you can redistribute it and/or
  *  modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@
 #pragma once
 
 #include "ArrayPrototype.h"
+#include "ButterflyInlines.h"
 #include "Error.h"
 #include "JSArray.h"
 #include "JSCellInlines.h"
index b8cf9d9..1a6420d 100644 (file)
@@ -29,7 +29,7 @@
 #include "AllocatorInlines.h"
 #include "CompleteSubspaceInlines.h"
 #include "CPU.h"
-#include "CallFrame.h"
+#include "CallFrameInlines.h"
 #include "DeferGC.h"
 #include "FreeListInlines.h"
 #include "Handle.h"
index 4dd0ff0..081a6aa 100644 (file)
@@ -27,6 +27,7 @@
 #include "BooleanPrototype.h"
 #include "ErrorType.h"
 #include "ExceptionHelpers.h"
+#include "GetVM.h"
 #include "InternalFunction.h"
 #include "JSArray.h"
 #include "JSArrayBufferPrototype.h"
index 65b0025..d008459 100644 (file)
@@ -1497,17 +1497,6 @@ inline bool JSObject::putDirect(VM& vm, PropertyName propertyName, JSValue value
     return putDirectInternal<PutModeDefineOwnProperty>(vm, propertyName, value, 0, slot);
 }
 
-ALWAYS_INLINE JSObject* Register::object() const
-{
-    return asObject(jsValue());
-}
-
-ALWAYS_INLINE Register& Register::operator=(JSObject* object)
-{
-    u.value = JSValue::encode(JSValue(object));
-    return *this;
-}
-
 inline size_t offsetInButterfly(PropertyOffset offset)
 {
     return offsetInOutOfLineStorage(offset) + Butterfly::indexOfPropertyStorage();
index 298ae59..f3f5ab5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
  *  Copyright (C) 2001 Peter Kelly (pmk@post.com)
- *  Copyright (C) 2003-2017 Apple Inc. All rights reserved.
+ *  Copyright (C) 2003-2019 Apple Inc. All rights reserved.
  *  Copyright (C) 2007 Eric Seidel (eric@webkit.org)
  *
  *  This library is free software; you can redistribute it and/or
@@ -24,6 +24,7 @@
 #pragma once
 
 #include "AuxiliaryBarrierInlines.h"
+#include "ButterflyInlines.h"
 #include "Error.h"
 #include "JSObject.h"
 #include "JSTypedArrays.h"
index 090ed75..a799f55 100644 (file)
@@ -129,27 +129,6 @@ inline JSScope* JSScope::next()
     return m_next.get();
 }
 
-inline Register& Register::operator=(JSScope* scope)
-{
-    *this = JSValue(scope);
-    return *this;
-}
-
-inline JSScope* Register::scope() const
-{
-    return jsCast<JSScope*>(unboxedCell());
-}
-
-inline JSGlobalObject* CallFrame::lexicalGlobalObject(VM& vm) const
-{
-    UNUSED_PARAM(vm);
-#if ENABLE(WEBASSEMBLY)
-    if (callee().isWasm())
-        return lexicalGlobalObjectFromWasmCallee(vm);
-#endif
-    return jsCallee()->globalObject();
-}
-
 inline size_t JSScope::offsetOfNext()
 {
     return OBJECT_OFFSETOF(JSScope, m_next);
index b906f30..d2bb976 100644 (file)
@@ -25,6 +25,7 @@
 #include "ArgList.h"
 #include "CallFrame.h"
 #include "CommonIdentifiers.h"
+#include "GetVM.h"
 #include "Identifier.h"
 #include "PropertyDescriptor.h"
 #include "PropertySlot.h"
index 3551f38..7ffd5a9 100644 (file)
@@ -20,7 +20,6 @@
 
 #pragma once
 
-#include "CallFrame.h"
 #include "Identifier.h"
 #include <wtf/HashSet.h>
 #include <wtf/Vector.h>
index 37ffa54..b21de3e 100644 (file)
@@ -20,8 +20,8 @@
 
 #pragma once
 
-#include "CallFrame.h"
 #include "DOMAnnotation.h"
+#include "GetVM.h"
 #include "JSCJSValue.h"
 #include "PropertyName.h"
 #include "PropertyOffset.h"
index 15e5df0..f2ac605 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -25,7 +25,6 @@
 
 #pragma once
 
-#include "CallFrameInlines.h"
 #include "EntryFrame.h"
 #include "ProfilerDatabase.h"
 #include "VM.h"
index 0615269..bae647d 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "HeapVerifier.h"
 
+#include "ButterflyInlines.h"
 #include "CodeBlockInlines.h"
 #include "HeapIterationScope.h"
 #include "JSCInlines.h"
index a84f5e5..35137c2 100644 (file)
@@ -40,7 +40,7 @@
 #include "JSWebAssemblyRuntimeError.h"
 #include "LLIntThunks.h"
 #include "LinkBuffer.h"
-#include "ProtoCallFrame.h"
+#include "ProtoCallFrameInlines.h"
 #include "VM.h"
 #include "WasmCallee.h"
 #include "WasmCallingConvention.h"
index 54787a4..86484f7 100644 (file)
@@ -1,3 +1,14 @@
+2019-10-24  Mark Lam  <mark.lam@apple.com>
+
+        Move JSC::Register inline methods into RegisterInlines.h.
+        https://bugs.webkit.org/show_bug.cgi?id=203391
+
+        Reviewed by Yusuke Suzuki and Keith Miller.
+
+        No new tests needed because there is no behavior change.
+
+        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
+
 2019-10-24  Alex Christensen  <achristensen@webkit.org>
 
         Add more information to SRI failure console messages
index f20a8d3..dbe6076 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -36,6 +36,8 @@
 #import "WebCoreNSErrorExtras.h"
 #import <AVFoundation/AVError.h>
 #import <CoreMedia/CMBase.h>
+#import <JavaScriptCore/HeapInlines.h>
+#import <JavaScriptCore/JSCellInlines.h>
 #import <JavaScriptCore/JSGlobalObjectInlines.h>
 #import <JavaScriptCore/TypedArrayInlines.h>
 #import <objc/objc-runtime.h>