Commit 77ea29ad authored by fpizlo@apple.com's avatar fpizlo@apple.com

Rename Profiler to LegacyProfiler

https://bugs.webkit.org/show_bug.cgi?id=104031

Rubber stamped by Mark Hahnenberg

Source/JavaScriptCore: 

Make room in the namespace for https://bugs.webkit.org/show_bug.cgi?id=102999.

* API/JSProfilerPrivate.cpp:
(JSStartProfiling):
(JSEndProfiling):
* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::throwException):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
* jit/JIT.h:
* jit/JITCode.h:
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* jit/JITStubs.h:
(JSC):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* profiler/LegacyProfiler.cpp: Added.
(JSC):
(JSC::LegacyProfiler::profiler):
(JSC::LegacyProfiler::startProfiling):
(JSC::LegacyProfiler::stopProfiling):
(JSC::dispatchFunctionToProfiles):
(JSC::LegacyProfiler::willExecute):
(JSC::LegacyProfiler::didExecute):
(JSC::LegacyProfiler::exceptionUnwind):
(JSC::LegacyProfiler::createCallIdentifier):
(JSC::createCallIdentifierFromFunctionImp):
* profiler/LegacyProfiler.h: Added.
(JSC):
(LegacyProfiler):
(JSC::LegacyProfiler::currentProfiles):
* profiler/ProfileGenerator.cpp:
(JSC::ProfileGenerator::addParentForConsoleStart):
* profiler/ProfileNode.cpp:
* profiler/Profiler.cpp: Removed.
* profiler/Profiler.h: Removed.
* runtime/JSGlobalData.h:
(JSC):
(JSC::JSGlobalData::enabledProfiler):
(JSGlobalData):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::~JSGlobalObject):

Source/WebCore: 

Just renaming, no new tests.

