Changeset 254416 in webkit
- Timestamp:
- Jan 12, 2020 2:42:53 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r254396 r254416 1 2020-01-12 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [WebCore] Reorganize JSType in WebCore to offer more bits to JSC 4 https://bugs.webkit.org/show_bug.cgi?id=206141 5 6 Reviewed by Keith Miller. 7 8 * runtime/JSType.h: 9 1 10 2020-01-11 Yusuke Suzuki <ysuzuki@apple.com> 2 11 -
trunk/Source/JavaScriptCore/runtime/JSType.h
r254252 r254416 138 138 139 139 static_assert(sizeof(JSType) == sizeof(uint8_t), "sizeof(JSType) is one byte."); 140 static_assert(LastJSCObjectType < 128, "The highest bit is reserved for embedder's extension.");140 static_assert(LastJSCObjectType < 0b11100000, "Embedder can use 0b11100000 or upper."); 141 141 142 142 inline constexpr bool isTypedArrayType(JSType type) -
trunk/Source/WebCore/ChangeLog
r254414 r254416 1 2020-01-12 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [WebCore] Reorganize JSType in WebCore to offer more bits to JSC 4 https://bugs.webkit.org/show_bug.cgi?id=206141 5 6 Reviewed by Keith Miller. 7 8 This patch reorganize JSType a bit to offer more bits to JSC. Then JSC can use JSType for types easily. 9 10 * bindings/js/JSDOMWrapper.h: 11 * bindings/js/JSElementCustom.h: 12 (JSC::JSCastingHelpers::InheritsTraits<WebCore::JSElement>::inherits): 13 * domjit/DOMJITHelpers.h: 14 (WebCore::DOMJIT::branchIfElement): 15 (WebCore::DOMJIT::branchIfNotElement): 16 1 17 2019-12-20 Darin Adler <darin@apple.com> 2 18 -
trunk/Source/WebCore/bindings/js/JSDOMWrapper.h
r253443 r254416 30 30 class ScriptExecutionContext; 31 31 32 // JSC allows us to extend JSType. If the highest bit isset, we can add any Object types and they are32 // JSC allows us to extend JSType. If the highest 3 bits are set, we can add any Object types and they are 33 33 // recognized as OtherObj in JSC. And we encode Node type into JSType if the given JSType is subclass of Node. 34 // offset | 7 | 6 | 5 4 |3 2 1 0 |35 // value | 1 | 0 | Non-node DOM types|34 // offset | 7 | 6 | 5 | 4 3 2 1 0 | 35 // value | 1 | 1 | 1 | Non-node DOM types | 36 36 // If the given JSType is a subclass of Node, the format is the following. 37 // offset | 7 | 6 | 5 4 | 3 2 1 0 | 38 // value | 1 | 1 | Kind | NodeType | 37 // offset | 7 | 6 | 5 | 4 | 3 2 1 0 | 38 // value | 1 | 1 | 1 | 1 | NodeType | 39 40 static const uint8_t JSDOMWrapperType = 0b11101110; 41 static const uint8_t JSEventType = 0b11101111; 42 static const uint8_t JSNodeType = 0b11110000; 39 43 static const uint8_t JSNodeTypeMask = 0b00001111; 40 41 static const uint8_t JSDOMWrapperType = 0b10000000;42 static const uint8_t JSEventType = 0b10000001;43 static const uint8_t JSNodeType = 0b11000000;44 44 static const uint8_t JSTextNodeType = JSNodeType | NodeConstants::TEXT_NODE; 45 45 static const uint8_t JSProcessingInstructionNodeType = JSNodeType | NodeConstants::PROCESSING_INSTRUCTION_NODE; … … 50 50 static const uint8_t JSCDATASectionNodeType = JSNodeType | NodeConstants::CDATA_SECTION_NODE; 51 51 static const uint8_t JSAttrNodeType = JSNodeType | NodeConstants::ATTRIBUTE_NODE; 52 static const uint8_t JSElementType = 0b11 010000 | NodeConstants::ELEMENT_NODE;52 static const uint8_t JSElementType = 0b11110000 | NodeConstants::ELEMENT_NODE; 53 53 54 54 static_assert(JSDOMWrapperType > JSC::LastJSCObjectType, "JSC::JSType offers the highest bit."); -
trunk/Source/WebCore/bindings/js/JSElementCustom.h
r229416 r254416 38 38 static inline bool inherits(VM&, From* from) 39 39 { 40 return from->type() >= WebCore::JSElementType;40 return from->type() == WebCore::JSElementType; 41 41 } 42 42 }; -
trunk/Source/WebCore/domjit/DOMJITHelpers.h
r251518 r254416 142 142 { 143 143 return jit.branch8( 144 CCallHelpers:: AboveOrEqual,144 CCallHelpers::Equal, 145 145 CCallHelpers::Address(target, JSC::JSCell::typeInfoTypeOffset()), 146 146 CCallHelpers::TrustedImm32(JSC::JSType(JSElementType))); … … 150 150 { 151 151 return jit.branch8( 152 CCallHelpers:: Below,152 CCallHelpers::NotEqual, 153 153 CCallHelpers::Address(target, JSC::JSCell::typeInfoTypeOffset()), 154 154 CCallHelpers::TrustedImm32(JSC::JSType(JSElementType)));
Note: See TracChangeset
for help on using the changeset viewer.