Title: [122347] trunk/Source/_javascript_Core
- Revision
- 122347
- Author
- [email protected]
- Date
- 2012-07-11 11:15:17 -0700 (Wed, 11 Jul 2012)
Log Message
Simplify the copying of JSC ARMv7's LinkRecord
https://bugs.webkit.org/show_bug.cgi?id=90930
Patch by Benjamin Poulain <[email protected]> on 2012-07-11
Reviewed by Filip Pizlo.
The class LinkRecord is used by value everywhere in ARMv7Assembler. The compiler uses
memmove() to move the objects.
The problem is memmove() is overkill for this object, moving the value can be done with
3 load-store. This patch adds an operator= to the class doing more efficient copying.
This reduces the link time by 19%.
* assembler/ARMv7Assembler.h:
(JSC::ARMv7Assembler::LinkRecord::LinkRecord):
(JSC::ARMv7Assembler::LinkRecord::operator=):
(JSC::ARMv7Assembler::LinkRecord::from):
(JSC::ARMv7Assembler::LinkRecord::setFrom):
(JSC::ARMv7Assembler::LinkRecord::to):
(JSC::ARMv7Assembler::LinkRecord::type):
(JSC::ARMv7Assembler::LinkRecord::linkType):
(JSC::ARMv7Assembler::LinkRecord::setLinkType):
(JSC::ARMv7Assembler::LinkRecord::condition):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (122346 => 122347)
--- trunk/Source/_javascript_Core/ChangeLog 2012-07-11 18:14:47 UTC (rev 122346)
+++ trunk/Source/_javascript_Core/ChangeLog 2012-07-11 18:15:17 UTC (rev 122347)
@@ -1,3 +1,28 @@
+2012-07-11 Benjamin Poulain <[email protected]>
+
+ Simplify the copying of JSC ARMv7's LinkRecord
+ https://bugs.webkit.org/show_bug.cgi?id=90930
+
+ Reviewed by Filip Pizlo.
+
+ The class LinkRecord is used by value everywhere in ARMv7Assembler. The compiler uses
+ memmove() to move the objects.
+
+ The problem is memmove() is overkill for this object, moving the value can be done with
+ 3 load-store. This patch adds an operator= to the class doing more efficient copying.
+ This reduces the link time by 19%.
+
+ * assembler/ARMv7Assembler.h:
+ (JSC::ARMv7Assembler::LinkRecord::LinkRecord):
+ (JSC::ARMv7Assembler::LinkRecord::operator=):
+ (JSC::ARMv7Assembler::LinkRecord::from):
+ (JSC::ARMv7Assembler::LinkRecord::setFrom):
+ (JSC::ARMv7Assembler::LinkRecord::to):
+ (JSC::ARMv7Assembler::LinkRecord::type):
+ (JSC::ARMv7Assembler::LinkRecord::linkType):
+ (JSC::ARMv7Assembler::LinkRecord::setLinkType):
+ (JSC::ARMv7Assembler::LinkRecord::condition):
+
2012-07-11 Andy Wingo <[email protected]>
jsc: Parse options before creating global data
Modified: trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h (122346 => 122347)
--- trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2012-07-11 18:14:47 UTC (rev 122346)
+++ trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2012-07-11 18:15:17 UTC (rev 122347)
@@ -462,28 +462,42 @@
class LinkRecord {
public:
LinkRecord(intptr_t from, intptr_t to, JumpType type, Condition condition)
- : m_from(from)
- , m_to(to)
- , m_type(type)
- , m_linkType(LinkInvalid)
- , m_condition(condition)
{
+ data.realTypes.m_from = from;
+ data.realTypes.m_to = to;
+ data.realTypes.m_type = type;
+ data.realTypes.m_linkType = LinkInvalid;
+ data.realTypes.m_condition = condition;
}
- intptr_t from() const { return m_from; }
- void setFrom(intptr_t from) { m_from = from; }
- intptr_t to() const { return m_to; }
- JumpType type() const { return m_type; }
- JumpLinkType linkType() const { return m_linkType; }
- void setLinkType(JumpLinkType linkType) { ASSERT(m_linkType == LinkInvalid); m_linkType = linkType; }
- Condition condition() const { return m_condition; }
+ void operator=(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];
+ }
+ 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; }
+ JumpType type() const { return data.realTypes.m_type; }
+ JumpLinkType linkType() const { return data.realTypes.m_linkType; }
+ void setLinkType(JumpLinkType linkType) { ASSERT(data.realTypes.m_linkType == LinkInvalid); data.realTypes.m_linkType = linkType; }
+ Condition condition() const { return data.realTypes.m_condition; }
private:
- intptr_t m_from : 31;
- intptr_t m_to : 31;
- JumpType m_type : 8;
- JumpLinkType m_linkType : 8;
- Condition m_condition : 16;
+ union {
+ struct RealTypes {
+ intptr_t m_from : 31;
+ intptr_t m_to : 31;
+ JumpType m_type : 8;
+ JumpLinkType m_linkType : 8;
+ Condition m_condition : 16;
+ } realTypes;
+ struct CopyTypes {
+ uint32_t content[3];
+ } copyTypes;
+ COMPILE_ASSERT(sizeof(RealTypes) == sizeof(CopyTypes), LinkRecordCopyStructSizeEqualsRealStruct);
+ } data;
};
-
+
ARMv7Assembler()
: m_indexOfLastWatchpoint(INT_MIN)
, m_indexOfTailOfLastWatchpoint(INT_MIN)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes