Changeset 244578 in webkit
- Timestamp:
- Apr 23, 2019, 6:50:50 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 9 edited
- 1 copied
-
ChangeLog (modified) (1 diff)
-
JavaScriptCore.xcodeproj/project.pbxproj (modified) (9 diffs)
-
bytecode/DataFormat.h (modified) (1 diff)
-
bytecode/ValueRecovery.h (modified) (1 diff)
-
dfg/DFGGenerationInfo.h (modified) (1 diff)
-
dfg/DFGMinifiedID.h (modified) (1 diff)
-
dfg/DFGMinifiedIDInlines.h (copied) (copied from trunk/Source/JavaScriptCore/dfg/DFGMinifiedNode.cpp ) (2 diffs)
-
dfg/DFGMinifiedNode.cpp (modified) (1 diff)
-
dfg/DFGValueSource.h (modified) (2 diffs)
-
dfg/DFGVariableEvent.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r244575 r244578 1 2019-04-23 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Use node index as DFG::MinifiedID 4 https://bugs.webkit.org/show_bug.cgi?id=197186 5 6 Reviewed by Saam Barati. 7 8 DFG Nodes can be identified with index if the graph is given. We should use unsigned index as a DFG::MinifiedID's underlying 9 source instead of Node* to reduce the size of VariableEvent from 16 to 12. Vector<VariableEvent> is the main data in DFG's OSR 10 tracking. It is kept after DFG compilation is done to make OSR work. We saw that this is allocated with large size in GMail. 11 12 * JavaScriptCore.xcodeproj/project.pbxproj: 13 * bytecode/DataFormat.h: 14 * bytecode/ValueRecovery.h: 15 * dfg/DFGGenerationInfo.h: 16 * dfg/DFGMinifiedID.h: 17 (JSC::DFG::MinifiedID::MinifiedID): 18 (JSC::DFG::MinifiedID::operator! const): 19 (JSC::DFG::MinifiedID::operator== const): 20 (JSC::DFG::MinifiedID::operator!= const): 21 (JSC::DFG::MinifiedID::operator< const): 22 (JSC::DFG::MinifiedID::operator> const): 23 (JSC::DFG::MinifiedID::operator<= const): 24 (JSC::DFG::MinifiedID::operator>= const): 25 (JSC::DFG::MinifiedID::hash const): 26 (JSC::DFG::MinifiedID::dump const): 27 (JSC::DFG::MinifiedID::isHashTableDeletedValue const): 28 (JSC::DFG::MinifiedID::fromBits): 29 (JSC::DFG::MinifiedID::bits const): 30 (JSC::DFG::MinifiedID::invalidIndex): 31 (JSC::DFG::MinifiedID::otherInvalidIndex): 32 (JSC::DFG::MinifiedID::node const): Deleted. 33 (JSC::DFG::MinifiedID::invalidID): Deleted. 34 (JSC::DFG::MinifiedID::otherInvalidID): Deleted. 35 * dfg/DFGMinifiedIDInlines.h: Copied from Source/JavaScriptCore/dfg/DFGMinifiedNode.cpp. 36 (JSC::DFG::MinifiedID::MinifiedID): 37 * dfg/DFGMinifiedNode.cpp: 38 * dfg/DFGValueSource.h: 39 (JSC::DFG::ValueSource::ValueSource): 40 * dfg/DFGVariableEvent.h: 41 (JSC::DFG::VariableEvent::dataFormat const): 42 1 43 2019-04-23 Keith Rollin <krollin@apple.com> 2 44 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r244575 r244578 1784 1784 E36CC9472086314F0051FFD6 /* WasmCreationMode.h in Headers */ = {isa = PBXBuildFile; fileRef = E36CC9462086314F0051FFD6 /* WasmCreationMode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1785 1785 E3794E761B77EB97005543AE /* ModuleAnalyzer.h in Headers */ = {isa = PBXBuildFile; fileRef = E3794E741B77EB97005543AE /* ModuleAnalyzer.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1786 E3850B15226ED641009ABF9C /* DFGMinifiedIDInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = E3850B14226ED63E009ABF9C /* DFGMinifiedIDInlines.h */; }; 1786 1787 E3893A1D2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = E3893A1C2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h */; }; 1787 1788 E38D999C221B78BB00D50474 /* JSNonDestructibleProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = E38D999A221B789F00D50474 /* JSNonDestructibleProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 4782 4783 E380A76B1DCD7195000F89E6 /* MacroAssemblerHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerHelpers.h; sourceTree = "<group>"; }; 4783 4784 E380D66B1F19249D00A59095 /* BuiltinNames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BuiltinNames.cpp; sourceTree = "<group>"; }; 4785 E3850B14226ED63E009ABF9C /* DFGMinifiedIDInlines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DFGMinifiedIDInlines.h; path = dfg/DFGMinifiedIDInlines.h; sourceTree = "<group>"; }; 4784 4786 E3893A1C2203A7C600E79A74 /* AsyncFromSyncIteratorPrototype.lut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncFromSyncIteratorPrototype.lut.h; sourceTree = "<group>"; }; 4785 4787 E38D060B1F8E814100649CF2 /* JSScriptFetchParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptFetchParameters.h; sourceTree = "<group>"; }; … … 6003 6005 0F7C5FB71D888A010044F5E2 /* MarkedBlockInlines.h */, 6004 6006 141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */, 6007 33B2A54522651D53005A0F79 /* MarkedSpace.cpp */, 6005 6008 14D2F3D9139F4BE200491031 /* MarkedSpace.h */, 6006 6009 0F7DF1301E2970D50095951B /* MarkedSpaceInlines.h */, 6007 33B2A54522651D53005A0F79 /* MarkedSpace.cpp */,6008 6010 0F660E331E0517B70031462C /* MarkingConstraint.cpp */, 6009 6011 0F660E341E0517B70031462C /* MarkingConstraint.h */, … … 7599 7601 0F2BDC3D1522801700CD8910 /* DFGMinifiedGraph.h */, 7600 7602 0FB4B51016B3A964003F696B /* DFGMinifiedID.h */, 7603 E3850B14226ED63E009ABF9C /* DFGMinifiedIDInlines.h */, 7601 7604 0F2BDC4C1522818300CD8910 /* DFGMinifiedNode.cpp */, 7602 7605 0F2BDC3E1522801700CD8910 /* DFGMinifiedNode.h */, … … 8522 8525 0FB3878E1BFBC44D00E3AB1E /* AirBlockWorklist.h in Headers */, 8523 8526 0F79C7CA1E74C93B00EB34D1 /* AirBreakCriticalEdges.h in Headers */, 8524 33B2A54722653481005A0F79 /* B3ValueInlines.h in Headers */,8525 8527 0F61832A1C45BF070072450B /* AirCCallingConvention.h in Headers */, 8526 8528 0FEC85741BDACDC70080FF74 /* AirCCallSpecial.h in Headers */, … … 8715 8717 0FEC85421BDACDAC0080FF74 /* B3Validate.h in Headers */, 8716 8718 0FEC85441BDACDAC0080FF74 /* B3Value.h in Headers */, 8719 33B2A54722653481005A0F79 /* B3ValueInlines.h in Headers */, 8717 8720 0F338E151BF0276C0013C88F /* B3ValueKey.h in Headers */, 8718 8721 0F338E161BF0276C0013C88F /* B3ValueKeyInlines.h in Headers */, … … 8968 8971 0F2BDC451522801B00CD8910 /* DFGMinifiedGraph.h in Headers */, 8969 8972 0F2E892D16D02BAF009E4FD2 /* DFGMinifiedID.h in Headers */, 8973 E3850B15226ED641009ABF9C /* DFGMinifiedIDInlines.h in Headers */, 8970 8974 0F2BDC461522802000CD8910 /* DFGMinifiedNode.h in Headers */, 8971 8975 0F8F14361ADF090100ED792C /* DFGMovHintRemovalPhase.h in Headers */, … … 10719 10723 5333BBDB2110F7D2007618EC /* DFGSpeculativeJIT32_64.cpp in Sources */, 10720 10724 5333BBDD2110F7E1007618EC /* DFGSpeculativeJIT64.cpp in Sources */, 10725 33B2A548226543BF005A0F79 /* FTLLowerDFGToB3.cpp in Sources */, 10721 10726 536B319E1F735F160037FC33 /* LowLevelInterpreter.cpp in Sources */, 10722 10727 0FF4274A158EBE91004CB9FF /* udis86.c in Sources */, … … 10852 10857 536B31261F71C5990037FC33 /* UnifiedSource120.cpp in Sources */, 10853 10858 536B312D1F71C5990037FC33 /* UnifiedSource121.cpp in Sources */, 10854 33B2A548226543BF005A0F79 /* FTLLowerDFGToB3.cpp in Sources */,10855 10859 536B31251F71C5990037FC33 /* UnifiedSource122.cpp in Sources */, 10856 10860 536B311E1F71C5990037FC33 /* UnifiedSource123.cpp in Sources */, -
trunk/Source/JavaScriptCore/bytecode/DataFormat.h
r235106 r244578 36 36 // For boxed values, we may know the type of boxing that has taken place. 37 37 // (May also need bool, array, object, string types!) 38 enum DataFormat {38 enum DataFormat : uint8_t { 39 39 DataFormatNone = 0, 40 40 DataFormatInt32 = 1, -
trunk/Source/JavaScriptCore/bytecode/ValueRecovery.h
r207475 r244578 420 420 int virtualReg; 421 421 EncodedJSValue constant; 422 u intptr_tnodeID;422 unsigned nodeID; 423 423 } m_source; 424 424 }; -
trunk/Source/JavaScriptCore/dfg/DFGGenerationInfo.h
r218794 r244578 28 28 #if ENABLE(DFG_JIT) 29 29 30 #include "DFGMinifiedID .h"30 #include "DFGMinifiedIDInlines.h" 31 31 #include "DFGVariableEvent.h" 32 32 #include "DFGVariableEventStream.h" -
trunk/Source/JavaScriptCore/dfg/DFGMinifiedID.h
r206525 r244578 39 39 class MinifiedID { 40 40 public: 41 MinifiedID() : m_id(invalidID()) { }42 MinifiedID(WTF::HashTableDeletedValueType) : m_i d(otherInvalidID()) { }43 explicit MinifiedID(Node* node) : m_id(bitwise_cast<uintptr_t>(node)) { }41 MinifiedID() = default; 42 MinifiedID(WTF::HashTableDeletedValueType) : m_index(otherInvalidIndex()) { } 43 explicit MinifiedID(Node* node); 44 44 45 bool operator!() const { return m_i d == invalidID(); }45 bool operator!() const { return m_index == invalidIndex(); } 46 46 47 // This takes Graph& to remind you, that you should only be calling this method 48 // when you're in the main compilation pass (i.e. you have a graph) and not later, 49 // like during OSR exit compilation. 50 Node* node(const Graph&) const { return bitwise_cast<Node*>(m_id); } 47 bool operator==(const MinifiedID& other) const { return m_index == other.m_index; } 48 bool operator!=(const MinifiedID& other) const { return m_index != other.m_index; } 49 bool operator<(const MinifiedID& other) const { return m_index < other.m_index; } 50 bool operator>(const MinifiedID& other) const { return m_index > other.m_index; } 51 bool operator<=(const MinifiedID& other) const { return m_index <= other.m_index; } 52 bool operator>=(const MinifiedID& other) const { return m_index >= other.m_index; } 51 53 52 bool operator==(const MinifiedID& other) const { return m_id == other.m_id; } 53 bool operator!=(const MinifiedID& other) const { return m_id != other.m_id; } 54 bool operator<(const MinifiedID& other) const { return m_id < other.m_id; } 55 bool operator>(const MinifiedID& other) const { return m_id > other.m_id; } 56 bool operator<=(const MinifiedID& other) const { return m_id <= other.m_id; } 57 bool operator>=(const MinifiedID& other) const { return m_id >= other.m_id; } 54 unsigned hash() const { return WTF::IntHash<unsigned>::hash(m_index); } 58 55 59 unsigned hash() const { return WTF::IntHash<uintptr_t>::hash(m_id); }56 void dump(PrintStream& out) const { out.print(m_index); } 60 57 61 void dump(PrintStream& out) const { out.print(RawPointer(reinterpret_cast<void*>(m_id))); }58 bool isHashTableDeletedValue() const { return m_index == otherInvalidIndex(); } 62 59 63 bool isHashTableDeletedValue() const { return m_id == otherInvalidID(); } 64 65 static MinifiedID fromBits(uintptr_t value) 60 static MinifiedID fromBits(unsigned value) 66 61 { 67 62 MinifiedID result; 68 result.m_i d= value;63 result.m_index = value; 69 64 return result; 70 65 } 71 66 72 u intptr_t bits() const { return m_id; }67 unsigned bits() const { return m_index; } 73 68 74 69 private: 75 70 friend class MinifiedNode; 76 71 77 static uintptr_t invalidID() { return static_cast<uintptr_t>(static_cast<intptr_t>(-1)); }78 static uintptr_t otherInvalidID() { return static_cast<uintptr_t>(static_cast<intptr_t>(-2)); }72 static constexpr unsigned invalidIndex() { return static_cast<unsigned>(-1); } 73 static constexpr unsigned otherInvalidIndex() { return static_cast<unsigned>(-2); } 79 74 80 u intptr_t m_id;75 unsigned m_index { invalidIndex() }; 81 76 }; 82 77 -
trunk/Source/JavaScriptCore/dfg/DFGMinifiedIDInlines.h
r244577 r244578 1 1 /* 2 * Copyright (C) 201 2-2015Apple Inc. All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 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. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 #include "config.h" 27 #include "DFGMinifiedNode.h" 26 #pragma once 28 27 29 #i f ENABLE(DFG_JIT)28 #include "DFGMinifiedID.h" 30 29 31 30 #include "DFGNode.h" 32 #include "JSCInlines.h"33 31 34 namespace JSC { namespace DFG { 32 namespace JSC { 33 namespace DFG { 35 34 36 MinifiedNode MinifiedNode::fromNode(Node* node) 35 inline MinifiedID::MinifiedID(Node* node) 36 : m_index(node->index()) 37 37 { 38 ASSERT(belongsInMinifiedGraph(node->op())); 39 MinifiedNode result; 40 result.m_id = MinifiedID(node); 41 result.m_op = node->op(); 42 if (hasConstant(node->op())) 43 result.m_info = JSValue::encode(node->asJSValue()); 44 else { 45 ASSERT(node->op() == PhantomDirectArguments || node->op() == PhantomClonedArguments); 46 result.m_info = bitwise_cast<uintptr_t>(node->origin.semantic.inlineCallFrame()); 47 } 48 return result; 38 RELEASE_ASSERT(m_index != invalidIndex() && m_index != otherInvalidIndex()); 49 39 } 50 40 51 41 } } // namespace JSC::DFG 52 53 #endif // ENABLE(DFG_JIT)54 -
trunk/Source/JavaScriptCore/dfg/DFGMinifiedNode.cpp
r243232 r244578 29 29 #if ENABLE(DFG_JIT) 30 30 31 #include "DFGMinifiedIDInlines.h" 31 32 #include "DFGNode.h" 32 33 #include "JSCInlines.h" -
trunk/Source/JavaScriptCore/dfg/DFGValueSource.h
r218794 r244578 126 126 ValueSource(ValueSourceKind valueSourceKind, VirtualRegister where) 127 127 : m_kind(valueSourceKind) 128 , m_value( static_cast<intptr_t>(where.offset()))128 , m_value(where.offset()) 129 129 { 130 130 ASSERT(kind() != SourceNotSet); … … 209 209 private: 210 210 ValueSourceKind m_kind; 211 u intptr_tm_value;211 unsigned m_value; 212 212 }; 213 213 -
trunk/Source/JavaScriptCore/dfg/DFGVariableEvent.h
r218794 r244578 199 199 m_kind == BirthToFill || m_kind == Fill || m_kind == BirthToSpill || m_kind == Spill 200 200 || m_kind == SetLocalEvent); 201 return static_cast<DataFormat>(m_dataFormat);201 return m_dataFormat; 202 202 } 203 203 … … 263 263 union { 264 264 int virtualReg; 265 u intptr_tid;265 unsigned id; 266 266 } m_which; 267 267 … … 277 277 278 278 int8_t m_kind; 279 int8_t m_dataFormat;279 DataFormat m_dataFormat { DataFormatNone }; 280 280 }; 281 281
Note:
See TracChangeset
for help on using the changeset viewer.