Changeset 251584 in webkit
- Timestamp:
- Oct 24, 2019 11:59:36 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSAPIGlobalObject.mm
r251425 r251584 30 30 31 31 #import "APICast.h" 32 #import "CallFrameInlines.h" 32 33 #import "CatchScope.h" 33 34 #import "Completion.h" -
trunk/Source/JavaScriptCore/CMakeLists.txt
r251468 r251584 679 679 interpreter/FrameTracers.h 680 680 interpreter/Register.h 681 interpreter/RegisterInlines.h 681 682 interpreter/ShadowChicken.h 682 683 interpreter/StackVisitor.h … … 753 754 runtime/ArrayPrototype.h 754 755 runtime/ArrayStorage.h 756 runtime/ArrayStorageInlines.h 755 757 runtime/AuxiliaryBarrier.h 756 758 runtime/AuxiliaryBarrierInlines.h … … 822 824 runtime/GenericTypedArrayViewInlines.h 823 825 runtime/GetPutInfo.h 826 runtime/GetVM.h 824 827 runtime/GlobalExecutable.h 825 828 runtime/HashMapImpl.h -
trunk/Source/JavaScriptCore/ChangeLog
r251583 r251584 1 2019-10-24 Mark Lam <mark.lam@apple.com> 2 3 Move JSC::Register inline methods into RegisterInlines.h. 4 https://bugs.webkit.org/show_bug.cgi?id=203391 5 6 Reviewed by Yusuke Suzuki and Keith Miller. 7 8 We're doing this because: 9 1. RegisterInlines.h is the canonical place to put inline Register methods. 10 2. It helps reduce build time. 11 e.g. build-jsc went from 208.02 to 196.81 seconds (about a 5% reduction). 12 3. This enables experimental work to box JSCells in JSValue. 13 14 This patch also handles the fallout of this change, which necessitates more 15 inline methods being moved from <file>.h to their respective <file>Inlines.h. 16 17 JSArray.h used to include ButterflyInlines.h and JSCellInlines.h. This is a 18 violation of inclusion ordering (.h should not #include Inlines.h). This 19 violation has been removed. 20 21 * API/JSAPIGlobalObject.mm: 22 * CMakeLists.txt: 23 * JavaScriptCore.xcodeproj/project.pbxproj: 24 * bytecode/CodeBlock.h: 25 (JSC::CallFrame::r): Deleted. 26 (JSC::CallFrame::uncheckedR): Deleted. 27 * bytecode/MetadataTable.cpp: 28 * ftl/FTLLowerDFGToB3.cpp: 29 * interpreter/CallFrame.h: 30 (JSC::CallFrame::guaranteedJSValueCallee const): Deleted. 31 (JSC::CallFrame::jsCallee const): Deleted. 32 (JSC::CallFrame::codeBlock const): Deleted. 33 (JSC::CallFrame::unsafeCodeBlock const): Deleted. 34 (JSC::CallFrame::scope const): Deleted. 35 (JSC::CallFrame::topOfFrame): Deleted. 36 (JSC::CallFrame::setScope): Deleted. 37 (JSC::CallFrame::setCallee): Deleted. 38 (JSC::CallFrame::setCodeBlock): Deleted. 39 * interpreter/CallFrameInlines.h: 40 (JSC::CallFrame::r): 41 (JSC::CallFrame::uncheckedR): 42 (JSC::CallFrame::guaranteedJSValueCallee const): 43 (JSC::CallFrame::jsCallee const): 44 (JSC::CallFrame::codeBlock const): 45 (JSC::CallFrame::unsafeCodeBlock const): 46 (JSC::CallFrame::lexicalGlobalObject const): 47 (JSC::CallFrame::setCallee): 48 (JSC::CallFrame::setCodeBlock): 49 (JSC::CallFrame::setScope): 50 (JSC::CallFrame::scope const): 51 (JSC::CallFrame::topOfFrame): 52 * interpreter/Interpreter.cpp: 53 * interpreter/ProtoCallFrame.h: 54 (JSC::ProtoCallFrame::init): Deleted. 55 * interpreter/ProtoCallFrameInlines.h: Added. 56 (JSC::ProtoCallFrame::init): 57 (JSC::ProtoCallFrame::callee const): 58 (JSC::ProtoCallFrame::setCallee): 59 (JSC::ProtoCallFrame::codeBlock const): 60 (JSC::ProtoCallFrame::setCodeBlock): 61 * interpreter/Register.h: 62 (JSC::Register::callFrame const): Deleted. 63 (JSC::Register::codeBlock const): Deleted. 64 (JSC::Register::asanUnsafeCodeBlock const): Deleted. 65 * interpreter/RegisterInlines.h: Added. 66 (JSC::Register::callFrame const): 67 (JSC::Register::codeBlock const): 68 (JSC::Register::asanUnsafeCodeBlock const): 69 (JSC::Register::object const): 70 (JSC::Register::operator=): 71 (JSC::Register::scope const): 72 * interpreter/StackVisitor.cpp: 73 * jit/AssemblyHelpers.h: 74 * llint/LLIntSlowPaths.cpp: 75 * runtime/ArrayStorage.h: 76 (JSC::ArrayStorage::optimalVectorLength): Deleted. 77 * runtime/ArrayStorageInlines.h: Added. 78 (JSC::ArrayStorage::availableVectorLength): 79 (JSC::ArrayStorage::optimalVectorLength): 80 (JSC::ArrayStorage::totalSize const): 81 * runtime/ButterflyInlines.h: 82 * runtime/ClassInfo.h: 83 * runtime/GetVM.h: Added. 84 * runtime/JSArray.h: 85 * runtime/JSArrayInlines.h: 86 * runtime/JSCellInlines.h: 87 * runtime/JSGlobalObject.h: 88 * runtime/JSObject.h: 89 (JSC::Register::object const): Deleted. 90 (JSC::Register::operator=): Deleted. 91 * runtime/JSObjectInlines.h: 92 * runtime/JSScope.h: 93 (JSC::Register::operator=): Deleted. 94 (JSC::Register::scope const): Deleted. 95 (JSC::CallFrame::lexicalGlobalObject const): Deleted. 96 * runtime/JSString.h: 97 * runtime/PropertyNameArray.h: 98 * runtime/PropertySlot.h: 99 * runtime/VMInlines.h: 100 * tools/HeapVerifier.cpp: 101 * wasm/js/WebAssemblyFunction.cpp: 102 1 103 2019-10-24 Zan Dobersek <zdobersek@igalia.com> 2 104 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r251468 r251584 1866 1866 FE1BD0251E72053800134BC9 /* HeapVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1BD0231E72052F00134BC9 /* HeapVerifier.h */; }; 1867 1867 FE1C0FFD1B193E9800B53FCA /* Exception.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1C0FFC1B193E9800B53FCA /* Exception.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1868 FE1D6D6D2362544B007A5C26 /* RegisterInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1D6D6C2362544A007A5C26 /* RegisterInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1869 FE1D6D6F236258FE007A5C26 /* GetVM.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1D6D6E236258FE007A5C26 /* GetVM.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1870 FE1D6D7123625AB1007A5C26 /* ArrayStorageInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1D6D7023625AB0007A5C26 /* ArrayStorageInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1871 FE1D6D752362649F007A5C26 /* ProtoCallFrameInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1D6D742362649D007A5C26 /* ProtoCallFrameInlines.h */; }; 1868 1872 FE1E2C3F2240DD5800F6B729 /* MacroAssemblerARM64E.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1E2C3E2240D30B00F6B729 /* MacroAssemblerARM64E.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1869 1873 FE1E2C402240DD6200F6B729 /* ARM64EAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1E2C3D2240D2F600F6B729 /* ARM64EAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5050 5054 FE1C0FFC1B193E9800B53FCA /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Exception.h; sourceTree = "<group>"; }; 5051 5055 FE1C0FFE1B194FD100B53FCA /* Exception.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Exception.cpp; sourceTree = "<group>"; }; 5056 FE1D6D6C2362544A007A5C26 /* RegisterInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterInlines.h; sourceTree = "<group>"; }; 5057 FE1D6D6E236258FE007A5C26 /* GetVM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetVM.h; sourceTree = "<group>"; }; 5058 FE1D6D7023625AB0007A5C26 /* ArrayStorageInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrayStorageInlines.h; sourceTree = "<group>"; }; 5059 FE1D6D742362649D007A5C26 /* ProtoCallFrameInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtoCallFrameInlines.h; sourceTree = "<group>"; }; 5052 5060 FE1E2C3C2240C1EF00F6B729 /* JSCPtrTag.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCPtrTag.cpp; sourceTree = "<group>"; }; 5053 5061 FE1E2C3D2240D2F600F6B729 /* ARM64EAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARM64EAssembler.h; sourceTree = "<group>"; }; … … 5928 5936 E39D9D841D39000600667282 /* InterpreterInlines.h */, 5929 5937 65FB5115184EE8F800C12B70 /* ProtoCallFrame.h */, 5938 FE1D6D742362649D007A5C26 /* ProtoCallFrameInlines.h */, 5930 5939 149B24FF0D8AF6D1009CB8C7 /* Register.h */, 5940 FE1D6D6C2362544A007A5C26 /* RegisterInlines.h */, 5931 5941 DC17E8131C9C7FD4008A6AB3 /* ShadowChicken.cpp */, 5932 5942 DC17E8141C9C7FD4008A6AB3 /* ShadowChicken.h */, … … 6902 6912 F692A84E0255597D01FF60F7 /* ArrayPrototype.h */, 6903 6913 0FB7F38A15ED8E3800F167B2 /* ArrayStorage.h */, 6914 FE1D6D7023625AB0007A5C26 /* ArrayStorageInlines.h */, 6904 6915 8B6016F31F3E3CC000F9DE6A /* AsyncFromSyncIteratorPrototype.cpp */, 6905 6916 8B6016F41F3E3CC000F9DE6A /* AsyncFromSyncIteratorPrototype.h */, … … 7078 7089 14788EE521501B2900A561C8 /* GetPutInfo.cpp */, 7079 7090 796465681B952FF0003059EE /* GetPutInfo.h */, 7091 FE1D6D6E236258FE007A5C26 /* GetVM.h */, 7080 7092 BC02E9B80E184545000F9297 /* GetterSetter.cpp */, 7081 7093 BC337BDE0E1AF0B80076918A /* GetterSetter.h */, … … 8872 8884 DCFDFBD91D1F5D9B00FE3D72 /* B3BottomProvider.h in Headers */, 8873 8885 0F6B8AE31C4EFE1700969052 /* B3BreakCriticalEdges.h in Headers */, 8886 FE1D6D752362649F007A5C26 /* ProtoCallFrameInlines.h in Headers */, 8874 8887 DC9A0C201D2D9CB30085124E /* B3CaseCollection.h in Headers */, 8875 8888 DC9A0C1F1D2D9CB10085124E /* B3CaseCollectionInlines.h in Headers */, … … 8915 8928 4319DA041C1BE40D001D260B /* B3LowerMacrosAfterOptimizations.h in Headers */, 8916 8929 0FEC851E1BDACDAC0080FF74 /* B3LowerToAir.h in Headers */, 8930 FE1D6D6D2362544B007A5C26 /* RegisterInlines.h in Headers */, 8917 8931 43AB26C61C1A535900D82AE6 /* B3MathExtras.h in Headers */, 8918 8932 0FEC85201BDACDAC0080FF74 /* B3MemoryValue.h in Headers */, … … 9479 9493 C2DA778318E259990066FCB6 /* HeapInlines.h in Headers */, 9480 9494 2AD8932B17E3868F00668276 /* HeapIterationScope.h in Headers */, 9495 FE1D6D7123625AB1007A5C26 /* ArrayStorageInlines.h in Headers */, 9481 9496 A5339EC91BB4B4600054F005 /* HeapObserver.h in Headers */, 9482 9497 A5398FAB1C750DA40060A963 /* HeapProfiler.h in Headers */, … … 9996 10011 BC18C45D0E16F5CD00B34460 /* Register.h in Headers */, 9997 10012 E328C6C91DA432F900D255FD /* RegisterAtOffset.h in Headers */, 10013 FE1D6D6F236258FE007A5C26 /* GetVM.h in Headers */, 9998 10014 E328C6C81DA4306100D255FD /* RegisterAtOffsetList.h in Headers */, 9999 10015 969A072B0ED1CE6900F1F681 /* RegisterID.h in Headers */, … … 11041 11057 5C4196622270E0000047B7CD /* InspectorBackendDispatcherCompatibility.cpp in Sources */, 11042 11058 536B319E1F735F160037FC33 /* LowLevelInterpreter.cpp in Sources */, 11043 FE1D6D4523580E1F007A5C26 /* Options.cpp in Sources */,11044 11059 0FF4274A158EBE91004CB9FF /* udis86.c in Sources */, 11045 11060 0FF42740158EBE8B004CB9FF /* udis86_decode.c in Sources */, -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r251468 r251584 1033 1033 }; 1034 1034 1035 inline Register& CallFrame::r(int index)1036 {1037 CodeBlock* codeBlock = this->codeBlock();1038 if (codeBlock->isConstantRegisterIndex(index))1039 return *reinterpret_cast<Register*>(&codeBlock->constantRegister(index));1040 return this[index];1041 }1042 1043 inline Register& CallFrame::r(VirtualRegister reg)1044 {1045 return r(reg.offset());1046 }1047 1048 inline Register& CallFrame::uncheckedR(int index)1049 {1050 RELEASE_ASSERT(index < FirstConstantRegisterIndex);1051 return this[index];1052 }1053 1054 inline Register& CallFrame::uncheckedR(VirtualRegister reg)1055 {1056 return uncheckedR(reg.offset());1057 }1058 1059 1035 template <typename ExecutableType> 1060 1036 Exception* ScriptExecutable::prepareForExecution(VM& vm, JSFunction* function, JSScope* scope, CodeSpecializationKind kind, CodeBlock*& resultCodeBlock) -
trunk/Source/JavaScriptCore/bytecode/MetadataTable.cpp
r245669 r251584 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 27 27 #include "MetadataTable.h" 28 28 29 #include "CodeBlock.h"30 29 #include "JSCInlines.h" 31 30 #include "OpcodeInlines.h" -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r251518 r251584 40 40 #include "B3StackmapGenerationParams.h" 41 41 #include "B3ValueInlines.h" 42 #include "ButterflyInlines.h" 42 43 #include "CallFrameShuffler.h" 43 44 #include "CodeBlockWithJITType.h" -
trunk/Source/JavaScriptCore/interpreter/CallFrame.h
r251529 r251584 2 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2003-201 8Apple Inc. All rights reserved.4 * Copyright (C) 2003-2019 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 105 105 // to be a cell, however, there is a brief window where we need to check 106 106 // to see if it's a cell, and if it's not, we throw an exception. 107 JSValue guaranteedJSValueCallee() const 108 { 109 ASSERT(!callee().isWasm()); 110 return this[CallFrameSlot::callee].jsValue(); 111 } 112 JSObject* jsCallee() const 113 { 114 ASSERT(!callee().isWasm()); 115 return this[CallFrameSlot::callee].object(); 116 } 107 inline JSValue guaranteedJSValueCallee() const; 108 inline JSObject* jsCallee() const; 117 109 CalleeBits callee() const { return CalleeBits(this[CallFrameSlot::callee].pointer()); } 118 110 SUPPRESS_ASAN CalleeBits unsafeCallee() const { return CalleeBits(this[CallFrameSlot::callee].asanUnsafePointer()); } 119 CodeBlock* codeBlock() const { return this[CallFrameSlot::codeBlock].Register::codeBlock(); }111 CodeBlock* codeBlock() const; 120 112 CodeBlock** addressOfCodeBlock() const { return bitwise_cast<CodeBlock**>(this + CallFrameSlot::codeBlock); } 121 SUPPRESS_ASAN CodeBlock* unsafeCodeBlock() const { return this[CallFrameSlot::codeBlock].Register::asanUnsafeCodeBlock(); } 122 JSScope* scope(int scopeRegisterOffset) const 123 { 124 ASSERT(this[scopeRegisterOffset].Register::scope()); 125 return this[scopeRegisterOffset].Register::scope(); 126 } 113 inline SUPPRESS_ASAN CodeBlock* unsafeCodeBlock() const; 114 inline JSScope* scope(int scopeRegisterOffset) const; 127 115 128 116 JS_EXPORT_PRIVATE bool isAnyWasmCallee(); … … 184 172 JS_EXPORT_PRIVATE CodeOrigin codeOrigin(); 185 173 186 Register* topOfFrame() 187 { 188 if (!codeBlock()) 189 return registers(); 190 return topOfFrameInternal(); 191 } 174 inline Register* topOfFrame(); 192 175 193 176 const Instruction* currentVPC() const; // This only makes sense in the LLInt and baseline. … … 195 178 196 179 void setCallerFrame(CallFrame* frame) { callerFrameAndPC().callerFrame = frame; } 197 void setScope(int scopeRegisterOffset, JSScope* scope) { static_cast<Register*>(this)[scopeRegisterOffset] = scope; }180 inline void setScope(int scopeRegisterOffset, JSScope*); 198 181 199 182 static void initDeprecatedCallFrameForDebugger(CallFrame* globalExec, JSCallee* globalCallee); … … 270 253 271 254 void setArgumentCountIncludingThis(int count) { static_cast<Register*>(this)[CallFrameSlot::argumentCount].payload() = count; } 272 void setCallee(JSObject* callee) { static_cast<Register*>(this)[CallFrameSlot::callee] = callee; }273 void setCodeBlock(CodeBlock* codeBlock) { static_cast<Register*>(this)[CallFrameSlot::codeBlock] = codeBlock; }255 inline void setCallee(JSObject*); 256 inline void setCodeBlock(CodeBlock*); 274 257 void setReturnPC(void* value) { callerFrameAndPC().returnPC = reinterpret_cast<const Instruction*>(value); } 275 258 … … 324 307 }; 325 308 326 // Helper function to get VM& from JSGlobalObject* if JSGlobalObject.h is not included.327 VM& getVM(JSGlobalObject*);328 309 JS_EXPORT_PRIVATE bool isFromJSCode(void* returnAddress); 329 310 -
trunk/Source/JavaScriptCore/interpreter/CallFrameInlines.h
r243925 r251584 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #include "JSCallee.h" 30 30 #include "JSGlobalObject.h" 31 #include "RegisterInlines.h" 31 32 32 33 namespace JSC { 34 35 inline Register& CallFrame::r(int index) 36 { 37 CodeBlock* codeBlock = this->codeBlock(); 38 if (codeBlock->isConstantRegisterIndex(index)) 39 return *reinterpret_cast<Register*>(&codeBlock->constantRegister(index)); 40 return this[index]; 41 } 42 43 inline Register& CallFrame::r(VirtualRegister reg) 44 { 45 return r(reg.offset()); 46 } 47 48 inline Register& CallFrame::uncheckedR(int index) 49 { 50 RELEASE_ASSERT(index < FirstConstantRegisterIndex); 51 return this[index]; 52 } 53 54 inline Register& CallFrame::uncheckedR(VirtualRegister reg) 55 { 56 return uncheckedR(reg.offset()); 57 } 58 59 inline JSValue CallFrame::guaranteedJSValueCallee() const 60 { 61 ASSERT(!callee().isWasm()); 62 return this[CallFrameSlot::callee].jsValue(); 63 } 64 65 inline JSObject* CallFrame::jsCallee() const 66 { 67 ASSERT(!callee().isWasm()); 68 return this[CallFrameSlot::callee].object(); 69 } 70 71 inline CodeBlock* CallFrame::codeBlock() const 72 { 73 return this[CallFrameSlot::codeBlock].Register::codeBlock(); 74 } 75 76 inline SUPPRESS_ASAN CodeBlock* CallFrame::unsafeCodeBlock() const 77 { 78 return this[CallFrameSlot::codeBlock].Register::asanUnsafeCodeBlock(); 79 } 80 81 inline JSGlobalObject* CallFrame::lexicalGlobalObject(VM& vm) const 82 { 83 UNUSED_PARAM(vm); 84 #if ENABLE(WEBASSEMBLY) 85 if (callee().isWasm()) 86 return lexicalGlobalObjectFromWasmCallee(vm); 87 #endif 88 return jsCallee()->globalObject(); 89 } 33 90 34 91 inline bool CallFrame::isStackOverflowFrame() const … … 44 101 } 45 102 103 inline void CallFrame::setCallee(JSObject* callee) 104 { 105 static_cast<Register*>(this)[CallFrameSlot::callee] = callee; 106 } 107 108 inline void CallFrame::setCodeBlock(CodeBlock* codeBlock) 109 { 110 static_cast<Register*>(this)[CallFrameSlot::codeBlock] = codeBlock; 111 } 112 113 inline void CallFrame::setScope(int scopeRegisterOffset, JSScope* scope) 114 { 115 static_cast<Register*>(this)[scopeRegisterOffset] = scope; 116 } 117 118 inline JSScope* CallFrame::scope(int scopeRegisterOffset) const 119 { 120 ASSERT(this[scopeRegisterOffset].Register::scope()); 121 return this[scopeRegisterOffset].Register::scope(); 122 } 123 124 inline Register* CallFrame::topOfFrame() 125 { 126 if (!codeBlock()) 127 return registers(); 128 return topOfFrameInternal(); 129 } 130 46 131 } // namespace JSC -
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r251529 r251584 67 67 #include "Parser.h" 68 68 #include "ProgramCodeBlock.h" 69 #include "ProtoCallFrame .h"69 #include "ProtoCallFrameInlines.h" 70 70 #include "RegExpObject.h" 71 71 #include "Register.h" -
trunk/Source/JavaScriptCore/interpreter/ProtoCallFrame.h
r250803 r251584 1 1 /* 2 * Copyright (C) 2013-201 8Apple Inc. All Rights Reserved.2 * Copyright (C) 2013-2019 Apple Inc. All Rights Reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 48 48 JSGlobalObject* globalObject; 49 49 50 void init(CodeBlock*, JSGlobalObject*, JSObject*, JSValue, int, JSValue* otherArgs = 0);50 inline void init(CodeBlock*, JSGlobalObject*, JSObject*, JSValue, int, JSValue* otherArgs = 0); 51 51 52 CodeBlock* codeBlock() const { return codeBlockValue.Register::codeBlock(); }53 void setCodeBlock(CodeBlock* codeBlock) { codeBlockValue = codeBlock; }52 inline CodeBlock* codeBlock() const; 53 inline void setCodeBlock(CodeBlock*); 54 54 55 JSObject* callee() const { return calleeValue.Register::object(); } 56 void setCallee(JSObject* callee) 57 { 58 calleeValue = callee; 59 } 55 inline JSObject* callee() const; 56 inline void setCallee(JSObject*); 60 57 void setGlobalObject(JSGlobalObject* object) 61 58 { … … 87 84 }; 88 85 89 inline void ProtoCallFrame::init(CodeBlock* codeBlock, JSGlobalObject* globalObject, JSObject* callee, JSValue thisValue, int argCountIncludingThis, JSValue* otherArgs)90 {91 this->args = otherArgs;92 this->setCodeBlock(codeBlock);93 this->setCallee(callee);94 this->setGlobalObject(globalObject);95 this->setArgumentCountIncludingThis(argCountIncludingThis);96 if (codeBlock && argCountIncludingThis < codeBlock->numParameters())97 this->hasArityMismatch = true;98 else99 this->hasArityMismatch = false;100 101 // Round up argCountIncludingThis to keep the stack frame size aligned.102 size_t paddedArgsCount = roundArgumentCountToAlignFrame(argCountIncludingThis);103 this->setPaddedArgCount(paddedArgsCount);104 this->clearCurrentVPC();105 this->setThisValue(thisValue);106 }107 108 86 } // namespace JSC -
trunk/Source/JavaScriptCore/interpreter/Register.h
r251425 r251584 1 1 /* 2 * Copyright (C) 2008-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2008-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 52 52 EncodedJSValue encodedJSValue() const; 53 53 54 Register& operator=(CallFrame*);55 Register& operator=(CodeBlock*);56 Register& operator=(JSScope*);57 Register& operator=(JSObject*);54 ALWAYS_INLINE Register& operator=(CallFrame*); 55 ALWAYS_INLINE Register& operator=(CodeBlock*); 56 ALWAYS_INLINE Register& operator=(JSScope*); 57 ALWAYS_INLINE Register& operator=(JSObject*); 58 58 59 59 int32_t i() const; 60 CallFrame* callFrame() const;61 CodeBlock* codeBlock() const;62 CodeBlock* asanUnsafeCodeBlock() const;63 JSObject* object() const;64 JSScope* scope() const;60 ALWAYS_INLINE CallFrame* callFrame() const; 61 ALWAYS_INLINE CodeBlock* codeBlock() const; 62 ALWAYS_INLINE CodeBlock* asanUnsafeCodeBlock() const; 63 ALWAYS_INLINE JSObject* object() const; 64 ALWAYS_INLINE JSScope* scope() const; 65 65 int32_t unboxedInt32() const; 66 66 int32_t asanUnsafeUnboxedInt32() const; … … 137 137 // Interpreter functions 138 138 139 ALWAYS_INLINE Register& Register::operator=(CallFrame* callFrame)140 {141 u.callFrame = callFrame;142 return *this;143 }144 145 ALWAYS_INLINE Register& Register::operator=(CodeBlock* codeBlock)146 {147 u.codeBlock = codeBlock;148 return *this;149 }150 151 139 ALWAYS_INLINE int32_t Register::i() const 152 140 { … … 154 142 } 155 143 156 ALWAYS_INLINE CallFrame* Register::callFrame() const157 {158 return u.callFrame;159 }160 161 ALWAYS_INLINE CodeBlock* Register::codeBlock() const162 {163 return u.codeBlock;164 }165 166 SUPPRESS_ASAN ALWAYS_INLINE CodeBlock* Register::asanUnsafeCodeBlock() const167 {168 return u.codeBlock;169 }170 171 144 ALWAYS_INLINE int32_t Register::unboxedInt32() const 172 145 { -
trunk/Source/JavaScriptCore/interpreter/StackVisitor.cpp
r251529 r251584 27 27 #include "StackVisitor.h" 28 28 29 #include "CallFrameInlines.h"30 29 #include "ClonedArguments.h" 31 30 #include "DebuggerPrimitives.h" -
trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h
r251518 r251584 36 36 #include "JITAllocator.h" 37 37 #include "JITCode.h" 38 #include "JSCellInlines.h" 38 39 #include "MacroAssembler.h" 39 40 #include "MarkedSpace.h" -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r251534 r251584 65 65 #include "OpcodeInlines.h" 66 66 #include "ProgramCodeBlock.h" 67 #include "ProtoCallFrame .h"67 #include "ProtoCallFrameInlines.h" 68 68 #include "RegExpObject.h" 69 69 #include "ShadowChicken.h" -
trunk/Source/JavaScriptCore/runtime/ArrayStorage.h
r225913 r251584 1 1 /* 2 * Copyright (C) 2012 , 2016Apple Inc. All rights reserved.2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 104 104 } 105 105 106 size_t totalSize(Structure* structure) const 107 { 108 return totalSize(structure->outOfLineCapacity()); 109 } 106 inline size_t totalSize(Structure*) const; 110 107 111 108 static unsigned availableVectorLength(unsigned indexBias, size_t propertyCapacity, unsigned vectorLength) … … 118 115 } 119 116 120 static unsigned availableVectorLength(unsigned indexBias, Structure* structure, unsigned vectorLength) 121 { 122 return availableVectorLength(indexBias, structure->outOfLineCapacity(), vectorLength); 123 } 117 inline static unsigned availableVectorLength(unsigned indexBias, Structure*, unsigned vectorLength); 124 118 125 unsigned availableVectorLength(size_t propertyCapacity, unsigned vectorLength) 126 { 127 return availableVectorLength(m_indexBias, propertyCapacity, vectorLength); 128 } 119 inline unsigned availableVectorLength(size_t propertyCapacity, unsigned vectorLength); 129 120 130 unsigned availableVectorLength(Structure* structure, unsigned vectorLength) 131 { 132 return availableVectorLength(structure->outOfLineCapacity(), vectorLength); 133 } 121 inline unsigned availableVectorLength(Structure*, unsigned vectorLength); 134 122 135 static unsigned optimalVectorLength(unsigned indexBias, size_t propertyCapacity, unsigned vectorLength) 136 { 137 vectorLength = std::max(BASE_ARRAY_STORAGE_VECTOR_LEN, vectorLength); 138 return availableVectorLength(indexBias, propertyCapacity, vectorLength); 139 } 123 inline static unsigned optimalVectorLength(unsigned indexBias, size_t propertyCapacity, unsigned vectorLength); 140 124 141 static unsigned optimalVectorLength(unsigned indexBias, Structure* structure, unsigned vectorLength) 142 { 143 return optimalVectorLength(indexBias, structure->outOfLineCapacity(), vectorLength); 144 } 125 inline static unsigned optimalVectorLength(unsigned indexBias, Structure*, unsigned vectorLength); 145 126 146 unsigned optimalVectorLength(size_t propertyCapacity, unsigned vectorLength) 147 { 148 return optimalVectorLength(m_indexBias, propertyCapacity, vectorLength); 149 } 127 inline unsigned optimalVectorLength(size_t propertyCapacity, unsigned vectorLength); 150 128 151 unsigned optimalVectorLength(Structure* structure, unsigned vectorLength) 152 { 153 return optimalVectorLength(structure->outOfLineCapacity(), vectorLength); 154 } 129 inline unsigned optimalVectorLength(Structure*, unsigned vectorLength); 155 130 156 131 WriteBarrier<SparseArrayValueMap> m_sparseMap; -
trunk/Source/JavaScriptCore/runtime/ButterflyInlines.h
r243688 r251584 1 1 /* 2 * Copyright (C) 2012-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2012-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "ArrayStorage .h"28 #include "ArrayStorageInlines.h" 29 29 #include "Butterfly.h" 30 30 #include "JSObject.h" -
trunk/Source/JavaScriptCore/runtime/ClassInfo.h
r251425 r251584 23 23 #pragma once 24 24 25 #include "CallFrame.h"26 25 #include "ConstructData.h" 27 26 #include "JSCast.h" -
trunk/Source/JavaScriptCore/runtime/JSArray.h
r251425 r251584 23 23 #include "ArgList.h" 24 24 #include "ArrayConventions.h" 25 #include "Butterfly Inlines.h"26 #include "JSCell Inlines.h"25 #include "Butterfly.h" 26 #include "JSCell.h" 27 27 #include "JSObject.h" 28 28 -
trunk/Source/JavaScriptCore/runtime/JSArrayInlines.h
r251425 r251584 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * This library is free software; you can redistribute it and/or … … 21 21 22 22 #include "ArrayPrototype.h" 23 #include "ButterflyInlines.h" 23 24 #include "Error.h" 24 25 #include "JSArray.h" -
trunk/Source/JavaScriptCore/runtime/JSCellInlines.h
r251457 r251584 30 30 #include "CompleteSubspaceInlines.h" 31 31 #include "CPU.h" 32 #include "CallFrame .h"32 #include "CallFrameInlines.h" 33 33 #include "DeferGC.h" 34 34 #include "FreeListInlines.h" -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h
r251556 r251584 28 28 #include "ErrorType.h" 29 29 #include "ExceptionHelpers.h" 30 #include "GetVM.h" 30 31 #include "InternalFunction.h" 31 32 #include "JSArray.h" -
trunk/Source/JavaScriptCore/runtime/JSObject.h
r251425 r251584 1498 1498 } 1499 1499 1500 ALWAYS_INLINE JSObject* Register::object() const1501 {1502 return asObject(jsValue());1503 }1504 1505 ALWAYS_INLINE Register& Register::operator=(JSObject* object)1506 {1507 u.value = JSValue::encode(JSValue(object));1508 return *this;1509 }1510 1511 1500 inline size_t offsetInButterfly(PropertyOffset offset) 1512 1501 { -
trunk/Source/JavaScriptCore/runtime/JSObjectInlines.h
r251425 r251584 2 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2003-201 7Apple Inc. All rights reserved.4 * Copyright (C) 2003-2019 Apple Inc. All rights reserved. 5 5 * Copyright (C) 2007 Eric Seidel (eric@webkit.org) 6 6 * … … 25 25 26 26 #include "AuxiliaryBarrierInlines.h" 27 #include "ButterflyInlines.h" 27 28 #include "Error.h" 28 29 #include "JSObject.h" -
trunk/Source/JavaScriptCore/runtime/JSScope.h
r251529 r251584 130 130 } 131 131 132 inline Register& Register::operator=(JSScope* scope)133 {134 *this = JSValue(scope);135 return *this;136 }137 138 inline JSScope* Register::scope() const139 {140 return jsCast<JSScope*>(unboxedCell());141 }142 143 inline JSGlobalObject* CallFrame::lexicalGlobalObject(VM& vm) const144 {145 UNUSED_PARAM(vm);146 #if ENABLE(WEBASSEMBLY)147 if (callee().isWasm())148 return lexicalGlobalObjectFromWasmCallee(vm);149 #endif150 return jsCallee()->globalObject();151 }152 153 132 inline size_t JSScope::offsetOfNext() 154 133 { -
trunk/Source/JavaScriptCore/runtime/JSString.h
r251425 r251584 26 26 #include "CallFrame.h" 27 27 #include "CommonIdentifiers.h" 28 #include "GetVM.h" 28 29 #include "Identifier.h" 29 30 #include "PropertyDescriptor.h" -
trunk/Source/JavaScriptCore/runtime/PropertyNameArray.h
r250005 r251584 21 21 #pragma once 22 22 23 #include "CallFrame.h"24 23 #include "Identifier.h" 25 24 #include <wtf/HashSet.h> -
trunk/Source/JavaScriptCore/runtime/PropertySlot.h
r251425 r251584 21 21 #pragma once 22 22 23 #include "CallFrame.h"24 23 #include "DOMAnnotation.h" 24 #include "GetVM.h" 25 25 #include "JSCJSValue.h" 26 26 #include "PropertyName.h" -
trunk/Source/JavaScriptCore/runtime/VMInlines.h
r236381 r251584 1 1 /* 2 * Copyright (C) 2015-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "CallFrameInlines.h"29 28 #include "EntryFrame.h" 30 29 #include "ProfilerDatabase.h" -
trunk/Source/JavaScriptCore/tools/HeapVerifier.cpp
r250005 r251584 27 27 #include "HeapVerifier.h" 28 28 29 #include "ButterflyInlines.h" 29 30 #include "CodeBlockInlines.h" 30 31 #include "HeapIterationScope.h" -
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
r251425 r251584 41 41 #include "LLIntThunks.h" 42 42 #include "LinkBuffer.h" 43 #include "ProtoCallFrame .h"43 #include "ProtoCallFrameInlines.h" 44 44 #include "VM.h" 45 45 #include "WasmCallee.h" -
trunk/Source/WebCore/ChangeLog
r251582 r251584 1 2019-10-24 Mark Lam <mark.lam@apple.com> 2 3 Move JSC::Register inline methods into RegisterInlines.h. 4 https://bugs.webkit.org/show_bug.cgi?id=203391 5 6 Reviewed by Yusuke Suzuki and Keith Miller. 7 8 No new tests needed because there is no behavior change. 9 10 * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: 11 1 12 2019-10-24 Alex Christensen <achristensen@webkit.org> 2 13 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm
r251425 r251584 1 1 /* 2 * Copyright (C) 2015 Apple Inc. All rights reserved.2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 37 37 #import <AVFoundation/AVError.h> 38 38 #import <CoreMedia/CMBase.h> 39 #import <JavaScriptCore/HeapInlines.h> 40 #import <JavaScriptCore/JSCellInlines.h> 39 41 #import <JavaScriptCore/JSGlobalObjectInlines.h> 40 42 #import <JavaScriptCore/TypedArrayInlines.h>
Note: See TracChangeset
for help on using the changeset viewer.