Title: [118229] branches/safari-536-branch/Source/_javascript_Core

Diff

Modified: branches/safari-536-branch/Source/_javascript_Core/ChangeLog (118228 => 118229)


--- branches/safari-536-branch/Source/_javascript_Core/ChangeLog	2012-05-23 19:43:57 UTC (rev 118228)
+++ branches/safari-536-branch/Source/_javascript_Core/ChangeLog	2012-05-23 19:54:51 UTC (rev 118229)
@@ -1,5 +1,31 @@
 2012-05-23  Lucas Forschler  <[email protected]>
 
+    Merge 117860
+
+    2012-05-21  Michael Saboff  <[email protected]>
+
+            Cleanup of Calls to operationStrCat and operationNewArray and Use Constructor after r117729
+            https://bugs.webkit.org/show_bug.cgi?id=87027
+
+            Reviewed by Oliver Hunt.
+
+            Change calls to operationStrCat and operationNewArray to provide the
+            pointer to the EncodedJSValue* data buffer instead of the ScratchBuffer
+            that contains it.  Added a ScratchBuffer::create() function.
+            This is a clean-up to r117729.
+
+            * dfg/DFGOperations.cpp:
+            * dfg/DFGSpeculativeJIT32_64.cpp:
+            (JSC::DFG::SpeculativeJIT::compile):
+            * dfg/DFGSpeculativeJIT64.cpp:
+            (JSC::DFG::SpeculativeJIT::compile):
+            * runtime/JSGlobalData.h:
+            (JSC::ScratchBuffer::create):
+            (JSC::ScratchBuffer::dataBuffer):
+            (JSC::JSGlobalData::scratchBufferForSize):
+
+2012-05-23  Lucas Forschler  <[email protected]>
+
     Merge 117729
 
     2012-05-20  Michael Saboff  <[email protected]>

Modified: branches/safari-536-branch/Source/_javascript_Core/dfg/DFGOperations.cpp (118228 => 118229)


--- branches/safari-536-branch/Source/_javascript_Core/dfg/DFGOperations.cpp	2012-05-23 19:43:57 UTC (rev 118228)
+++ branches/safari-536-branch/Source/_javascript_Core/dfg/DFGOperations.cpp	2012-05-23 19:54:51 UTC (rev 118229)
@@ -991,20 +991,20 @@
     return JSValue::encode(JSValue::decode(value).toPrimitive(exec));
 }
 
-EncodedJSValue DFG_OPERATION operationStrCat(ExecState* exec, void* scratch, size_t size)
+EncodedJSValue DFG_OPERATION operationStrCat(ExecState* exec, void* buffer, size_t size)
 {
     JSGlobalData* globalData = &exec->globalData();
     NativeCallFrameTracer tracer(globalData, exec);
 
-    return JSValue::encode(jsString(exec, static_cast<Register*>(static_cast<ScratchBuffer*>(scratch)->dataBuffer()), size));
+    return JSValue::encode(jsString(exec, static_cast<Register*>(buffer), size));
 }
 
-EncodedJSValue DFG_OPERATION operationNewArray(ExecState* exec, void* scratch, size_t size)
+EncodedJSValue DFG_OPERATION operationNewArray(ExecState* exec, void* buffer, size_t size)
 {
     JSGlobalData* globalData = &exec->globalData();
     NativeCallFrameTracer tracer(globalData, exec);
 
-    return JSValue::encode(constructArray(exec, static_cast<JSValue*>(static_cast<ScratchBuffer*>(scratch)->dataBuffer()), size));
+    return JSValue::encode(constructArray(exec, static_cast<JSValue*>(buffer), size));
 }
 
 EncodedJSValue DFG_OPERATION operationNewArrayBuffer(ExecState* exec, size_t start, size_t size)

Modified: branches/safari-536-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (118228 => 118229)


--- branches/safari-536-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2012-05-23 19:43:57 UTC (rev 118228)
+++ branches/safari-536-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2012-05-23 19:54:51 UTC (rev 118229)
@@ -2945,7 +2945,7 @@
         GPRResult resultPayload(this);
         GPRResult2 resultTag(this);
         
-        callOperation(op == StrCat ? operationStrCat : operationNewArray, resultTag.gpr(), resultPayload.gpr(), static_cast<void *>(scratchBuffer), node.numChildren());
+        callOperation(op == StrCat ? operationStrCat : operationNewArray, resultTag.gpr(), resultPayload.gpr(), static_cast<void *>(buffer), node.numChildren());
 
         if (scratchSize) {
             GPRTemporary scratch(this);

Modified: branches/safari-536-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (118228 => 118229)


--- branches/safari-536-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2012-05-23 19:43:57 UTC (rev 118228)
+++ branches/safari-536-branch/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2012-05-23 19:54:51 UTC (rev 118229)
@@ -2977,7 +2977,7 @@
 
         GPRResult result(this);
         
-        callOperation(op == StrCat ? operationStrCat : operationNewArray, result.gpr(), static_cast<void *>(scratchBuffer), node.numChildren());
+        callOperation(op == StrCat ? operationStrCat : operationNewArray, result.gpr(), static_cast<void *>(buffer), node.numChildren());
 
         if (scratchSize) {
             GPRTemporary scratch(this);

Modified: branches/safari-536-branch/Source/_javascript_Core/runtime/JSGlobalData.h (118228 => 118229)


--- branches/safari-536-branch/Source/_javascript_Core/runtime/JSGlobalData.h	2012-05-23 19:43:57 UTC (rev 118228)
+++ branches/safari-536-branch/Source/_javascript_Core/runtime/JSGlobalData.h	2012-05-23 19:54:51 UTC (rev 118229)
@@ -133,12 +133,18 @@
         {
         }
 
+        static ScratchBuffer* create(size_t size)
+        {
+            ScratchBuffer* result = new (fastMalloc(ScratchBuffer::allocationSize(size))) ScratchBuffer;
+
+            return result;
+        }
+
         static size_t allocationSize(size_t bufferSize) { return sizeof(size_t) + bufferSize; }
         void setActiveLength(size_t activeLength) { m_activeLength = activeLength; }
         size_t activeLength() const { return m_activeLength; };
         size_t* activeLengthPtr() { return &m_activeLength; };
         void* dataBuffer() { return m_buffer; }
-        void visitEncodedJSValues(SlotVisitor&);
 
         size_t m_activeLength;
         void* m_buffer[0];
@@ -314,7 +320,7 @@
                 // max(scratch buffer size) * 4.
                 sizeOfLastScratchBuffer = size * 2;
 
-                scratchBuffers.append(static_cast<ScratchBuffer*>(fastMalloc(ScratchBuffer::allocationSize(sizeOfLastScratchBuffer))));
+                scratchBuffers.append(ScratchBuffer::create(sizeOfLastScratchBuffer));
             }
 
             ScratchBuffer* result = scratchBuffers.last();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to