Changeset 43661 in webkit for trunk/JavaScriptCore/debugger


Ignore:
Timestamp:
May 13, 2009, 2:53:59 PM (16 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2009-05-13 Darin Adler <Darin Adler>

Revert the parser arena change. It was a slowdown, not a speedup.
Better luck next time (I'll break it up into pieces).

WebCore:

2009-05-13 Darin Adler <Darin Adler>

Revert the parser arena change. It was a slowdown, not a speedup.
Better luck next time (I'll break it up into pieces).

WebKit/mac:

2009-05-13 Darin Adler <Darin Adler>

Revert the parser arena change. It was a slowdown, not a speedup.
Better luck next time (I'll break it up into pieces).

Location:
trunk/JavaScriptCore/debugger
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/debugger/Debugger.cpp

    r43647 r43661  
    2323#include "Debugger.h"
    2424
    25 #include "CollectorHeapIterator.h"
     25#include "JSGlobalObject.h"
    2626#include "Interpreter.h"
    27 #include "JSFunction.h"
    28 #include "JSGlobalObject.h"
    2927#include "Parser.h"
    3028
     
    5654}
    5755
    58 void Debugger::recompileAllJSFunctions(JSGlobalData* globalData, bool callSourceParsed)
    59 {
    60     // If JavaScript is running, it's not safe to recompile, since we'll end
    61     // up throwing away code that is live on the stack.
    62     ASSERT(!globalData->dynamicGlobalObject);
    63     if (globalData->dynamicGlobalObject)
    64         return;
    65 
    66     Vector<ProtectedPtr<JSFunction> > functions;
    67     Heap::iterator heapEnd = globalData->heap.primaryHeapEnd();
    68     for (Heap::iterator it = globalData->heap.primaryHeapBegin(); it != heapEnd; ++it) {
    69         if ((*it)->isObject(&JSFunction::info)) {
    70             JSFunction* function = static_cast<JSFunction*>(*it);
    71             FunctionBodyNode* body = function->body();
    72             if (body && !body->isHostFunction())
    73                 functions.append(function);
    74         }
    75     }
    76 
    77     typedef HashMap<RefPtr<FunctionBodyNode>, RefPtr<FunctionBodyNode> > FunctionBodyMap;
    78     typedef HashMap<SourceProvider*, ExecState*> SourceProviderMap;
    79 
    80     FunctionBodyMap functionBodies;
    81     SourceProviderMap sourceProviders;
    82 
    83     size_t size = functions.size();
    84     for (size_t i = 0; i < size; ++i) {
    85         JSFunction* function = functions[i];
    86 
    87         FunctionBodyNode* oldBody = function->body();
    88         pair<FunctionBodyMap::iterator, bool> result = functionBodies.add(oldBody, 0);
    89         if (!result.second) {
    90             function->setBody(result.first->second.get());
    91             continue;
    92         }
    93 
    94         ExecState* exec = function->scope().globalObject()->JSGlobalObject::globalExec();
    95         const SourceCode& sourceCode = oldBody->source();
    96 
    97         RefPtr<FunctionBodyNode> newBody = globalData->parser->parse<FunctionBodyNode>(exec, 0, sourceCode);
    98         ASSERT(newBody);
    99         newBody->finishParsing(oldBody->copyParameters(), oldBody->parameterCount());
    100 
    101         result.first->second = newBody;
    102         function->setBody(newBody.release());
    103 
    104         if (callSourceParsed && function->scope().globalObject()->debugger() == this)
    105             sourceProviders.add(sourceCode.provider(), exec);
    106     }
    107 
    108     // Call sourceParsed() after reparsing all functions because it will execute
    109     // JavaScript in the inspector.
    110     SourceProviderMap::const_iterator end = sourceProviders.end();
    111     for (SourceProviderMap::const_iterator iter = sourceProviders.begin(); iter != end; ++iter)
    112         sourceParsed((*iter).second, SourceCode((*iter).first), -1, 0);
    113 }
    114 
    11556JSValue evaluateInGlobalCallFrame(const UString& script, JSValue& exception, JSGlobalObject* globalObject)
    11657{
  • trunk/JavaScriptCore/debugger/Debugger.h

    r43642 r43661  
    5151        virtual void didReachBreakpoint(const DebuggerCallFrame&, intptr_t sourceID, int lineno) = 0;
    5252
    53         void recompileAllJSFunctions(JSGlobalData*, bool callSourceParsed);
    54 
    5553    private:
    5654        HashSet<JSGlobalObject*> m_globalObjects;
Note: See TracChangeset for help on using the changeset viewer.