2011-04-25 Adam Barth <abarth@webkit.org>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Apr 2011 23:54:38 +0000 (23:54 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Apr 2011 23:54:38 +0000 (23:54 +0000)
        Reviewed by Darin Adler.

        JavaScriptCore should play nice strict OwnPtrs
        https://bugs.webkit.org/show_bug.cgi?id=59401

        * dfg/DFGByteCodeParser.cpp:
        (JSC::DFG::ByteCodeParser::parse):
        * heap/Heap.cpp:
        (JSC::TypeCounter::TypeCounter):
        * jit/JITStubs.cpp:
        (JSC::JITThunks::JITThunks):
        * parser/JSParser.cpp:
        (JSC::JSParser::Scope::Scope):
        * yarr/YarrJIT.cpp:
        (JSC::Yarr::YarrGenerator::GenerationState::addParenthesesTail):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84846 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/jit/JITStubs.cpp
Source/JavaScriptCore/parser/JSParser.cpp
Source/JavaScriptCore/yarr/YarrJIT.cpp

index 5b2c84a..5c11fc1 100644 (file)
@@ -1,3 +1,21 @@
+2011-04-25  Adam Barth  <abarth@webkit.org>
+
+        Reviewed by Darin Adler.
+
+        JavaScriptCore should play nice strict OwnPtrs
+        https://bugs.webkit.org/show_bug.cgi?id=59401
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::parse):
+        * heap/Heap.cpp:
+        (JSC::TypeCounter::TypeCounter):
+        * jit/JITStubs.cpp:
+        (JSC::JITThunks::JITThunks):
+        * parser/JSParser.cpp:
+        (JSC::JSParser::Scope::Scope):
+        * yarr/YarrJIT.cpp:
+        (JSC::Yarr::YarrGenerator::GenerationState::addParenthesesTail):
+
 2011-04-25  Mark Rowe  <mrowe@apple.com>
 
         Build fix.
index 982263c..6176a8e 100644 (file)
@@ -1105,8 +1105,9 @@ bool ByteCodeParser::parse()
 
         // Loop until we reach the current limit (i.e. next jump target).
         do {
-            m_currentBlock = new BasicBlock(m_currentIndex, m_graph.size(), m_numArguments, m_numLocals);
-            m_graph.m_blocks.append(m_currentBlock);
+            OwnPtr<BasicBlock> block = adoptPtr(new BasicBlock(m_currentIndex, m_graph.size(), m_numArguments, m_numLocals));
+            m_currentBlock = block.get();
+            m_graph.m_blocks.append(block.release());
 
             if (!parseBlock(limit))
                 return false;
index 6375b14..6f1d82f 100644 (file)
@@ -316,7 +316,7 @@ private:
 };
 
 inline TypeCounter::TypeCounter()
-    : m_typeCountSet(new TypeCountSet)
+    : m_typeCountSet(adoptPtr(new TypeCountSet))
 {
 }
 
index 953bd11..9618c21 100644 (file)
@@ -752,7 +752,7 @@ __asm void ctiOpThrowNotCaught()
 #endif
 
 JITThunks::JITThunks(JSGlobalData* globalData)
-    : m_hostFunctionStubMap(new HostFunctionStubMap)
+    : m_hostFunctionStubMap(adoptPtr(new HostFunctionStubMap))
 {
     if (!globalData->executableAllocator.isValid())
         return;
index 314691d..947a2c6 100644 (file)
@@ -291,7 +291,6 @@ private:
             , m_isValidStrictMode(true)
             , m_loopDepth(0)
             , m_switchDepth(0)
-            , m_labels(0)
         {
         }
 
@@ -307,7 +306,6 @@ private:
             , m_isValidStrictMode(rhs.m_isValidStrictMode)
             , m_loopDepth(rhs.m_loopDepth)
             , m_switchDepth(rhs.m_switchDepth)
-            , m_labels(0)
         {
             if (rhs.m_labels) {
                 m_labels = adoptPtr(new LabelStack);
index f74107b..8a8397b 100644 (file)
@@ -417,11 +417,13 @@ class YarrGenerator : private MacroAssembler {
 
         ParenthesesTail* addParenthesesTail(PatternTerm& term, JumpList* jumpListToPriorParen)
         {
-            ParenthesesTail* parenthesesTail = new ParenthesesTail(term, m_parenNestingLevel, jumpListToPriorParen);
-            m_parenTails.append(parenthesesTail);
-            m_parenTailsForIteration.append(parenthesesTail);
+            OwnPtr<ParenthesesTail> tail = adoptPtr(new ParenthesesTail(term, m_parenNestingLevel, jumpListToPriorParen));
+            ParenthesesTail* rawTail = tail.get();
 
-            return parenthesesTail;
+            m_parenTails.append(tail.release());
+            m_parenTailsForIteration.append(rawTail);
+
+            return rawTail;
         }
 
         void emitParenthesesTail(YarrGenerator* generator)