Title: [117860] trunk/Source/_javascript_Core
Revision
117860
Author
[email protected]
Date
2012-05-21 17:49:31 -0700 (Mon, 21 May 2012)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (117859 => 117860)


--- trunk/Source/_javascript_Core/ChangeLog	2012-05-22 00:37:09 UTC (rev 117859)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-05-22 00:49:31 UTC (rev 117860)
@@ -1,3 +1,25 @@
+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-15  Gavin Barraclough  <[email protected]>
 
         Add support for private names

Modified: trunk/Source/_javascript_Core/dfg/DFGOperations.cpp (117859 => 117860)


--- trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2012-05-22 00:37:09 UTC (rev 117859)
+++ trunk/Source/_javascript_Core/dfg/DFGOperations.cpp	2012-05-22 00:49:31 UTC (rev 117860)
@@ -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: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp (117859 => 117860)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2012-05-22 00:37:09 UTC (rev 117859)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT32_64.cpp	2012-05-22 00:49:31 UTC (rev 117860)
@@ -2982,7 +2982,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: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp (117859 => 117860)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2012-05-22 00:37:09 UTC (rev 117859)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT64.cpp	2012-05-22 00:49:31 UTC (rev 117860)
@@ -2979,7 +2979,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: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (117859 => 117860)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2012-05-22 00:37:09 UTC (rev 117859)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2012-05-22 00:49:31 UTC (rev 117860)
@@ -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];
@@ -315,7 +321,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