Title: [255802] releases/WebKitGTK/webkit-2.28/Source/_javascript_Core
- Revision
- 255802
- Author
- [email protected]
- Date
- 2020-02-05 02:50:53 -0800 (Wed, 05 Feb 2020)
Log Message
Merge r255703 - [JSC] Use PackedRefPtr in UnlinkedCodeBlock
https://bugs.webkit.org/show_bug.cgi?id=207229
Reviewed by Mark Lam.
Use PackedRefPtr in UnlinkedCodeBlock to compact it from 168 to 160, which saves 16 bytes (10%) per UnlinkedCodeBlock since
we have 16 bytes alignment for GC cells.
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::sourceURLDirective const):
(JSC::UnlinkedCodeBlock::sourceMappingURLDirective const):
(JSC::UnlinkedCodeBlock::setSourceURLDirective):
(JSC::UnlinkedCodeBlock::setSourceMappingURLDirective):
* runtime/CachedTypes.cpp:
(JSC::CachedCodeBlock::sourceURLDirective const):
(JSC::CachedCodeBlock::sourceMappingURLDirective const):
(JSC::CachedCodeBlock<CodeBlockType>::encode):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalCodeBlock):
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/ChangeLog (255801 => 255802)
--- releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/ChangeLog 2020-02-05 10:50:48 UTC (rev 255801)
+++ releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/ChangeLog 2020-02-05 10:50:53 UTC (rev 255802)
@@ -1,3 +1,25 @@
+2020-02-04 Yusuke Suzuki <[email protected]>
+
+ [JSC] Use PackedRefPtr in UnlinkedCodeBlock
+ https://bugs.webkit.org/show_bug.cgi?id=207229
+
+ Reviewed by Mark Lam.
+
+ Use PackedRefPtr in UnlinkedCodeBlock to compact it from 168 to 160, which saves 16 bytes (10%) per UnlinkedCodeBlock since
+ we have 16 bytes alignment for GC cells.
+
+ * bytecode/UnlinkedCodeBlock.h:
+ (JSC::UnlinkedCodeBlock::sourceURLDirective const):
+ (JSC::UnlinkedCodeBlock::sourceMappingURLDirective const):
+ (JSC::UnlinkedCodeBlock::setSourceURLDirective):
+ (JSC::UnlinkedCodeBlock::setSourceMappingURLDirective):
+ * runtime/CachedTypes.cpp:
+ (JSC::CachedCodeBlock::sourceURLDirective const):
+ (JSC::CachedCodeBlock::sourceMappingURLDirective const):
+ (JSC::CachedCodeBlock<CodeBlockType>::encode):
+ * runtime/CodeCache.cpp:
+ (JSC::CodeCache::getUnlinkedGlobalCodeBlock):
+
2020-02-04 Alexey Shvayka <[email protected]>
Quantifiers after lookahead assertions should be syntax errors in Unicode patterns only
Modified: releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h (255801 => 255802)
--- releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h 2020-02-05 10:50:48 UTC (rev 255801)
+++ releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h 2020-02-05 10:50:53 UTC (rev 255802)
@@ -224,10 +224,10 @@
m_endColumn = endColumn;
}
- const String& sourceURLDirective() const { return m_sourceURLDirective; }
- const String& sourceMappingURLDirective() const { return m_sourceMappingURLDirective; }
- void setSourceURLDirective(const String& sourceURL) { m_sourceURLDirective = sourceURL; }
- void setSourceMappingURLDirective(const String& sourceMappingURL) { m_sourceMappingURLDirective = sourceMappingURL; }
+ StringImpl* sourceURLDirective() const { return m_sourceURLDirective.get(); }
+ StringImpl* sourceMappingURLDirective() const { return m_sourceMappingURLDirective.get(); }
+ void setSourceURLDirective(const String& sourceURL) { m_sourceURLDirective = sourceURL.impl(); }
+ void setSourceMappingURLDirective(const String& sourceMappingURL) { m_sourceMappingURLDirective = sourceMappingURL.impl(); }
CodeFeatures codeFeatures() const { return m_features; }
bool hasCapturedVariables() const { return m_hasCapturedVariables; }
@@ -366,8 +366,8 @@
int m_numCalleeLocals { 0 };
int m_numParameters { 0 };
- String m_sourceURLDirective;
- String m_sourceMappingURLDirective;
+ PackedRefPtr<StringImpl> m_sourceURLDirective;
+ PackedRefPtr<StringImpl> m_sourceMappingURLDirective;
RefCountedArray<InstructionStream::Offset> m_jumpTargets;
Ref<UnlinkedMetadataTable> m_metadata;
Modified: releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/runtime/CachedTypes.cpp (255801 => 255802)
--- releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/runtime/CachedTypes.cpp 2020-02-05 10:50:48 UTC (rev 255801)
+++ releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/runtime/CachedTypes.cpp 2020-02-05 10:50:53 UTC (rev 255802)
@@ -1798,8 +1798,8 @@
VirtualRegister thisRegister() const { return m_thisRegister; }
VirtualRegister scopeRegister() const { return m_scopeRegister; }
- String sourceURLDirective(Decoder& decoder) const { return m_sourceURLDirective.decode(decoder); }
- String sourceMappingURLDirective(Decoder& decoder) const { return m_sourceMappingURLDirective.decode(decoder); }
+ RefPtr<StringImpl> sourceURLDirective(Decoder& decoder) const { return m_sourceURLDirective.decode(decoder); }
+ RefPtr<StringImpl> sourceMappingURLDirective(Decoder& decoder) const { return m_sourceMappingURLDirective.decode(decoder); }
Ref<UnlinkedMetadataTable> metadata(Decoder& decoder) const { return m_metadata.decode(decoder); }
@@ -1868,8 +1868,8 @@
CachedPtr<CachedCodeBlockRareData> m_rareData;
- CachedString m_sourceURLDirective;
- CachedString m_sourceMappingURLDirective;
+ CachedRefPtr<CachedStringImpl> m_sourceURLDirective;
+ CachedRefPtr<CachedStringImpl> m_sourceMappingURLDirective;
CachedPtr<CachedInstructionStream> m_instructions;
CachedVector<InstructionStream::Offset> m_jumpTargets;
@@ -2246,8 +2246,8 @@
m_metadata.encode(encoder, codeBlock.m_metadata.get());
m_rareData.encode(encoder, codeBlock.m_rareData.get());
- m_sourceURLDirective.encode(encoder, codeBlock.m_sourceURLDirective.impl());
- m_sourceMappingURLDirective.encode(encoder, codeBlock.m_sourceURLDirective.impl());
+ m_sourceURLDirective.encode(encoder, codeBlock.m_sourceURLDirective.get());
+ m_sourceMappingURLDirective.encode(encoder, codeBlock.m_sourceURLDirective.get());
m_instructions.encode(encoder, codeBlock.m_instructions.get());
m_constantRegisters.encode(encoder, codeBlock.m_constantRegisters);
Modified: releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/runtime/CodeCache.cpp (255801 => 255802)
--- releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/runtime/CodeCache.cpp 2020-02-05 10:50:48 UTC (rev 255801)
+++ releases/WebKitGTK/webkit-2.28/Source/_javascript_Core/runtime/CodeCache.cpp 2020-02-05 10:50:53 UTC (rev 255802)
@@ -161,9 +161,9 @@
bool endColumnIsOnStartLine = !lineCount;
unsigned endColumn = unlinkedCodeBlock->endColumn() + (endColumnIsOnStartLine ? startColumn : 1);
executable->recordParse(unlinkedCodeBlock->codeFeatures(), unlinkedCodeBlock->hasCapturedVariables(), source.firstLine().oneBasedInt() + lineCount, endColumn);
- if (!unlinkedCodeBlock->sourceURLDirective().isNull())
+ if (unlinkedCodeBlock->sourceURLDirective())
source.provider()->setSourceURLDirective(unlinkedCodeBlock->sourceURLDirective());
- if (!unlinkedCodeBlock->sourceMappingURLDirective().isNull())
+ if (unlinkedCodeBlock->sourceMappingURLDirective())
source.provider()->setSourceMappingURLDirective(unlinkedCodeBlock->sourceMappingURLDirective());
return unlinkedCodeBlock;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes