OSDN Git Service

Remove JavaScript node size in the instrumentation as it is using arena now. Added...
authorGrace Kloba <klobag@google.com>
Wed, 1 Jul 2009 16:59:08 +0000 (09:59 -0700)
committerGrace Kloba <klobag@google.com>
Wed, 1 Jul 2009 16:59:08 +0000 (09:59 -0700)
JavaScriptCore/parser/Nodes.cpp
JavaScriptCore/parser/Nodes.h
WebKit/android/TimeCounter.cpp

index 38e842a..4ddf13a 100644 (file)
@@ -2180,25 +2180,4 @@ JSFunction* FuncExprNode::makeFunction(ExecState* exec, ScopeChainNode* scopeCha
     return func;
 }
 
-#ifdef ANDROID_INSTRUMENT
-static size_t nodesSize = 0;
-
-void* Node::operator new(size_t s) throw()
-{
-    nodesSize += s;
-    return ::operator new(s);
-}
-
-void Node::operator delete(void* ptr, size_t s)
-{
-    nodesSize -= s;
-    ::operator delete(ptr);
-}
-
-size_t Node::reportJavaScriptNodesSize()
-{
-    return nodesSize;
-}
-#endif
-
 } // namespace JSC
index ec4fdb4..cda1ee4 100644 (file)
@@ -153,16 +153,6 @@ namespace JSC {
 
         int lineNo() const { return m_line; }
 
-#ifdef ANDROID_INSTRUMENT
-        // Overridden to prevent the normal new from being called.
-        void* operator new(size_t) throw();
-
-        // Overridden to prevent the normal delete from being called.
-        void operator delete(void*, size_t);
-
-        static size_t reportJavaScriptNodesSize();
-#endif
-
     protected:
         int m_line;
     };
index 9e8f432..a8de243 100644 (file)
@@ -45,6 +45,7 @@
 
 using namespace WebCore;
 using namespace WTF;
+using namespace JSC;
 
 namespace android {
 
@@ -119,7 +120,6 @@ void TimeCounter::report(const KURL& url, int live, int dead, size_t arenaSize)
     Heap::Statistics jsHeapStatistics = JSDOMWindow::commonJSGlobalData()->heap.statistics();
     LOGD("Current JavaScript heap size is %d and has %d bytes free",
             jsHeapStatistics.size, jsHeapStatistics.free);
-    LOGD("Current JavaScript nodes use %d bytes", JSC::Node::reportJavaScriptNodesSize());
 #endif
     LOGD("Current CSS styles use %d bytes", StyleBase::reportStyleSize());
     LOGD("Current DOM nodes use %d bytes", WebCore::Node::reportDOMNodesSize());