Title: [88962] trunk/Source/_javascript_Core
Revision
88962
Author
[email protected]
Date
2011-06-15 11:27:10 -0700 (Wed, 15 Jun 2011)

Log Message

2011-06-15  Oliver Hunt  <[email protected]>

        Reviewed by Sam Weinig.

        Reduce the size of global_resolve
        https://bugs.webkit.org/show_bug.cgi?id=62738

        Reduce the code size of global_resolve in the JIT by replacing
        multiple pointer loads with a single pointer move + two offset
        loads.

        * jit/JITOpcodes.cpp:
        (JSC::JIT::emit_op_resolve_global):
        * jit/JITOpcodes32_64.cpp:
        (JSC::JIT::emit_op_resolve_global):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (88961 => 88962)


--- trunk/Source/_javascript_Core/ChangeLog	2011-06-15 18:23:18 UTC (rev 88961)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-06-15 18:27:10 UTC (rev 88962)
@@ -1,3 +1,19 @@
+2011-06-15  Oliver Hunt  <[email protected]>
+
+        Reviewed by Sam Weinig.
+
+        Reduce the size of global_resolve
+        https://bugs.webkit.org/show_bug.cgi?id=62738
+
+        Reduce the code size of global_resolve in the JIT by replacing
+        multiple pointer loads with a single pointer move + two offset
+        loads.
+
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_resolve_global):
+        * jit/JITOpcodes32_64.cpp:
+        (JSC::JIT::emit_op_resolve_global):
+
 2011-06-14  Geoffrey Garen  <[email protected]>
 
         Reviewed by Dan Bernstein.

Modified: trunk/Source/_javascript_Core/jit/JITOpcodes.cpp (88961 => 88962)


--- trunk/Source/_javascript_Core/jit/JITOpcodes.cpp	2011-06-15 18:23:18 UTC (rev 88961)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes.cpp	2011-06-15 18:27:10 UTC (rev 88962)
@@ -638,18 +638,18 @@
     // Fast case
     void* globalObject = m_codeBlock->globalObject();
     unsigned currentIndex = m_globalResolveInfoIndex++;
-    void* structureAddress = &(m_codeBlock->globalResolveInfo(currentIndex).structure);
-    void* offsetAddr = &(m_codeBlock->globalResolveInfo(currentIndex).offset);
+    GlobalResolveInfo* resolveInfoAddress = &(m_codeBlock->globalResolveInfo(currentIndex));
 
     // Check Structure of global object
     move(TrustedImmPtr(globalObject), regT0);
-    loadPtr(structureAddress, regT1);
+    move(TrustedImmPtr(resolveInfoAddress), regT2);
+    loadPtr(Address(regT2, OBJECT_OFFSETOF(GlobalResolveInfo, structure)), regT1);
     addSlowCase(branchPtr(NotEqual, regT1, Address(regT0, JSCell::structureOffset()))); // Structures don't match
 
     // Load cached property
     // Assume that the global object always uses external storage.
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSGlobalObject, m_propertyStorage)), regT0);
-    load32(offsetAddr, regT1);
+    load32(Address(regT2, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), regT1);
     loadPtr(BaseIndex(regT0, regT1, ScalePtr), regT0);
     emitPutVirtualRegister(currentInstruction[1].u.operand);
 }

Modified: trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp (88961 => 88962)


--- trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp	2011-06-15 18:23:18 UTC (rev 88961)
+++ trunk/Source/_javascript_Core/jit/JITOpcodes32_64.cpp	2011-06-15 18:27:10 UTC (rev 88962)
@@ -806,17 +806,18 @@
     void* globalObject = m_codeBlock->globalObject();
 
     unsigned currentIndex = m_globalResolveInfoIndex++;
-    void* structureAddress = &(m_codeBlock->globalResolveInfo(currentIndex).structure);
-    void* offsetAddr = &(m_codeBlock->globalResolveInfo(currentIndex).offset);
+    GlobalResolveInfo* resolveInfoAddress = &m_codeBlock->globalResolveInfo(currentIndex);
 
+
     // Verify structure.
     move(TrustedImmPtr(globalObject), regT0);
-    loadPtr(structureAddress, regT1);
+    move(TrustedImmPtr(resolveInfoAddress), regT3);
+    loadPtr(Address(regT3, OBJECT_OFFSETOF(GlobalResolveInfo, structure)), regT1);
     addSlowCase(branchPtr(NotEqual, regT1, Address(regT0, JSCell::structureOffset())));
 
     // Load property.
     loadPtr(Address(regT0, OBJECT_OFFSETOF(JSGlobalObject, m_propertyStorage)), regT2);
-    load32(offsetAddr, regT3);
+    load32(Address(regT3, OBJECT_OFFSETOF(GlobalResolveInfo, offset)), regT3);
     load32(BaseIndex(regT2, regT3, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); // payload
     load32(BaseIndex(regT2, regT3, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); // tag
     emitStore(dst, regT1, regT0);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to