* ForwardingHeaders/profiler/LegacyProfiler.h: Copied from Source/WebCore/ForwardingHeaders/profiler/Profiler.h.
* ForwardingHeaders/profiler/Profiler.h: Removed.
* bindings/js/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::start):
(WebCore::ScriptProfiler::stop):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a74f301a
......@@ -27,20 +27,20 @@
#include "JSProfilerPrivate.h"
#include "APICast.h"
#include "LegacyProfiler.h"
#include "OpaqueJSString.h"
#include "Profiler.h"
using namespace JSC;
void JSStartProfiling(JSContextRef ctx, JSStringRef title)
{
Profiler::profiler()->startProfiling(toJS(ctx), title->string());
LegacyProfiler::profiler()->startProfiling(toJS(ctx), title->string());
}
void JSEndProfiling(JSContextRef ctx, JSStringRef title)
{
ExecState* exec = toJS(ctx);
Profiler* profiler = Profiler::profiler();
LegacyProfiler* profiler = LegacyProfiler::profiler();
profiler->stopProfiling(exec, title->string());
}
......@@ -175,7 +175,7 @@ SET(JavaScriptCore_SOURCES
profiler/Profile.cpp
profiler/ProfileGenerator.cpp
profiler/ProfileNode.cpp
profiler/Profiler.cpp
profiler/LegacyProfiler.cpp
runtime/ArgList.cpp
runtime/Arguments.cpp
......
2012-12-04 Filip Pizlo <fpizlo@apple.com>
Rename Profiler to LegacyProfiler
https://bugs.webkit.org/show_bug.cgi?id=104031
Rubber stamped by Mark Hahnenberg
Make room in the namespace for https://bugs.webkit.org/show_bug.cgi?id=102999.
* API/JSProfilerPrivate.cpp:
(JSStartProfiling):
(JSEndProfiling):
* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::throwException):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
* jit/JIT.h:
* jit/JITCode.h:
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* jit/JITStubs.h:
(JSC):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* profiler/LegacyProfiler.cpp: Added.
(JSC):
(JSC::LegacyProfiler::profiler):
(JSC::LegacyProfiler::startProfiling):
(JSC::LegacyProfiler::stopProfiling):
(JSC::dispatchFunctionToProfiles):
(JSC::LegacyProfiler::willExecute):
(JSC::LegacyProfiler::didExecute):
(JSC::LegacyProfiler::exceptionUnwind):
(JSC::LegacyProfiler::createCallIdentifier):
(JSC::createCallIdentifierFromFunctionImp):
* profiler/LegacyProfiler.h: Added.
(JSC):
(LegacyProfiler):
(JSC::LegacyProfiler::currentProfiles):
* profiler/ProfileGenerator.cpp:
(JSC::ProfileGenerator::addParentForConsoleStart):
* profiler/ProfileNode.cpp:
* profiler/Profiler.cpp: Removed.
* profiler/Profiler.h: Removed.
* runtime/JSGlobalData.h:
(JSC):
(JSC::JSGlobalData::enabledProfiler):
(JSGlobalData):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::~JSGlobalObject):
2012-12-03 Filip Pizlo <fpizlo@apple.com>
DFG should inline code blocks that use scoped variable access
......
......@@ -477,8 +477,8 @@ javascriptcore_sources += \
Source/JavaScriptCore/profiler/Profile.h \
Source/JavaScriptCore/profiler/ProfileNode.cpp \
Source/JavaScriptCore/profiler/ProfileNode.h \
Source/JavaScriptCore/profiler/Profiler.cpp \
Source/JavaScriptCore/profiler/Profiler.h \
Source/JavaScriptCore/profiler/LegacyProfiler.cpp \
Source/JavaScriptCore/profiler/LegacyProfiler.h \
Source/JavaScriptCore/runtime/ArgList.cpp \
Source/JavaScriptCore/runtime/ArgList.h \
Source/JavaScriptCore/runtime/Arguments.cpp \
......
......@@ -303,7 +303,7 @@ EXPORTS
?parseDoubleFromLongString@Internal@WTF@@YANPB_WIAAI@Z
?positiveInfiniteTime@MediaTime@WTF@@SAABV12@XZ
?process@InstrumentedPointerBase@MemoryInstrumentation@WTF@@QAEXPAV23@@Z
?profiler@Profiler@JSC@@SAPAV12@XZ
?profiler@LegacyProfiler@JSC@@SAPAV12@XZ
?protect@Heap@JSC@@QAEXVJSValue@2@@Z
?protectedGlobalObjectCount@Heap@JSC@@QAEIXZ
?protectedObjectCount@Heap@JSC@@QAEIXZ
......@@ -368,9 +368,9 @@ EXPORTS
?slowValidateCell@JSC@@YAXPAVJSCell@1@@Z
?slowValidateCell@JSC@@YAXPAVJSGlobalObject@1@@Z
?sourceCode@JSFunction@JSC@@QBEPBVSourceCode@2@XZ
?startProfiling@Profiler@JSC@@QAEXPAVExecState@2@ABVString@WTF@@@Z
?startProfiling@LegacyProfiler@JSC@@QAEXPAVExecState@2@ABVString@WTF@@@Z
?startSampling@JSGlobalData@JSC@@QAEXXZ
?stopProfiling@Profiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVString@4@@Z
?stopProfiling@LegacyProfiler@JSC@@QAE?AV?$PassRefPtr@VProfile@JSC@@@WTF@@PAVExecState@2@ABVString@4@@Z
?stopSampling@JSGlobalData@JSC@@QAEXXZ
?string@OpaqueJSString@@QBE?AVString@WTF@@XZ
?StringToDouble@StringToDoubleConverter@double_conversion@WTF@@SANPBDIPAI@Z
......
......@@ -1550,11 +1550,11 @@
>
</File>
<File
RelativePath="..\..\profiler\Profiler.cpp"
RelativePath="..\..\profiler\LegacyProfiler.cpp"
>
</File>
<File
RelativePath="..\..\profiler\Profiler.h"
RelativePath="..\..\profiler\LegacyProfiler.h"
>
</File>
</Filter>
......
......@@ -552,7 +552,7 @@
9335F24D12E6765B002B5553 /* StringRecursionChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93345A8712D838C400302BE3 /* StringRecursionChecker.cpp */; };
9534AAFB0E5B7A9600B8A45B /* JSProfilerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
95742F650DD11F5A000917FB /* Profile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95742F630DD11F5A000917FB /* Profile.cpp */; };
95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */; };
95AB83420DA4322500BC83F3 /* LegacyProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */; };
95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */; };
95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */; };
95CD45770E1C4FDD0085358E /* ProfileGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 95CD45750E1C4FDD0085358E /* ProfileGenerator.h */; settings = {ATTRIBUTES = (); }; };
......@@ -682,7 +682,7 @@
BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; settings = {ATTRIBUTES = (); }; };
BC18C4500E16F5CD00B34460 /* Profile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95742F640DD11F5A000917FB /* Profile.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4510E16F5CD00B34460 /* ProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB83550DA43B4400BC83F3 /* ProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4520E16F5CD00B34460 /* Profiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB832F0DA42CAD00BC83F3 /* Profiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4520E16F5CD00B34460 /* LegacyProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4540E16F5CD00B34460 /* PropertyNameArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 65400C100A69BAF200509887 /* PropertyNameArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4550E16F5CD00B34460 /* PropertySlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* PropertySlot.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4560E16F5CD00B34460 /* Protect.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C02FBB0637462A003E7EE6 /* Protect.h */; settings = {ATTRIBUTES = (Private, ); }; };
......@@ -1368,8 +1368,8 @@
95742F630DD11F5A000917FB /* Profile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Profile.cpp; path = profiler/Profile.cpp; sourceTree = "<group>"; };
95742F640DD11F5A000917FB /* Profile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Profile.h; path = profiler/Profile.h; sourceTree = "<group>"; };
95988BA90E477BEC00D28D4D /* JSProfilerPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSProfilerPrivate.cpp; sourceTree = "<group>"; };
95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Profiler.cpp; path = profiler/Profiler.cpp; sourceTree = "<group>"; };
95AB832F0DA42CAD00BC83F3 /* Profiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Profiler.h; path = profiler/Profiler.h; sourceTree = "<group>"; };
95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LegacyProfiler.cpp; path = profiler/LegacyProfiler.cpp; sourceTree = "<group>"; };
95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LegacyProfiler.h; path = profiler/LegacyProfiler.h; sourceTree = "<group>"; };
95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProfileNode.cpp; path = profiler/ProfileNode.cpp; sourceTree = "<group>"; };
95AB83550DA43B4400BC83F3 /* ProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfileNode.h; path = profiler/ProfileNode.h; sourceTree = "<group>"; };
95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRetainPtr.h; sourceTree = "<group>"; };
......@@ -2522,8 +2522,8 @@
95CD45750E1C4FDD0085358E /* ProfileGenerator.h */,
95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */,
95AB83550DA43B4400BC83F3 /* ProfileNode.h */,
95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */,
95AB832F0DA42CAD00BC83F3 /* Profiler.h */,
95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */,
95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */,
);
name = profiler;
sourceTree = "<group>";
......@@ -2876,7 +2876,7 @@
0FD82E54141DAEEE00179C94 /* SpeculatedType.h in Headers */,
BC18C4500E16F5CD00B34460 /* Profile.h in Headers */,
BC18C4510E16F5CD00B34460 /* ProfileNode.h in Headers */,
BC18C4520E16F5CD00B34460 /* Profiler.h in Headers */,
BC18C4520E16F5CD00B34460 /* LegacyProfiler.h in Headers */,
A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */,
BC95437D0EBA70FD0072B6D3 /* PropertyMapHashTable.h in Headers */,
BC18C4540E16F5CD00B34460 /* PropertyNameArray.h in Headers */,
......@@ -3537,7 +3537,7 @@
95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */,
95AB83420DA4322500BC83F3 /* LegacyProfiler.cpp in Sources */,
A7FB60A4103F7DC20017A286 /* PropertyDescriptor.cpp in Sources */,
14469DE7107EC7E700650446 /* PropertyNameArray.cpp in Sources */,
14469DE8107EC7E700650446 /* PropertySlot.cpp in Sources */,
......
......@@ -185,7 +185,7 @@ SOURCES += \
profiler/Profile.cpp \
profiler/ProfileGenerator.cpp \
profiler/ProfileNode.cpp \
profiler/Profiler.cpp \
profiler/LegacyProfiler.cpp \
runtime/ArgList.cpp \
runtime/Arguments.cpp \
runtime/ArrayConstructor.cpp \
......
......@@ -52,12 +52,12 @@
#include "JSString.h"
#include "JSWithScope.h"
#include "LLIntCLoop.h"
#include "LegacyProfiler.h"
#include "LiteralParser.h"
#include "NameInstance.h"
#include "ObjectPrototype.h"
#include "Operations.h"
#include "Parser.h"
#include "Profiler.h"
#include "RegExpObject.h"
#include "RegExpPrototype.h"
#include "Register.h"
......@@ -773,13 +773,13 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV
HandlerInfo* handler = 0;
while (isInterrupt || !(handler = codeBlock->handlerForBytecodeOffset(bytecodeOffset))) {
if (!unwindCallFrame(callFrame, exceptionValue, bytecodeOffset, codeBlock)) {
if (Profiler* profiler = callFrame->globalData().enabledProfiler())
if (LegacyProfiler* profiler = callFrame->globalData().enabledProfiler())
profiler->exceptionUnwind(callFrame);
return 0;
}
}
if (Profiler* profiler = callFrame->globalData().enabledProfiler())
if (LegacyProfiler* profiler = callFrame->globalData().enabledProfiler())
profiler->exceptionUnwind(callFrame);
// Unwind the scope chain within the exception handler's call frame.
......@@ -966,7 +966,7 @@ failedJSONP:
// Set the arguments for the callee:
newCallFrame->setThisValue(thisObj);
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->willExecute(callFrame, program->sourceURL(), program->lineNo());
// Execute the code:
......@@ -981,7 +981,7 @@ failedJSONP:
#endif // ENABLE(JIT)
}
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->didExecute(callFrame, program->sourceURL(), program->lineNo());
m_stack.popFrame(newCallFrame);
......@@ -1037,7 +1037,7 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT
for (size_t i = 0; i < args.size(); ++i)
newCallFrame->setArgument(i, args.at(i));
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->willExecute(callFrame, function);
JSValue result;
......@@ -1055,7 +1055,7 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT
result = JSValue::decode(callData.native.function(newCallFrame));
}
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->didExecute(callFrame, function);
m_stack.popFrame(newCallFrame);
......@@ -1112,7 +1112,7 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc
for (size_t i = 0; i < args.size(); ++i)
newCallFrame->setArgument(i, args.at(i));
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->willExecute(callFrame, constructor);
JSValue result;
......@@ -1131,7 +1131,7 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc
}
}
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->didExecute(callFrame, constructor);
m_stack.popFrame(newCallFrame);
......@@ -1198,7 +1198,7 @@ JSValue Interpreter::execute(CallFrameClosure& closure)
closure.resetCallFrame();
m_stack.validateFence(closure.newCallFrame, "STEP 1");
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->willExecute(closure.oldCallFrame, closure.function);
// The code execution below may push more frames and point the topCallFrame
......@@ -1223,7 +1223,7 @@ JSValue Interpreter::execute(CallFrameClosure& closure)
#endif // ENABLE(JIT)
}
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->didExecute(closure.oldCallFrame, closure.function);
m_stack.validateFence(closure.newCallFrame, "AFTER");
......@@ -1304,7 +1304,7 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue
// Set the arguments for the callee:
newCallFrame->setThisValue(thisValue);
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->willExecute(callFrame, eval->sourceURL(), eval->lineNo());
// Execute the code:
......@@ -1319,7 +1319,7 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue
#endif // ENABLE(JIT)
}
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->didExecute(callFrame, eval->sourceURL(), eval->lineNo());
m_stack.popFrame(newCallFrame);
......
......@@ -48,8 +48,8 @@
#include "Interpreter.h"
#include "JITDisassembler.h"
#include "JSInterfaceJIT.h"
#include "LegacyProfiler.h"
#include "Opcode.h"
#include "Profiler.h"
#include <bytecode/SamplingTool.h>
namespace JSC {
......
......@@ -30,8 +30,8 @@
#include "CallFrame.h"
#include "JSValue.h"
#include "Disassembler.h"
#include "LegacyProfiler.h"
#include "MacroAssemblerCodeRef.h"
#include "Profiler.h"
#endif
namespace JSC {
......
......@@ -56,11 +56,11 @@
#include "JSPropertyNameIterator.h"
#include "JSString.h"
#include "JSWithScope.h"
#include "LegacyProfiler.h"
#include "NameInstance.h"
#include "ObjectPrototype.h"
#include "Operations.h"
#include "Parser.h"
#include "Profiler.h"
#include "RegExpObject.h"
#include "RegExpPrototype.h"
#include "Register.h"
......@@ -2221,7 +2221,7 @@ DEFINE_STUB_FUNCTION(void, op_profile_will_call)
{
STUB_INIT_STACK_FRAME(stackFrame);
if (Profiler* profiler = stackFrame.globalData->enabledProfiler())
if (LegacyProfiler* profiler = stackFrame.globalData->enabledProfiler())
profiler->willExecute(stackFrame.callFrame, stackFrame.args[0].jsValue());
}
......@@ -2229,7 +2229,7 @@ DEFINE_STUB_FUNCTION(void, op_profile_did_call)
{
STUB_INIT_STACK_FRAME(stackFrame);
if (Profiler* profiler = stackFrame.globalData->enabledProfiler())
if (LegacyProfiler* profiler = stackFrame.globalData->enabledProfiler())
profiler->didExecute(stackFrame.callFrame, stackFrame.args[0].jsValue());
}
......
......@@ -57,8 +57,8 @@ namespace JSC {
class JSStack;
class JSValue;
class JSValueEncodedAsPointer;
class LegacyProfiler;
class NativeExecutable;
class Profiler;
class PropertySlot;
class PutPropertySlot;
class RegExp;
......
......@@ -1649,7 +1649,7 @@ LLINT_SLOW_PATH_DECL(slow_path_debug)
LLINT_SLOW_PATH_DECL(slow_path_profile_will_call)
{
LLINT_BEGIN();
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->willExecute(exec, LLINT_OP(1).jsValue());
LLINT_END();
}
......@@ -1657,7 +1657,7 @@ LLINT_SLOW_PATH_DECL(slow_path_profile_will_call)
LLINT_SLOW_PATH_DECL(slow_path_profile_did_call)
{
LLINT_BEGIN();
if (Profiler* profiler = globalData.enabledProfiler())
if (LegacyProfiler* profiler = globalData.enabledProfiler())
profiler->didExecute(exec, LLINT_OP(1).jsValue());
LLINT_END();
}
......
/*
* Copyright (C) 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -27,11 +27,11 @@
*/
#include "config.h"
#include "Profiler.h"
#include "LegacyProfiler.h"
#include "CommonIdentifiers.h"
#include "CallFrame.h"
#include "CodeBlock.h"
#include "CommonIdentifiers.h"
#include "InternalFunction.h"
#include "JSFunction.h"
#include "JSGlobalObject.h"
......@@ -49,16 +49,16 @@ static unsigned ProfilesUID = 0;
static CallIdentifier createCallIdentifierFromFunctionImp(ExecState*, JSObject*, const String& defaultSourceURL, int defaultLineNumber);
Profiler* Profiler::s_sharedProfiler = 0;
LegacyProfiler* LegacyProfiler::s_sharedLegacyProfiler = 0;
Profiler* Profiler::profiler()
LegacyProfiler* LegacyProfiler::profiler()
{
if (!s_sharedProfiler)
s_sharedProfiler = new Profiler();
return s_sharedProfiler;
if (!s_sharedLegacyProfiler)
s_sharedLegacyProfiler = new LegacyProfiler();
return s_sharedLegacyProfiler;
}
void Profiler::startProfiling(ExecState* exec, const String& title)
void LegacyProfiler::startProfiling(ExecState* exec, const String& title)
{
ASSERT_ARG(title, !title.isNull());
......@@ -77,7 +77,7 @@ void Profiler::startProfiling(ExecState* exec, const String& title)
m_currentProfiles.append(profileGenerator);
}
PassRefPtr<Profile> Profiler::stopProfiling(ExecState* exec, const String& title)
PassRefPtr<Profile> LegacyProfiler::stopProfiling(ExecState* exec, const String& title)
{
JSGlobalObject* origin = exec ? exec->lexicalGlobalObject() : 0;
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
......@@ -97,7 +97,7 @@ PassRefPtr<Profile> Profiler::stopProfiling(ExecState* exec, const String& title
return 0;
}
void Profiler::stopProfiling(JSGlobalObject* origin)
void LegacyProfiler::stopProfiling(JSGlobalObject* origin)
{
for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
......@@ -118,14 +118,14 @@ static inline void dispatchFunctionToProfiles(ExecState* callerOrHandlerCallFram
}
}
void Profiler::willExecute(ExecState* callerCallFrame, JSValue function)
void LegacyProfiler::willExecute(ExecState* callerCallFrame, JSValue function)
{
ASSERT(!m_currentProfiles.isEmpty());
dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::willExecute, createCallIdentifier(callerCallFrame, function, "", 0), callerCallFrame->lexicalGlobalObject()->profileGroup());
}
void Profiler::willExecute(ExecState* callerCallFrame, const String& sourceURL, int startingLineNumber)
void LegacyProfiler::willExecute(ExecState* callerCallFrame, const String& sourceURL, int startingLineNumber)
{
ASSERT(!m_currentProfiles.isEmpty());
......@@ -134,28 +134,28 @@ void Profiler::willExecute(ExecState* callerCallFrame, const String& sourceURL,
dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::willExecute, callIdentifier, callerCallFrame->lexicalGlobalObject()->profileGroup());
}
void Profiler::didExecute(ExecState* callerCallFrame, JSValue function)
void LegacyProfiler::didExecute(ExecState* callerCallFrame, JSValue function)
{
ASSERT(!m_currentProfiles.isEmpty());
dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(callerCallFrame, function, "", 0), callerCallFrame->lexicalGlobalObject()->profileGroup());
}
void Profiler::didExecute(ExecState* callerCallFrame, const String& sourceURL, int startingLineNumber)
void LegacyProfiler::didExecute(ExecState* callerCallFrame, const String& sourceURL, int startingLineNumber)
{
ASSERT(!m_currentProfiles.isEmpty());
dispatchFunctionToProfiles(callerCallFrame, m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(callerCallFrame, JSValue(), sourceURL, startingLineNumber), callerCallFrame->lexicalGlobalObject()->profileGroup());
}
void Profiler::exceptionUnwind(ExecState* handlerCallFrame)
void LegacyProfiler::exceptionUnwind(ExecState* handlerCallFrame)
{
ASSERT(!m_currentProfiles.isEmpty());
dispatchFunctionToProfiles(handlerCallFrame, m_currentProfiles, &ProfileGenerator::exceptionUnwind, createCallIdentifier(handlerCallFrame, JSValue(), "", 0), handlerCallFrame->lexicalGlobalObject()->profileGroup());
}
CallIdentifier Profiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const String& defaultSourceURL, int defaultLineNumber)
CallIdentifier LegacyProfiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const String& defaultSourceURL, int defaultLineNumber)
{
if (!functionValue)
return CallIdentifier(GlobalCodeExecution, defaultSourceURL, defaultLineNumber);
......
/*
* Copyright (C) 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef Profiler_h
#define Profiler_h
#ifndef LegacyProfiler_h
#define LegacyProfiler_h
#include "Profile.h"
#include <wtf/PassRefPtr.h>
......@@ -36,38 +36,38 @@
namespace JSC {
class ExecState;
class JSGlobalData;
class JSGlobalObject;
class JSObject;
class JSValue;
class ProfileGenerator;
struct CallIdentifier;
class ExecState;
class JSGlobalData;
class JSGlobalObject;
class JSObject;
class JSValue;
class ProfileGenerator;
struct CallIdentifier;
class Profiler {
WTF_MAKE_FAST_ALLOCATED;
public:
JS_EXPORT_PRIVATE static Profiler* profiler();
static CallIdentifier createCallIdentifier(ExecState*, JSValue, const WTF::String& sourceURL, int lineNumber);
class LegacyProfiler {
WTF_MAKE_FAST_ALLOCATED;
public:
JS_EXPORT_PRIVATE static LegacyProfiler* profiler();
static CallIdentifier createCallIdentifier(ExecState*, JSValue, const WTF::String& sourceURL, int lineNumber);
JS_EXPORT_PRIVATE void startProfiling(ExecState*, const WTF::String& title);
JS_EXPORT_PRIVATE PassRefPtr<Profile> stopProfiling(ExecState*, const WTF::String& title);
void stopProfiling(JSGlobalObject*);
JS_EXPORT_PRIVATE void startProfiling(ExecState*, const WTF::String& title);
JS_EXPORT_PRIVATE PassRefPtr<Profile> stopProfiling(ExecState*, const WTF::String& title);
void stopProfiling(JSGlobalObject*);
void willExecute(ExecState* callerCallFrame, JSValue function);
void willExecute(ExecState* callerCallFrame, const WTF::String& sourceURL, int startingLineNumber);
void didExecute(ExecState* callerCallFrame, JSValue function);
void didExecute(ExecState* callerCallFrame, const WTF::String& sourceURL, int startingLineNumber);
void willExecute(ExecState* callerCallFrame, JSValue function);
void willExecute(ExecState* callerCallFrame, const WTF::String& sourceURL, int startingLineNumber);
void didExecute(ExecState* callerCallFrame, JSValue function);
void didExecute(ExecState* callerCallFrame, const WTF::String& sourceURL, int startingLineNumber);
void exceptionUnwind(ExecState* handlerCallFrame);
void exceptionUnwind(ExecState* handlerCallFrame);
const Vector<RefPtr<ProfileGenerator> >& currentProfiles() { return m_currentProfiles; };
const Vector<RefPtr<ProfileGenerator> >& currentProfiles() { return m_currentProfiles; };
private:
Vector<RefPtr<ProfileGenerator> > m_currentProfiles;
static Profiler* s_sharedProfiler;
};
private:
Vector<RefPtr<ProfileGenerator> > m_currentProfiles;
static LegacyProfiler* s_sharedLegacyProfiler;
};
} // namespace JSC
#endif // Profiler_h
#endif // LegacyProfiler_h
......@@ -32,8 +32,8 @@
#include "JSStringRef.h"
#include "JSFunction.h"