Title: [275285] trunk/Source/_javascript_Core
- Revision
- 275285
- Author
- commit-qu...@webkit.org
- Date
- 2021-03-31 09:15:15 -0700 (Wed, 31 Mar 2021)
Log Message
[JSC] Remove warnings about unnecessary operator= for ARMv7Assembler LinkRecord
https://bugs.webkit.org/show_bug.cgi?id=223916
Patch by Xan Lopez <x...@igalia.com> on 2021-03-31
Reviewed by Darin Adler.
Many years ago we defined an assignment operator for LinkRecord in
order to speed up build times (see #90930). Recent GCC versions
tell us that if we do that we almost certainly want to define a
copy constructor too. The ARM64Assembler file already does it, so
do it too for ARMv7 to remove the warnings.
* assembler/ARM64Assembler.h:
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::LinkRecord::LinkRecord):
(JSC::ARMv7Assembler::LinkRecord::operator=):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (275284 => 275285)
--- trunk/Source/_javascript_Core/ChangeLog 2021-03-31 16:10:48 UTC (rev 275284)
+++ trunk/Source/_javascript_Core/ChangeLog 2021-03-31 16:15:15 UTC (rev 275285)
@@ -1,3 +1,21 @@
+2021-03-31 Xan Lopez <x...@igalia.com>
+
+ [JSC] Remove warnings about unnecessary operator= for ARMv7Assembler LinkRecord
+ https://bugs.webkit.org/show_bug.cgi?id=223916
+
+ Reviewed by Darin Adler.
+
+ Many years ago we defined an assignment operator for LinkRecord in
+ order to speed up build times (see #90930). Recent GCC versions
+ tell us that if we do that we almost certainly want to define a
+ copy constructor too. The ARM64Assembler file already does it, so
+ do it too for ARMv7 to remove the warnings.
+
+ * assembler/ARM64Assembler.h:
+ * assembler/ARMv7Assembler.h:
+ (JSC::ARMv7Assembler::LinkRecord::LinkRecord):
+ (JSC::ARMv7Assembler::LinkRecord::operator=):
+
2021-03-31 Alexey Shvayka <shvaikal...@gmail.com>
Optimize constructors of ES6 collections
Modified: trunk/Source/_javascript_Core/assembler/ARM64Assembler.h (275284 => 275285)
--- trunk/Source/_javascript_Core/assembler/ARM64Assembler.h 2021-03-31 16:10:48 UTC (rev 275284)
+++ trunk/Source/_javascript_Core/assembler/ARM64Assembler.h 2021-03-31 16:15:15 UTC (rev 275285)
@@ -383,6 +383,9 @@
data.realTypes.m_bitNumber = bitNumber;
data.realTypes.m_compareRegister = compareRegister;
}
+ // We are defining a copy constructor and assignment operator
+ // because the ones provided by the compiler are not
+ // optimal. See https://bugs.webkit.org/show_bug.cgi?id=90930
LinkRecord(const LinkRecord& other)
{
data.copyTypes = other.data.copyTypes;
Modified: trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h (275284 => 275285)
--- trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2021-03-31 16:10:48 UTC (rev 275284)
+++ trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2021-03-31 16:15:15 UTC (rev 275285)
@@ -446,12 +446,18 @@
data.realTypes.m_linkType = LinkInvalid;
data.realTypes.m_condition = condition;
}
- void operator=(const LinkRecord& other)
+ // We are defining a copy constructor and assignment operator
+ // because the ones provided by the compiler are not
+ // optimal. See https://bugs.webkit.org/show_bug.cgi?id=90930
+ LinkRecord(const LinkRecord& other)
{
- data.copyTypes.content[0] = other.data.copyTypes.content[0];
- data.copyTypes.content[1] = other.data.copyTypes.content[1];
- data.copyTypes.content[2] = other.data.copyTypes.content[2];
+ data.copyTypes = other.data.copyTypes;
}
+ LinkRecord& operator=(const LinkRecord& other)
+ {
+ data.copyTypes = other.data.copyTypes;
+ return *this;
+ }
intptr_t from() const { return data.realTypes.m_from; }
void setFrom(intptr_t from) { data.realTypes.m_from = from; }
intptr_t to() const { return data.realTypes.m_to; }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes