Remove LegacyProfiler
https://bugs.webkit.org/show_bug.cgi?id=153565
Reviewed by Mark Lam.
Source/JavaScriptCore:
JavaScriptCore now provides a sampling profiler and it is enabled
by all ports. Web Inspector switched months ago to using the
sampling profiler and displaying its data. Remove the legacy
profiler, as it is no longer being used by anything other then
console.profile and tests. We will update console.profile's
behavior soon to have new behavior and use the sampling data.
* API/JSProfilerPrivate.cpp: Removed.
* API/JSProfilerPrivate.h: Removed.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset): Deleted.
(JSC::computeDefsForBytecodeOffset): Deleted.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode): Deleted.
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitCallVarargs):
(JSC::BytecodeGenerator::emitCallVarargsInTailPosition):
(JSC::BytecodeGenerator::emitConstructVarargs):
(JSC::BytecodeGenerator::emitConstruct):
* bytecompiler/BytecodeGenerator.h:
(JSC::CallArguments::profileHookRegister): Deleted.
(JSC::BytecodeGenerator::shouldEmitProfileHooks): Deleted.
* bytecompiler/NodesCodegen.cpp:
(JSC::CallFunctionCallDotNode::emitBytecode):
(JSC::ApplyFunctionCallDotNode::emitBytecode):
(JSC::CallArguments::CallArguments): Deleted.
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): Deleted.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock): Deleted.
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel): Deleted.
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize): Deleted.
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC): Deleted.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode): Deleted.
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute): Deleted.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Deleted.
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile): Deleted.
* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::callFunctionWithEvalEnabled):
* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::operator()): Deleted.
(JSC::Interpreter::execute): Deleted.
(JSC::Interpreter::executeCall): Deleted.
(JSC::Interpreter::executeConstruct): Deleted.
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass): Deleted.
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_profile_will_call): Deleted.
(JSC::JIT::emit_op_profile_did_call): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_profile_will_call): Deleted.
(JSC::JIT::emit_op_profile_did_call): Deleted.
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL): Deleted.
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* parser/ParserModes.h:
* profiler/CallIdentifier.h: Removed.
* profiler/LegacyProfiler.cpp: Removed.
* profiler/LegacyProfiler.h: Removed.
* profiler/Profile.cpp: Removed.
* profiler/Profile.h: Removed.
* profiler/ProfileGenerator.cpp: Removed.
* profiler/ProfileGenerator.h: Removed.
* profiler/ProfileNode.cpp: Removed.
* profiler/ProfileNode.h: Removed.
* profiler/ProfilerJettisonReason.cpp:
(WTF::printInternal): Deleted.
* profiler/ProfilerJettisonReason.h:
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getProgramCodeBlock):
(JSC::CodeCache::getEvalCodeBlock):
(JSC::CodeCache::getModuleProgramCodeBlock):
* runtime/CodeCache.h:
* runtime/Executable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::createProgramCodeBlock):
(JSC::JSGlobalObject::createEvalCodeBlock):
(JSC::JSGlobalObject::createModuleProgramCodeBlock):
(JSC::JSGlobalObject::~JSGlobalObject): Deleted.
(JSC::JSGlobalObject::hasLegacyProfiler): Deleted.
* runtime/JSGlobalObject.h:
* runtime/Options.h:
* runtime/VM.cpp:
(JSC::VM::VM): Deleted.
(JSC::SetEnabledProfilerFunctor::operator()): Deleted.
(JSC::VM::setEnabledProfiler): Deleted.
* runtime/VM.h:
(JSC::VM::enabledProfiler): Deleted.
(JSC::VM::enabledProfilerAddress): Deleted.
Source/WebCore:
* ForwardingHeaders/profiler/Profile.h: Removed.
* ForwardingHeaders/profiler/ProfileNode.h: Removed.
* testing/js/WebCoreTestSupport.cpp:
* xml/XSLStyleSheetLibxslt.cpp:
* xml/XSLTProcessorLibxslt.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@201239 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/API/JSProfilerPrivate.cpp b/Source/JavaScriptCore/API/JSProfilerPrivate.cpp
deleted file mode 100644
index ac112ae..0000000
--- a/Source/JavaScriptCore/API/JSProfilerPrivate.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSProfilerPrivate.h"
-
-#include "APICast.h"
-#include "LegacyProfiler.h"
-#include "OpaqueJSString.h"
-
-using namespace JSC;
-
-void JSStartProfiling(JSContextRef ctx, JSStringRef title)
-{
- // Use an independent stopwatch for API-initiated profiling, since the user will expect it
- // to be relative to when their command was issued.
- RefPtr<Stopwatch> stopwatch = Stopwatch::create();
- stopwatch->start();
- LegacyProfiler::profiler()->startProfiling(toJS(ctx), title->string(), stopwatch.release());
-}
-
-void JSEndProfiling(JSContextRef ctx, JSStringRef title)
-{
- ExecState* exec = toJS(ctx);
- LegacyProfiler* profiler = LegacyProfiler::profiler();
- profiler->stopProfiling(exec, title->string());
-}
-
diff --git a/Source/JavaScriptCore/API/JSProfilerPrivate.h b/Source/JavaScriptCore/API/JSProfilerPrivate.h
deleted file mode 100644
index 34f26a2..0000000
--- a/Source/JavaScriptCore/API/JSProfilerPrivate.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSProfiler_h
-#define JSProfiler_h
-
-#include <JavaScriptCore/JSBase.h>
-
-#ifndef __cplusplus
-#include <stdbool.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*!
-@function JSStartProfiling
-@abstract Enables the profler.
-@param ctx The execution context to use.
-@param title The title of the profile.
-@result The profiler is turned on.
-*/
-JS_EXPORT void JSStartProfiling(JSContextRef ctx, JSStringRef title);
-
-/*!
-@function JSEndProfiling
-@abstract Disables the profler.
-@param ctx The execution context to use.
-@param title The title of the profile.
-@result The profiler is turned off. If there is no name, the most recently started
- profile is stopped. If the name does not match any profile then no profile
- is stopped.
-*/
-JS_EXPORT void JSEndProfiling(JSContextRef ctx, JSStringRef title);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* JSProfiler_h */
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index 91a3c12..429b2a0 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -54,7 +54,6 @@
API/JSClassRef.cpp
API/JSContextRef.cpp
API/JSObjectRef.cpp
- API/JSProfilerPrivate.cpp
API/JSTypedArray.cpp
API/JSScriptRef.cpp
API/JSStringRef.cpp
@@ -586,10 +585,6 @@
parser/SourceProviderCache.cpp
parser/VariableEnvironment.cpp
- profiler/LegacyProfiler.cpp
- profiler/Profile.cpp
- profiler/ProfileGenerator.cpp
- profiler/ProfileNode.cpp
profiler/ProfilerBytecode.cpp
profiler/ProfilerBytecodeSequence.cpp
profiler/ProfilerBytecodes.cpp
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index c4e5c58..bd5594d 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -3,6 +3,127 @@
Remove LegacyProfiler
https://bugs.webkit.org/show_bug.cgi?id=153565
+ Reviewed by Mark Lam.
+
+ JavaScriptCore now provides a sampling profiler and it is enabled
+ by all ports. Web Inspector switched months ago to using the
+ sampling profiler and displaying its data. Remove the legacy
+ profiler, as it is no longer being used by anything other then
+ console.profile and tests. We will update console.profile's
+ behavior soon to have new behavior and use the sampling data.
+
+ * API/JSProfilerPrivate.cpp: Removed.
+ * API/JSProfilerPrivate.h: Removed.
+ * CMakeLists.txt:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * bytecode/BytecodeList.json:
+ * bytecode/BytecodeUseDef.h:
+ (JSC::computeUsesForBytecodeOffset): Deleted.
+ (JSC::computeDefsForBytecodeOffset): Deleted.
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dumpBytecode): Deleted.
+ * bytecode/UnlinkedFunctionExecutable.cpp:
+ (JSC::generateUnlinkedFunctionCodeBlock):
+ (JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
+ * bytecode/UnlinkedFunctionExecutable.h:
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ (JSC::BytecodeGenerator::emitCall):
+ (JSC::BytecodeGenerator::emitCallVarargs):
+ (JSC::BytecodeGenerator::emitCallVarargsInTailPosition):
+ (JSC::BytecodeGenerator::emitConstructVarargs):
+ (JSC::BytecodeGenerator::emitConstruct):
+ * bytecompiler/BytecodeGenerator.h:
+ (JSC::CallArguments::profileHookRegister): Deleted.
+ (JSC::BytecodeGenerator::shouldEmitProfileHooks): Deleted.
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::CallFunctionCallDotNode::emitBytecode):
+ (JSC::ApplyFunctionCallDotNode::emitBytecode):
+ (JSC::CallArguments::CallArguments): Deleted.
+ * dfg/DFGAbstractInterpreterInlines.h:
+ (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): Deleted.
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseBlock): Deleted.
+ * dfg/DFGCapabilities.cpp:
+ (JSC::DFG::capabilityLevel): Deleted.
+ * dfg/DFGClobberize.h:
+ (JSC::DFG::clobberize): Deleted.
+ * dfg/DFGDoesGC.cpp:
+ (JSC::DFG::doesGC): Deleted.
+ * dfg/DFGFixupPhase.cpp:
+ (JSC::DFG::FixupPhase::fixupNode): Deleted.
+ * dfg/DFGNodeType.h:
+ * dfg/DFGPredictionPropagationPhase.cpp:
+ * dfg/DFGSafeToExecute.h:
+ (JSC::DFG::safeToExecute): Deleted.
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile): Deleted.
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile): Deleted.
+ * inspector/InjectedScriptBase.cpp:
+ (Inspector::InjectedScriptBase::callFunctionWithEvalEnabled):
+ * interpreter/Interpreter.cpp:
+ (JSC::UnwindFunctor::operator()): Deleted.
+ (JSC::Interpreter::execute): Deleted.
+ (JSC::Interpreter::executeCall): Deleted.
+ (JSC::Interpreter::executeConstruct): Deleted.
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompileMainPass): Deleted.
+ * jit/JIT.h:
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_profile_will_call): Deleted.
+ (JSC::JIT::emit_op_profile_did_call): Deleted.
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_profile_will_call): Deleted.
+ (JSC::JIT::emit_op_profile_did_call): Deleted.
+ * jit/JITOperations.cpp:
+ * jit/JITOperations.h:
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL): Deleted.
+ * llint/LLIntSlowPaths.h:
+ * llint/LowLevelInterpreter.asm:
+ * parser/ParserModes.h:
+ * profiler/CallIdentifier.h: Removed.
+ * profiler/LegacyProfiler.cpp: Removed.
+ * profiler/LegacyProfiler.h: Removed.
+ * profiler/Profile.cpp: Removed.
+ * profiler/Profile.h: Removed.
+ * profiler/ProfileGenerator.cpp: Removed.
+ * profiler/ProfileGenerator.h: Removed.
+ * profiler/ProfileNode.cpp: Removed.
+ * profiler/ProfileNode.h: Removed.
+ * profiler/ProfilerJettisonReason.cpp:
+ (WTF::printInternal): Deleted.
+ * profiler/ProfilerJettisonReason.h:
+ * runtime/CodeCache.cpp:
+ (JSC::CodeCache::getGlobalCodeBlock):
+ (JSC::CodeCache::getProgramCodeBlock):
+ (JSC::CodeCache::getEvalCodeBlock):
+ (JSC::CodeCache::getModuleProgramCodeBlock):
+ * runtime/CodeCache.h:
+ * runtime/Executable.cpp:
+ (JSC::ScriptExecutable::newCodeBlockFor):
+ * runtime/JSGlobalObject.cpp:
+ (JSC::JSGlobalObject::createProgramCodeBlock):
+ (JSC::JSGlobalObject::createEvalCodeBlock):
+ (JSC::JSGlobalObject::createModuleProgramCodeBlock):
+ (JSC::JSGlobalObject::~JSGlobalObject): Deleted.
+ (JSC::JSGlobalObject::hasLegacyProfiler): Deleted.
+ * runtime/JSGlobalObject.h:
+ * runtime/Options.h:
+ * runtime/VM.cpp:
+ (JSC::VM::VM): Deleted.
+ (JSC::SetEnabledProfilerFunctor::operator()): Deleted.
+ (JSC::VM::setEnabledProfiler): Deleted.
+ * runtime/VM.h:
+ (JSC::VM::enabledProfiler): Deleted.
+ (JSC::VM::enabledProfilerAddress): Deleted.
+
+2016-05-20 Joseph Pecoraro <pecoraro@apple.com>
+
+ Remove LegacyProfiler
+ https://bugs.webkit.org/show_bug.cgi?id=153565
+
Reviewed by Saam Barati.
* inspector/protocol/Timeline.json:
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 7ebbccc..8c8925c 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -1415,14 +1415,6 @@
933040040E6A749400786E6A /* SmallStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 93303FEA0E6A72C000786E6A /* SmallStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
9330402C0E6A764000786E6A /* SmallStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93303FE80E6A72B500786E6A /* SmallStrings.cpp */; };
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 /* 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 = (); }; };
- 95E3BC050E1AE68200B2D1C1 /* CallIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 95F6E6950E5B5F970091E860 /* JSProfilerPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95988BA90E477BEC00D28D4D /* JSProfilerPrivate.cpp */; };
960097A60EBABB58007A7297 /* LabelScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 960097A50EBABB58007A7297 /* LabelScope.h */; };
9688CB150ED12B4E001D649F /* AssemblerBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9688CB130ED12B4E001D649F /* AssemblerBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
9688CB160ED12B4E001D649F /* X86Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9688CB140ED12B4E001D649F /* X86Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1891,9 +1883,6 @@
BC18C4460E16F5CD00B34460 /* ObjectPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C90E16D4E900A06E92 /* ObjectPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C4480E16F5CD00B34460 /* Operations.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8780255597D01FF60F7 /* Operations.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 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 /* 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, ); }; };
@@ -3637,18 +3626,7 @@
93F0B3A909BB4DC00068FCE3 /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Parser.cpp; sourceTree = "<group>"; };
93F0B3AA09BB4DC00068FCE3 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parser.h; sourceTree = "<group>"; };
93F1981A08245AAE001E9ABC /* Keywords.table */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = Keywords.table; sourceTree = "<group>"; tabWidth = 8; };
- 952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSProfilerPrivate.h; sourceTree = "<group>"; };
- 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 /* 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>"; };
- 95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProfileGenerator.cpp; path = profiler/ProfileGenerator.cpp; sourceTree = "<group>"; };
- 95CD45750E1C4FDD0085358E /* ProfileGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfileGenerator.h; path = profiler/ProfileGenerator.h; sourceTree = "<group>"; };
- 95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CallIdentifier.h; path = profiler/CallIdentifier.h; sourceTree = "<group>"; };
960097A50EBABB58007A7297 /* LabelScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelScope.h; sourceTree = "<group>"; };
9688CB130ED12B4E001D649F /* AssemblerBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssemblerBuffer.h; sourceTree = "<group>"; };
9688CB140ED12B4E001D649F /* X86Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X86Assembler.h; sourceTree = "<group>"; };
@@ -5274,8 +5252,6 @@
1482B7E20A43076000517CFC /* JSObjectRef.cpp */,
1482B7E10A43076000517CFC /* JSObjectRef.h */,
A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */,
- 95988BA90E477BEC00D28D4D /* JSProfilerPrivate.cpp */,
- 952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */,
A552C37D1ADDB8FE00139726 /* JSRemoteInspector.cpp */,
A552C37E1ADDB8FE00139726 /* JSRemoteInspector.h */,
95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */,
@@ -6442,15 +6418,6 @@
95AB831A0DA42C6900BC83F3 /* profiler */ = {
isa = PBXGroup;
children = (
- 95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */,
- 95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */,
- 95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */,
- 95742F630DD11F5A000917FB /* Profile.cpp */,
- 95742F640DD11F5A000917FB /* Profile.h */,
- 95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */,
- 95CD45750E1C4FDD0085358E /* ProfileGenerator.h */,
- 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */,
- 95AB83550DA43B4400BC83F3 /* ProfileNode.h */,
0FF72992166AD347000F5BA3 /* ProfilerBytecode.cpp */,
0FF72993166AD347000F5BA3 /* ProfilerBytecode.h */,
0FF72994166AD347000F5BA3 /* ProfilerBytecodes.cpp */,
@@ -7131,7 +7098,6 @@
1429D8DE0ED2205B00B89619 /* CallFrame.h in Headers */,
62EC9BB71B7EB07C00303AD1 /* CallFrameShuffleData.h in Headers */,
62D755D71B84FB4A001801FA /* CallFrameShuffler.h in Headers */,
- 95E3BC050E1AE68200B2D1C1 /* CallIdentifier.h in Headers */,
0F0B83B114BCF71800885B4F /* CallLinkInfo.h in Headers */,
0F93329E14CA7DC50085F3C6 /* CallLinkStatus.h in Headers */,
627673241B680C1E00FD9F2E /* CallMode.h in Headers */,
@@ -7748,7 +7714,6 @@
A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */,
A7F9935F0FD7325100A0B2D0 /* JSONObject.h in Headers */,
BC87CDB910712AD4000614CF /* JSONObject.lut.h in Headers */,
- 9534AAFB0E5B7A9600B8A45B /* JSProfilerPrivate.h in Headers */,
7C184E1B17BEDBD3007CB63A /* JSPromise.h in Headers */,
7C184E2317BEE240007CB63A /* JSPromiseConstructor.h in Headers */,
996B731E1BDA08EF00331B84 /* JSPromiseConstructor.lut.h in Headers */,
@@ -7814,7 +7779,6 @@
960097A60EBABB58007A7297 /* LabelScope.h in Headers */,
0FB5467714F59B5C002C2989 /* LazyOperandValueProfile.h in Headers */,
99DA00B01BD5994E00F4575C /* lazywriter.py in Headers */,
- BC18C4520E16F5CD00B34460 /* LegacyProfiler.h in Headers */,
BC18C4310E16F5CD00B34460 /* Lexer.h in Headers */,
BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */,
DCF3D56B1CD29472003D5C65 /* LazyClassStructureInlines.h in Headers */,
@@ -7919,9 +7883,6 @@
0FE834181A6EF97B00D04847 /* PolymorphicCallStubRoutine.h in Headers */,
0F98206116BFE38300240D02 /* PreciseJumpTargets.h in Headers */,
868916B0155F286300CB2B9A /* PrivateName.h in Headers */,
- BC18C4500E16F5CD00B34460 /* Profile.h in Headers */,
- 95CD45770E1C4FDD0085358E /* ProfileGenerator.h in Headers */,
- BC18C4510E16F5CD00B34460 /* ProfileNode.h in Headers */,
0FF729A5166AD351000F5BA3 /* ProfilerBytecode.h in Headers */,
0FF729B9166AD360000F5BA3 /* ProfilerBytecodes.h in Headers */,
0F13912A16771C36009CCB07 /* ProfilerBytecodeSequence.h in Headers */,
@@ -9167,7 +9128,6 @@
147F39D4107EC37600427A48 /* JSObject.cpp in Sources */,
1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */,
A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */,
- 95F6E6950E5B5F970091E860 /* JSProfilerPrivate.cpp in Sources */,
7C184E1A17BEDBD3007CB63A /* JSPromise.cpp in Sources */,
7C184E2217BEE240007CB63A /* JSPromiseConstructor.cpp in Sources */,
7C008CDA187124BB00955C24 /* JSPromiseDeferred.cpp in Sources */,
@@ -9210,7 +9170,6 @@
14280870107EC1340013E7B2 /* JSWrapperObject.cpp in Sources */,
BCFD8C920EEB2EE700283848 /* JumpTable.cpp in Sources */,
0FB5467914F5C46B002C2989 /* LazyOperandValueProfile.cpp in Sources */,
- 95AB83420DA4322500BC83F3 /* LegacyProfiler.cpp in Sources */,
148F21B0107EC5410042EC2C /* Lexer.cpp in Sources */,
0FF4275715914A20004CB9FF /* LinkBuffer.cpp in Sources */,
A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */,
@@ -9278,9 +9237,6 @@
0FE834171A6EF97B00D04847 /* PolymorphicCallStubRoutine.cpp in Sources */,
0F338E141BF0276C0013C88F /* B3ValueKey.cpp in Sources */,
0F98206016BFE38100240D02 /* PreciseJumpTargets.cpp in Sources */,
- 95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
- 95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
- 95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
0FF729AD166AD35C000F5BA3 /* ProfilerBytecode.cpp in Sources */,
0FF729AE166AD35C000F5BA3 /* ProfilerBytecodes.cpp in Sources */,
0F13912916771C33009CCB07 /* ProfilerBytecodeSequence.cpp in Sources */,
diff --git a/Source/JavaScriptCore/bytecode/BytecodeList.json b/Source/JavaScriptCore/bytecode/BytecodeList.json
index ba18a7e..a80656e 100644
--- a/Source/JavaScriptCore/bytecode/BytecodeList.json
+++ b/Source/JavaScriptCore/bytecode/BytecodeList.json
@@ -123,8 +123,6 @@
{ "name" : "op_throw", "length" : 2 },
{ "name" : "op_throw_static_error", "length" : 3 },
{ "name" : "op_debug", "length" : 3 },
- { "name" : "op_profile_will_call", "length" : 2 },
- { "name" : "op_profile_did_call", "length" : 2 },
{ "name" : "op_end", "length" : 2 },
{ "name" : "op_profile_type", "length" : 6 },
{ "name" : "op_profile_control_flow", "length" : 2 },
diff --git a/Source/JavaScriptCore/bytecode/BytecodeUseDef.h b/Source/JavaScriptCore/bytecode/BytecodeUseDef.h
index 14e26b8..fd1f44e 100644
--- a/Source/JavaScriptCore/bytecode/BytecodeUseDef.h
+++ b/Source/JavaScriptCore/bytecode/BytecodeUseDef.h
@@ -60,8 +60,6 @@
case op_get_scope:
case op_to_this:
case op_check_tdz:
- case op_profile_will_call:
- case op_profile_did_call:
case op_profile_type:
case op_throw:
case op_end:
@@ -312,8 +310,6 @@
case op_copy_rest:
case op_put_to_scope:
case op_end:
- case op_profile_will_call:
- case op_profile_did_call:
case op_throw:
case op_throw_static_error:
case op_save:
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index 4596715..541f452 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -1659,16 +1659,6 @@
out.printf("%s, %d", registerName(condition).data(), line);
break;
}
- case op_profile_will_call: {
- int function = (++it)->u.operand;
- printLocationOpAndRegisterOperand(out, exec, location, it, "profile_will_call", function);
- break;
- }
- case op_profile_did_call: {
- int function = (++it)->u.operand;
- printLocationOpAndRegisterOperand(out, exec, location, it, "profile_did_call", function);
- break;
- }
case op_end: {
int r0 = (++it)->u.operand;
printLocationOpAndRegisterOperand(out, exec, location, it, "end", r0);
diff --git a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
index 7eb1eb6..05be3aa 100644
--- a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
+++ b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
@@ -49,7 +49,7 @@
static UnlinkedFunctionCodeBlock* generateUnlinkedFunctionCodeBlock(
VM& vm, UnlinkedFunctionExecutable* executable, const SourceCode& source,
- CodeSpecializationKind kind, DebuggerMode debuggerMode, ProfilerMode profilerMode,
+ CodeSpecializationKind kind, DebuggerMode debuggerMode,
UnlinkedFunctionKind functionKind, ParserError& error, SourceParseMode parseMode)
{
JSParserBuiltinMode builtinMode = executable->isBuiltinFunction() ? JSParserBuiltinMode::Builtin : JSParserBuiltinMode::NotBuiltin;
@@ -70,7 +70,7 @@
UnlinkedFunctionCodeBlock* result = UnlinkedFunctionCodeBlock::create(&vm, FunctionCode, ExecutableInfo(function->usesEval(), function->isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction, executable->constructorKind(), executable->superBinding(), parseMode, executable->derivedContextType(), false, isClassContext, EvalContextType::FunctionEvalContext), debuggerMode);
- error = BytecodeGenerator::generate(vm, function.get(), result, debuggerMode, profilerMode, executable->parentScopeTDZVariables());
+ error = BytecodeGenerator::generate(vm, function.get(), result, debuggerMode, executable->parentScopeTDZVariables());
if (error.isValid())
return nullptr;
@@ -191,7 +191,7 @@
UnlinkedFunctionCodeBlock* UnlinkedFunctionExecutable::unlinkedCodeBlockFor(
VM& vm, const SourceCode& source, CodeSpecializationKind specializationKind,
- DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error, SourceParseMode parseMode)
+ DebuggerMode debuggerMode, ParserError& error, SourceParseMode parseMode)
{
switch (specializationKind) {
case CodeForCall:
@@ -205,7 +205,7 @@
}
UnlinkedFunctionCodeBlock* result = generateUnlinkedFunctionCodeBlock(
- vm, this, source, specializationKind, debuggerMode, profilerMode,
+ vm, this, source, specializationKind, debuggerMode,
isBuiltinFunction() ? UnlinkedBuiltinFunction : UnlinkedNormalFunction,
error, parseMode);
diff --git a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
index b359194..646b0a6 100644
--- a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
+++ b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
@@ -101,7 +101,7 @@
void setInvalidTypeProfilingOffsets();
UnlinkedFunctionCodeBlock* unlinkedCodeBlockFor(
- VM&, const SourceCode&, CodeSpecializationKind, DebuggerMode, ProfilerMode,
+ VM&, const SourceCode&, CodeSpecializationKind, DebuggerMode,
ParserError&, SourceParseMode);
static UnlinkedFunctionExecutable* fromGlobalCode(
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index 0c24952..b50151d 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -149,9 +149,8 @@
return ParserError(ParserError::ErrorNone);
}
-BytecodeGenerator::BytecodeGenerator(VM& vm, ProgramNode* programNode, UnlinkedProgramCodeBlock* codeBlock, DebuggerMode debuggerMode, ProfilerMode profilerMode, const VariableEnvironment* parentScopeTDZVariables)
+BytecodeGenerator::BytecodeGenerator(VM& vm, ProgramNode* programNode, UnlinkedProgramCodeBlock* codeBlock, DebuggerMode debuggerMode, const VariableEnvironment* parentScopeTDZVariables)
: m_shouldEmitDebugHooks(Options::forceDebuggerBytecodeGeneration() || debuggerMode == DebuggerOn)
- , m_shouldEmitProfileHooks(Options::forceProfilerBytecodeGeneration() || profilerMode == ProfilerOn)
, m_scopeNode(programNode)
, m_codeBlock(vm, codeBlock)
, m_thisRegister(CallFrame::thisArgumentOffset())
@@ -195,9 +194,8 @@
}
}
-BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, UnlinkedFunctionCodeBlock* codeBlock, DebuggerMode debuggerMode, ProfilerMode profilerMode, const VariableEnvironment* parentScopeTDZVariables)
+BytecodeGenerator::BytecodeGenerator(VM& vm, FunctionNode* functionNode, UnlinkedFunctionCodeBlock* codeBlock, DebuggerMode debuggerMode, const VariableEnvironment* parentScopeTDZVariables)
: m_shouldEmitDebugHooks(Options::forceDebuggerBytecodeGeneration() || debuggerMode == DebuggerOn)
- , m_shouldEmitProfileHooks(Options::forceProfilerBytecodeGeneration() || profilerMode == ProfilerOn)
, m_scopeNode(functionNode)
, m_codeBlock(vm, codeBlock)
, m_codeType(FunctionCode)
@@ -209,7 +207,7 @@
// op_will_call / op_did_call pairs before and after a call, which are not
// compatible with tail calls (we have no way of emitting op_did_call).
// https://bugs.webkit.org/show_bug.cgi?id=148819
- , m_inTailPosition(Options::useTailCalls() && !isConstructor() && constructorKind() == ConstructorKind::None && isStrictMode() && !m_shouldEmitProfileHooks)
+ , m_inTailPosition(Options::useTailCalls() && !isConstructor() && constructorKind() == ConstructorKind::None && isStrictMode())
, m_needsToUpdateArrowFunctionContext(functionNode->usesArrowFunction() || functionNode->usesEval())
, m_derivedContextType(codeBlock->derivedContextType())
{
@@ -605,9 +603,8 @@
pushLexicalScope(m_scopeNode, TDZCheckOptimization::Optimize, NestedScopeType::IsNotNested, nullptr, shouldInitializeBlockScopedFunctions);
}
-BytecodeGenerator::BytecodeGenerator(VM& vm, EvalNode* evalNode, UnlinkedEvalCodeBlock* codeBlock, DebuggerMode debuggerMode, ProfilerMode profilerMode, const VariableEnvironment* parentScopeTDZVariables)
+BytecodeGenerator::BytecodeGenerator(VM& vm, EvalNode* evalNode, UnlinkedEvalCodeBlock* codeBlock, DebuggerMode debuggerMode, const VariableEnvironment* parentScopeTDZVariables)
: m_shouldEmitDebugHooks(Options::forceDebuggerBytecodeGeneration() || debuggerMode == DebuggerOn)
- , m_shouldEmitProfileHooks(Options::forceProfilerBytecodeGeneration() || profilerMode == ProfilerOn)
, m_scopeNode(evalNode)
, m_codeBlock(vm, codeBlock)
, m_thisRegister(CallFrame::thisArgumentOffset())
@@ -663,9 +660,8 @@
pushLexicalScope(m_scopeNode, TDZCheckOptimization::Optimize, NestedScopeType::IsNotNested, nullptr, shouldInitializeBlockScopedFunctions);
}
-BytecodeGenerator::BytecodeGenerator(VM& vm, ModuleProgramNode* moduleProgramNode, UnlinkedModuleProgramCodeBlock* codeBlock, DebuggerMode debuggerMode, ProfilerMode profilerMode, const VariableEnvironment* parentScopeTDZVariables)
+BytecodeGenerator::BytecodeGenerator(VM& vm, ModuleProgramNode* moduleProgramNode, UnlinkedModuleProgramCodeBlock* codeBlock, DebuggerMode debuggerMode, const VariableEnvironment* parentScopeTDZVariables)
: m_shouldEmitDebugHooks(Options::forceDebuggerBytecodeGeneration() || debuggerMode == DebuggerOn)
- , m_shouldEmitProfileHooks(Options::forceProfilerBytecodeGeneration() || profilerMode == ProfilerOn)
, m_scopeNode(moduleProgramNode)
, m_codeBlock(vm, codeBlock)
, m_thisRegister(CallFrame::thisArgumentOffset())
@@ -3073,9 +3069,6 @@
ASSERT(opcodeID == op_call || opcodeID == op_call_eval || opcodeID == op_tail_call);
ASSERT(func->refCount());
- if (m_shouldEmitProfileHooks)
- emitMove(callArguments.profileHookRegister(), func);
-
// Generate code for arguments.
unsigned argument = 0;
if (callArguments.argumentsNode()) {
@@ -3086,7 +3079,7 @@
RefPtr<RegisterID> argumentRegister;
argumentRegister = expression->emitBytecode(*this, callArguments.argumentRegister(0));
RefPtr<RegisterID> thisRegister = emitMove(newTemporary(), callArguments.thisRegister());
- return emitCallVarargs(opcodeID == op_tail_call ? op_tail_call_varargs : op_call_varargs, dst, func, callArguments.thisRegister(), argumentRegister.get(), newTemporary(), 0, callArguments.profileHookRegister(), divot, divotStart, divotEnd);
+ return emitCallVarargs(opcodeID == op_tail_call ? op_tail_call_varargs : op_call_varargs, dst, func, callArguments.thisRegister(), argumentRegister.get(), newTemporary(), 0, divot, divotStart, divotEnd);
}
for (; n; n = n->m_next)
emitNode(callArguments.argumentRegister(argument++), n);
@@ -3097,11 +3090,6 @@
for (int i = 0; i < JSStack::CallFrameHeaderSize; ++i)
callFrame.append(newTemporary());
- if (m_shouldEmitProfileHooks) {
- emitOpcode(op_profile_will_call);
- instructions().append(callArguments.profileHookRegister()->index());
- }
-
emitExpressionInfo(divot, divotStart, divotEnd);
RefPtr<Label> done = newLabel();
@@ -3127,37 +3115,26 @@
if (expectedFunction != NoExpectedFunction)
emitLabel(done.get());
- if (m_shouldEmitProfileHooks) {
- emitOpcode(op_profile_did_call);
- instructions().append(callArguments.profileHookRegister()->index());
- }
-
return dst;
}
-RegisterID* BytecodeGenerator::emitCallVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
+RegisterID* BytecodeGenerator::emitCallVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
{
- return emitCallVarargs(op_call_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, profileHookRegister, divot, divotStart, divotEnd);
+ return emitCallVarargs(op_call_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, divot, divotStart, divotEnd);
}
-RegisterID* BytecodeGenerator::emitCallVarargsInTailPosition(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
+RegisterID* BytecodeGenerator::emitCallVarargsInTailPosition(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
{
- return emitCallVarargs(m_inTailPosition ? op_tail_call_varargs : op_call_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, profileHookRegister, divot, divotStart, divotEnd);
+ return emitCallVarargs(m_inTailPosition ? op_tail_call_varargs : op_call_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, divot, divotStart, divotEnd);
}
-RegisterID* BytecodeGenerator::emitConstructVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
+RegisterID* BytecodeGenerator::emitConstructVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
{
- return emitCallVarargs(op_construct_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, profileHookRegister, divot, divotStart, divotEnd);
+ return emitCallVarargs(op_construct_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, divot, divotStart, divotEnd);
}
-RegisterID* BytecodeGenerator::emitCallVarargs(OpcodeID opcode, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
+RegisterID* BytecodeGenerator::emitCallVarargs(OpcodeID opcode, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd)
{
- if (m_shouldEmitProfileHooks) {
- emitMove(profileHookRegister, func);
- emitOpcode(op_profile_will_call);
- instructions().append(profileHookRegister->index());
- }
-
emitExpressionInfo(divot, divotStart, divotEnd);
if (opcode == op_tail_call_varargs)
@@ -3175,10 +3152,6 @@
instructions().append(firstVarArgOffset);
instructions().append(arrayProfile);
instructions().append(profile);
- if (m_shouldEmitProfileHooks) {
- emitOpcode(op_profile_did_call);
- instructions().append(profileHookRegister->index());
- }
return dst;
}
@@ -3274,9 +3247,6 @@
{
ASSERT(func->refCount());
- if (m_shouldEmitProfileHooks)
- emitMove(callArguments.profileHookRegister(), func);
-
// Generate code for arguments.
unsigned argument = 0;
if (ArgumentsNode* argumentsNode = callArguments.argumentsNode()) {
@@ -3287,18 +3257,13 @@
auto expression = static_cast<SpreadExpressionNode*>(n->m_expr)->expression();
RefPtr<RegisterID> argumentRegister;
argumentRegister = expression->emitBytecode(*this, callArguments.argumentRegister(0));
- return emitConstructVarargs(dst, func, callArguments.thisRegister(), argumentRegister.get(), newTemporary(), 0, callArguments.profileHookRegister(), divot, divotStart, divotEnd);
+ return emitConstructVarargs(dst, func, callArguments.thisRegister(), argumentRegister.get(), newTemporary(), 0, divot, divotStart, divotEnd);
}
for (ArgumentListNode* n = argumentsNode->m_listNode; n; n = n->m_next)
emitNode(callArguments.argumentRegister(argument++), n);
}
- if (m_shouldEmitProfileHooks) {
- emitOpcode(op_profile_will_call);
- instructions().append(callArguments.profileHookRegister()->index());
- }
-
// Reserve space for call frame.
Vector<RefPtr<RegisterID>, JSStack::CallFrameHeaderSize, UnsafeVectorOverflow> callFrame;
for (int i = 0; i < JSStack::CallFrameHeaderSize; ++i)
@@ -3323,11 +3288,6 @@
if (expectedFunction != NoExpectedFunction)
emitLabel(done.get());
- if (m_shouldEmitProfileHooks) {
- emitOpcode(op_profile_did_call);
- instructions().append(callArguments.profileHookRegister()->index());
- }
-
return dst;
}
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index a204a03..16b1f53 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -75,11 +75,9 @@
RegisterID* argumentRegister(unsigned i) { return m_argv[i + 1].get(); }
unsigned stackOffset() { return -m_argv[0]->index() + JSStack::CallFrameHeaderSize; }
unsigned argumentCountIncludingThis() { return m_argv.size() - m_padding; }
- RegisterID* profileHookRegister() { return m_profileHookRegister.get(); }
ArgumentsNode* argumentsNode() { return m_argumentsNode; }
private:
- RefPtr<RegisterID> m_profileHookRegister;
ArgumentsNode* m_argumentsNode;
Vector<RefPtr<RegisterID>, 8, UnsafeVectorOverflow> m_argv;
unsigned m_padding;
@@ -269,10 +267,10 @@
public:
typedef DeclarationStacks::FunctionStack FunctionStack;
- BytecodeGenerator(VM&, ProgramNode*, UnlinkedProgramCodeBlock*, DebuggerMode, ProfilerMode, const VariableEnvironment*);
- BytecodeGenerator(VM&, FunctionNode*, UnlinkedFunctionCodeBlock*, DebuggerMode, ProfilerMode, const VariableEnvironment*);
- BytecodeGenerator(VM&, EvalNode*, UnlinkedEvalCodeBlock*, DebuggerMode, ProfilerMode, const VariableEnvironment*);
- BytecodeGenerator(VM&, ModuleProgramNode*, UnlinkedModuleProgramCodeBlock*, DebuggerMode, ProfilerMode, const VariableEnvironment*);
+ BytecodeGenerator(VM&, ProgramNode*, UnlinkedProgramCodeBlock*, DebuggerMode, const VariableEnvironment*);
+ BytecodeGenerator(VM&, FunctionNode*, UnlinkedFunctionCodeBlock*, DebuggerMode, const VariableEnvironment*);
+ BytecodeGenerator(VM&, EvalNode*, UnlinkedEvalCodeBlock*, DebuggerMode, const VariableEnvironment*);
+ BytecodeGenerator(VM&, ModuleProgramNode*, UnlinkedModuleProgramCodeBlock*, DebuggerMode, const VariableEnvironment*);
~BytecodeGenerator();
@@ -577,8 +575,8 @@
RegisterID* emitCall(RegisterID* dst, RegisterID* func, ExpectedFunction, CallArguments&, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
RegisterID* emitCallInTailPosition(RegisterID* dst, RegisterID* func, ExpectedFunction, CallArguments&, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
RegisterID* emitCallEval(RegisterID* dst, RegisterID* func, CallArguments&, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
- RegisterID* emitCallVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
- RegisterID* emitCallVarargsInTailPosition(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
+ RegisterID* emitCallVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
+ RegisterID* emitCallVarargsInTailPosition(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
enum PropertyDescriptorOption {
PropertyConfigurable = 1,
@@ -704,7 +702,6 @@
CodeType codeType() const { return m_codeType; }
- bool shouldEmitProfileHooks() { return m_shouldEmitProfileHooks; }
bool shouldEmitDebugHooks() { return m_shouldEmitDebugHooks; }
bool isStrictMode() const { return m_codeBlock->isStrictMode(); }
@@ -849,8 +846,8 @@
void getVariablesUnderTDZ(VariableEnvironment&);
- RegisterID* emitConstructVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
- RegisterID* emitCallVarargs(OpcodeID, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
+ RegisterID* emitConstructVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
+ RegisterID* emitCallVarargs(OpcodeID, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd);
void emitLogShadowChickenPrologueIfNecessary();
void emitLogShadowChickenTailIfNecessary();
@@ -872,7 +869,6 @@
Vector<UnlinkedInstruction, 0, UnsafeVectorOverflow> m_instructions;
bool m_shouldEmitDebugHooks;
- bool m_shouldEmitProfileHooks;
struct SymbolTableStackEntry {
SymbolTable* m_symbolTable;
diff --git a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index f2530ee..3bbd2f1 100644
--- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -707,9 +707,6 @@
: m_argumentsNode(argumentsNode)
, m_padding(0)
{
- if (generator.shouldEmitProfileHooks())
- m_profileHookRegister = generator.newTemporary();
-
size_t argumentCountIncludingThis = 1 + additionalArguments; // 'this' register.
if (argumentsNode) {
for (ArgumentListNode* node = argumentsNode->m_listNode; node; node = node->m_next)
@@ -1021,16 +1018,13 @@
RefPtr<RegisterID> returnValue = generator.finalDestination(dst);
{
if (m_args->m_listNode && m_args->m_listNode->m_expr && m_args->m_listNode->m_expr->isSpreadExpression()) {
- RefPtr<RegisterID> profileHookRegister;
- if (generator.shouldEmitProfileHooks())
- profileHookRegister = generator.newTemporary();
SpreadExpressionNode* spread = static_cast<SpreadExpressionNode*>(m_args->m_listNode->m_expr);
ExpressionNode* subject = spread->expression();
RefPtr<RegisterID> argumentsRegister;
argumentsRegister = generator.emitNode(subject);
generator.emitExpressionInfo(spread->divot(), spread->divotStart(), spread->divotEnd());
RefPtr<RegisterID> thisRegister = generator.emitGetByVal(generator.newTemporary(), argumentsRegister.get(), generator.emitLoad(0, jsNumber(0)));
- generator.emitCallVarargsInTailPosition(returnValue.get(), base.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 1, profileHookRegister.get(), divot(), divotStart(), divotEnd());
+ generator.emitCallVarargsInTailPosition(returnValue.get(), base.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 1, divot(), divotStart(), divotEnd());
} else if (m_args->m_listNode && m_args->m_listNode->m_expr) {
ArgumentListNode* oldList = m_args->m_listNode;
m_args->m_listNode = m_args->m_listNode->m_next;
@@ -1094,9 +1088,6 @@
ArgumentListNode* oldList = m_args->m_listNode;
if (m_args->m_listNode->m_expr->isSpreadExpression()) {
SpreadExpressionNode* spread = static_cast<SpreadExpressionNode*>(m_args->m_listNode->m_expr);
- RefPtr<RegisterID> profileHookRegister;
- if (generator.shouldEmitProfileHooks())
- profileHookRegister = generator.newTemporary();
RefPtr<RegisterID> realFunction = generator.emitMove(generator.newTemporary(), base.get());
RefPtr<RegisterID> index = generator.emitLoad(generator.newTemporary(), jsNumber(0));
RefPtr<RegisterID> thisRegister = generator.emitLoad(generator.newTemporary(), jsUndefined());
@@ -1120,7 +1111,7 @@
generator.emitLabel(end.get());
};
generator.emitEnumeration(this, spread->expression(), extractor);
- generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 0, profileHookRegister.get(), divot(), divotStart(), divotEnd());
+ generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 0, divot(), divotStart(), divotEnd());
} else if (m_args->m_listNode->m_next) {
ASSERT(m_args->m_listNode->m_next->m_expr->isSimpleArray());
ASSERT(!m_args->m_listNode->m_next->m_next);
@@ -1145,9 +1136,6 @@
}
} else {
ASSERT(m_args->m_listNode && m_args->m_listNode->m_next);
- RefPtr<RegisterID> profileHookRegister;
- if (generator.shouldEmitProfileHooks())
- profileHookRegister = generator.newTemporary();
RefPtr<RegisterID> realFunction = generator.emitMove(generator.tempDestination(dst), base.get());
RefPtr<RegisterID> thisRegister = generator.emitNode(m_args->m_listNode->m_expr);
RefPtr<RegisterID> argsRegister;
@@ -1159,7 +1147,7 @@
while ((args = args->m_next))
generator.emitNode(args->m_expr);
- generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), 0, profileHookRegister.get(), divot(), divotStart(), divotEnd());
+ generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), 0, divot(), divotStart(), divotEnd());
}
if (emitCallCheck) {
generator.emitJump(end.get());
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
index 09b4f2e..4010c12 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
+++ b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
@@ -2788,8 +2788,6 @@
case LogShadowChickenTail:
break;
- case ProfileWillCall:
- case ProfileDidCall:
case ProfileType:
case ProfileControlFlow:
case Phantom:
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index 2f49fa5..aa831c3 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -3761,16 +3761,6 @@
NEXT_OPCODE(op_debug);
}
- case op_profile_will_call: {
- addToGraph(ProfileWillCall);
- NEXT_OPCODE(op_profile_will_call);
- }
-
- case op_profile_did_call: {
- addToGraph(ProfileDidCall);
- NEXT_OPCODE(op_profile_did_call);
- }
-
case op_mov: {
Node* op = get(VirtualRegister(currentInstruction[2].u.operand));
set(VirtualRegister(currentInstruction[1].u.operand), op);
diff --git a/Source/JavaScriptCore/dfg/DFGCapabilities.cpp b/Source/JavaScriptCore/dfg/DFGCapabilities.cpp
index cc2d474..06669d4 100644
--- a/Source/JavaScriptCore/dfg/DFGCapabilities.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCapabilities.cpp
@@ -124,8 +124,6 @@
case op_mod:
case op_div:
case op_debug:
- case op_profile_will_call:
- case op_profile_did_call:
case op_profile_type:
case op_profile_control_flow:
case op_mov:
diff --git a/Source/JavaScriptCore/dfg/DFGClobberize.h b/Source/JavaScriptCore/dfg/DFGClobberize.h
index 726439d..e670e5b 100644
--- a/Source/JavaScriptCore/dfg/DFGClobberize.h
+++ b/Source/JavaScriptCore/dfg/DFGClobberize.h
@@ -369,8 +369,6 @@
case CheckTierUpAtReturn:
case CheckTierUpAndOSREnter:
case LoopHint:
- case ProfileWillCall:
- case ProfileDidCall:
case ProfileType:
case ProfileControlFlow:
case StoreBarrier:
diff --git a/Source/JavaScriptCore/dfg/DFGDoesGC.cpp b/Source/JavaScriptCore/dfg/DFGDoesGC.cpp
index af11e18..3936d26 100644
--- a/Source/JavaScriptCore/dfg/DFGDoesGC.cpp
+++ b/Source/JavaScriptCore/dfg/DFGDoesGC.cpp
@@ -150,8 +150,6 @@
case ConstructForwardVarargs:
case TailCallForwardVarargs:
case TailCallForwardVarargsInlinedCaller:
- case ProfileWillCall:
- case ProfileDidCall:
case ProfileType:
case ProfileControlFlow:
case OverridesHasInstance:
diff --git a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
index ce52527..377a02a 100644
--- a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
@@ -1533,8 +1533,6 @@
case NewObject:
case NewArrayBuffer:
case NewRegexp:
- case ProfileWillCall:
- case ProfileDidCall:
case DeleteById:
case DeleteByVal:
case IsEmpty:
diff --git a/Source/JavaScriptCore/dfg/DFGNodeType.h b/Source/JavaScriptCore/dfg/DFGNodeType.h
index 341134f9..0608102 100644
--- a/Source/JavaScriptCore/dfg/DFGNodeType.h
+++ b/Source/JavaScriptCore/dfg/DFGNodeType.h
@@ -303,8 +303,6 @@
macro(MaterializeCreateActivation, NodeResultJS | NodeHasVarArgs) \
\
/* Nodes for misc operations. */\
- macro(ProfileWillCall, NodeMustGenerate) \
- macro(ProfileDidCall, NodeMustGenerate) \
macro(OverridesHasInstance, NodeMustGenerate | NodeResultBoolean) \
macro(InstanceOf, NodeResultBoolean) \
macro(InstanceOfCustom, NodeMustGenerate | NodeResultBoolean) \
diff --git a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
index 8700775..a06dd4d 100644
--- a/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
@@ -1028,8 +1028,6 @@
case DFG::Jump:
case Branch:
case Switch:
- case ProfileWillCall:
- case ProfileDidCall:
case ProfileType:
case ProfileControlFlow:
case ThrowReferenceError:
diff --git a/Source/JavaScriptCore/dfg/DFGSafeToExecute.h b/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
index 6135736..627d797 100644
--- a/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
+++ b/Source/JavaScriptCore/dfg/DFGSafeToExecute.h
@@ -250,8 +250,6 @@
case NewArrayWithSize:
case NewArrayBuffer:
case NewRegexp:
- case ProfileWillCall:
- case ProfileDidCall:
case ProfileType:
case ProfileControlFlow:
case CheckTypeInfoFlags:
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index d70b215..50e78d3 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -5247,8 +5247,6 @@
noResult(node);
break;
- case ProfileWillCall:
- case ProfileDidCall:
case PhantomLocal:
case LoopHint:
// This is a no-op.
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index b9a400c..0d01802 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -4794,8 +4794,6 @@
noResult(node);
break;
- case ProfileWillCall:
- case ProfileDidCall:
case PhantomLocal:
case LoopHint:
// This is a no-op.
diff --git a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp
index 1864e84..9caa4eb 100644
--- a/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp
+++ b/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp
@@ -36,7 +36,6 @@
#include "InspectorValues.h"
#include "JSCInlines.h"
#include "JSGlobalObject.h"
-#include "LegacyProfiler.h"
#include "ScriptFunctionCall.h"
#include <wtf/text/WTFString.h>
@@ -72,17 +71,8 @@
JSC::JSValue InjectedScriptBase::callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall& function, bool& hadException) const
{
JSC::ExecState* scriptState = m_injectedScriptObject.scriptState();
- JSC::LegacyProfiler::profiler()->suspendProfiling(scriptState);
-
- JSC::JSValue resultValue;
- {
- JSC::DebuggerEvalEnabler evalEnabler(scriptState);
- resultValue = function.call(hadException);
- }
-
- JSC::LegacyProfiler::profiler()->unsuspendProfiling(scriptState);
-
- return resultValue;
+ JSC::DebuggerEvalEnabler evalEnabler(scriptState);
+ return function.call(hadException);
}
void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall& function, RefPtr<InspectorValue>* result)
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 8930ac3..bf62ed0 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -53,7 +53,6 @@
#include "JSWithScope.h"
#include "LLIntCLoop.h"
#include "LLIntThunks.h"
-#include "LegacyProfiler.h"
#include "LiteralParser.h"
#include "ObjectPrototype.h"
#include "Parser.h"
@@ -675,7 +674,6 @@
StackVisitor::Status operator()(StackVisitor& visitor) const
{
visitor.unwindToMachineCodeBlockFrame();
- VM& vm = m_callFrame->vm();
m_callFrame = visitor->callFrame();
m_codeBlock = visitor->codeBlock();
@@ -692,9 +690,6 @@
bool shouldStopUnwinding = visitor->callerIsVMEntryFrame();
if (shouldStopUnwinding) {
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->exceptionUnwind(m_callFrame);
-
copyCalleeSavesToVMEntryFrameCalleeSavesBuffer(visitor);
return StackVisitor::Done;
@@ -954,15 +949,9 @@
ProtoCallFrame protoCallFrame;
protoCallFrame.init(codeBlock, JSCallee::create(vm, scope->globalObject(), scope), thisObj, 1);
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->willExecute(callFrame, program->sourceURL(), program->firstLine(), program->startColumn());
-
// Execute the code:
JSValue result = program->generatedJITCode()->execute(&vm, &protoCallFrame);
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->didExecute(callFrame, program->sourceURL(), program->firstLine(), program->startColumn());
-
return checkedReturn(result);
}
@@ -1011,9 +1000,6 @@
ProtoCallFrame protoCallFrame;
protoCallFrame.init(newCodeBlock, function, thisValue, argsCount, args.data());
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->willExecute(callFrame, function);
-
JSValue result;
{
// Execute the code:
@@ -1026,9 +1012,6 @@
}
}
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->didExecute(callFrame, function);
-
return checkedReturn(result);
}
@@ -1079,9 +1062,6 @@
ProtoCallFrame protoCallFrame;
protoCallFrame.init(newCodeBlock, constructor, newTarget, argsCount, args.data());
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->willExecute(callFrame, constructor);
-
JSValue result;
{
// Execute the code.
@@ -1095,9 +1075,6 @@
}
}
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->didExecute(callFrame, constructor);
-
if (callFrame->hadException())
return 0;
ASSERT(result.isObject());
@@ -1140,18 +1117,12 @@
StackStats::CheckPoint stackCheckPoint;
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->willExecute(closure.oldCallFrame, closure.function);
-
if (UNLIKELY(vm.shouldTriggerTermination(closure.oldCallFrame)))
return throwTerminatedExecutionException(closure.oldCallFrame);
// Execute the code:
JSValue result = closure.functionExecutable->generatedJITCodeForCall()->execute(&vm, closure.protoCallFrame);
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->didExecute(closure.oldCallFrame, closure.function);
-
return checkedReturn(result);
}
@@ -1249,15 +1220,9 @@
ProtoCallFrame protoCallFrame;
protoCallFrame.init(codeBlock, JSCallee::create(vm, scope->globalObject(), scope), thisValue, 1);
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->willExecute(callFrame, eval->sourceURL(), eval->firstLine(), eval->startColumn());
-
// Execute the code:
JSValue result = eval->generatedJITCode()->execute(&vm, &protoCallFrame);
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->didExecute(callFrame, eval->sourceURL(), eval->firstLine(), eval->startColumn());
-
return checkedReturn(result);
}
@@ -1292,15 +1257,9 @@
ProtoCallFrame protoCallFrame;
protoCallFrame.init(codeBlock, JSCallee::create(vm, scope->globalObject(), scope), jsUndefined(), 1);
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->willExecute(callFrame, executable->sourceURL(), executable->firstLine(), executable->startColumn());
-
// Execute the code:
JSValue result = executable->generatedJITCode()->execute(&vm, &protoCallFrame);
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->didExecute(callFrame, executable->sourceURL(), executable->firstLine(), executable->startColumn());
-
return checkedReturn(result);
}
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp
index 1d50aba..adaa860 100644
--- a/Source/JavaScriptCore/jit/JIT.cpp
+++ b/Source/JavaScriptCore/jit/JIT.cpp
@@ -290,8 +290,6 @@
DEFINE_OP(op_nstricteq)
DEFINE_OP(op_dec)
DEFINE_OP(op_inc)
- DEFINE_OP(op_profile_did_call)
- DEFINE_OP(op_profile_will_call)
DEFINE_OP(op_profile_type)
DEFINE_OP(op_profile_control_flow)
DEFINE_OP(op_push_with_scope)
diff --git a/Source/JavaScriptCore/jit/JIT.h b/Source/JavaScriptCore/jit/JIT.h
index 5114006..43fbebf 100644
--- a/Source/JavaScriptCore/jit/JIT.h
+++ b/Source/JavaScriptCore/jit/JIT.h
@@ -560,8 +560,6 @@
void emit_op_nstricteq(Instruction*);
void emit_op_dec(Instruction*);
void emit_op_inc(Instruction*);
- void emit_op_profile_did_call(Instruction*);
- void emit_op_profile_will_call(Instruction*);
void emit_op_profile_type(Instruction*);
void emit_op_profile_control_flow(Instruction*);
void emit_op_push_with_scope(Instruction*);
diff --git a/Source/JavaScriptCore/jit/JITOpcodes.cpp b/Source/JavaScriptCore/jit/JITOpcodes.cpp
index 1995801..33f8346 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes.cpp
@@ -774,22 +774,6 @@
slowPathCall.call();
}
-void JIT::emit_op_profile_will_call(Instruction* currentInstruction)
-{
- Jump profilerDone = branchTestPtr(Zero, AbsoluteAddress(m_vm->enabledProfilerAddress()));
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
- callOperation(operationProfileWillCall, regT0);
- profilerDone.link(this);
-}
-
-void JIT::emit_op_profile_did_call(Instruction* currentInstruction)
-{
- Jump profilerDone = branchTestPtr(Zero, AbsoluteAddress(m_vm->enabledProfilerAddress()));
- emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
- callOperation(operationProfileDidCall, regT0);
- profilerDone.link(this);
-}
-
// Slow cases
diff --git a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
index 8d88b21..3e90a13 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
@@ -1060,24 +1060,6 @@
slowPathCall.call();
}
-void JIT::emit_op_profile_will_call(Instruction* currentInstruction)
-{
- load32(m_vm->enabledProfilerAddress(), regT0);
- Jump profilerDone = branchTestPtr(Zero, regT0);
- emitLoad(currentInstruction[1].u.operand, regT1, regT0);
- callOperation(operationProfileWillCall, regT1, regT0);
- profilerDone.link(this);
-}
-
-void JIT::emit_op_profile_did_call(Instruction* currentInstruction)
-{
- load32(m_vm->enabledProfilerAddress(), regT0);
- Jump profilerDone = branchTestPtr(Zero, regT0);
- emitLoad(currentInstruction[1].u.operand, regT1, regT0);
- callOperation(operationProfileDidCall, regT1, regT0);
- profilerDone.link(this);
-}
-
void JIT::emit_op_has_structure_property(Instruction* currentInstruction)
{
int dst = currentInstruction[1].u.operand;
diff --git a/Source/JavaScriptCore/jit/JITOperations.cpp b/Source/JavaScriptCore/jit/JITOperations.cpp
index bc81c5c..39304bf 100644
--- a/Source/JavaScriptCore/jit/JITOperations.cpp
+++ b/Source/JavaScriptCore/jit/JITOperations.cpp
@@ -53,7 +53,6 @@
#include "JSPropertyNameEnumerator.h"
#include "JSStackInlines.h"
#include "JSWithScope.h"
-#include "LegacyProfiler.h"
#include "ObjectConstructor.h"
#include "PolymorphicAccess.h"
#include "PropertyName.h"
@@ -1242,12 +1241,6 @@
return encodeResult(0, 0);
}
- if (vm.enabledProfiler()) {
- CODEBLOCK_LOG_EVENT(codeBlock, "delayOptimizeToDFG", ("profiler is enabled"));
- updateAllPredictionsAndOptimizeAfterWarmUp(codeBlock);
- return encodeResult(0, 0);
- }
-
Debugger* debugger = codeBlock->globalObject()->debugger();
if (debugger && (debugger->isStepping() || codeBlock->baselineAlternative()->hasDebuggerRequests())) {
CODEBLOCK_LOG_EVENT(codeBlock, "delayOptimizeToDFG", ("debugger is stepping or has requests"));
@@ -1559,24 +1552,6 @@
exec->uncheckedR(scopeReg) = scope->next();
}
-void JIT_OPERATION operationProfileDidCall(ExecState* exec, EncodedJSValue encodedValue)
-{
- VM& vm = exec->vm();
- NativeCallFrameTracer tracer(&vm, exec);
-
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->didExecute(exec, JSValue::decode(encodedValue));
-}
-
-void JIT_OPERATION operationProfileWillCall(ExecState* exec, EncodedJSValue encodedValue)
-{
- VM& vm = exec->vm();
- NativeCallFrameTracer tracer(&vm, exec);
-
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->willExecute(exec, JSValue::decode(encodedValue));
-}
-
int32_t JIT_OPERATION operationInstanceOfCustom(ExecState* exec, EncodedJSValue encodedValue, JSObject* constructor, EncodedJSValue encodedHasInstance)
{
VM& vm = exec->vm();
@@ -2358,9 +2333,6 @@
NativeCallFrameTracer tracer(&vm, exec);
RELEASE_ASSERT(!!vm.exception());
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->exceptionUnwind(exec);
-
if (isTerminatedExecutionException(vm.exception())) {
genericUnwind(&vm, exec);
return 1;
diff --git a/Source/JavaScriptCore/jit/JITOperations.h b/Source/JavaScriptCore/jit/JITOperations.h
index 1ba4181..a9726eb 100644
--- a/Source/JavaScriptCore/jit/JITOperations.h
+++ b/Source/JavaScriptCore/jit/JITOperations.h
@@ -369,8 +369,6 @@
#endif
void JIT_OPERATION operationPushFunctionNameScope(ExecState*, int32_t, SymbolTable*, EncodedJSValue) WTF_INTERNAL;
void JIT_OPERATION operationPopScope(ExecState*, int32_t) WTF_INTERNAL;
-void JIT_OPERATION operationProfileDidCall(ExecState*, EncodedJSValue) WTF_INTERNAL;
-void JIT_OPERATION operationProfileWillCall(ExecState*, EncodedJSValue) WTF_INTERNAL;
EncodedJSValue JIT_OPERATION operationGetByValOptimize(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript, ByValInfo*) WTF_INTERNAL;
EncodedJSValue JIT_OPERATION operationGetByValGeneric(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript, ByValInfo*) WTF_INTERNAL;
EncodedJSValue JIT_OPERATION operationGetByValString(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript, ByValInfo*) WTF_INTERNAL;
diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
index 3759113..fa88374 100644
--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
@@ -50,7 +50,6 @@
#include "JSWithScope.h"
#include "LLIntCommon.h"
#include "LLIntExceptions.h"
-#include "LegacyProfiler.h"
#include "LowLevelInterpreter.h"
#include "ObjectConstructor.h"
#include "ProtoCallFrame.h"
@@ -1426,22 +1425,6 @@
LLINT_END();
}
-LLINT_SLOW_PATH_DECL(slow_path_profile_will_call)
-{
- LLINT_BEGIN();
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->willExecute(exec, LLINT_OP(1).jsValue());
- LLINT_END();
-}
-
-LLINT_SLOW_PATH_DECL(slow_path_profile_did_call)
-{
- LLINT_BEGIN();
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->didExecute(exec, LLINT_OP(1).jsValue());
- LLINT_END();
-}
-
LLINT_SLOW_PATH_DECL(slow_path_handle_exception)
{
LLINT_BEGIN_NO_SET_PC();
@@ -1530,9 +1513,6 @@
LLINT_BEGIN();
RELEASE_ASSERT(!!vm.exception());
- if (LegacyProfiler* profiler = vm.enabledProfiler())
- profiler->exceptionUnwind(exec);
-
if (isTerminatedExecutionException(vm.exception()))
LLINT_RETURN_TWO(pc, bitwise_cast<void*>(static_cast<uintptr_t>(1)));
LLINT_RETURN_TWO(pc, 0);
diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.h b/Source/JavaScriptCore/llint/LLIntSlowPaths.h
index e3d41e4..2499542 100644
--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.h
+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.h
@@ -117,8 +117,6 @@
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_throw_static_error);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_watchdog_timer);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_debug);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_will_call);
-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_did_call);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_exception);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_from_scope);
LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_to_scope);
diff --git a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
index 678910c..4d07a36 100644
--- a/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
+++ b/Source/JavaScriptCore/llint/LowLevelInterpreter.asm
@@ -1641,28 +1641,6 @@
dispatch(3)
-_llint_op_profile_will_call:
- traceExecution()
- loadp CodeBlock[cfr], t0
- loadp CodeBlock::m_vm[t0], t0
- loadi VM::m_enabledProfiler[t0], t0
- btpz t0, .opProfilerWillCallDone
- callSlowPath(_llint_slow_path_profile_will_call)
-.opProfilerWillCallDone:
- dispatch(2)
-
-
-_llint_op_profile_did_call:
- traceExecution()
- loadp CodeBlock[cfr], t0
- loadp CodeBlock::m_vm[t0], t0
- loadi VM::m_enabledProfiler[t0], t0
- btpz t0, .opProfilerDidCallDone
- callSlowPath(_llint_slow_path_profile_did_call)
-.opProfilerDidCallDone:
- dispatch(2)
-
-
_llint_op_debug:
traceExecution()
loadp CodeBlock[cfr], t0
diff --git a/Source/JavaScriptCore/parser/ParserModes.h b/Source/JavaScriptCore/parser/ParserModes.h
index f0c3a22..2b7953a 100644
--- a/Source/JavaScriptCore/parser/ParserModes.h
+++ b/Source/JavaScriptCore/parser/ParserModes.h
@@ -39,7 +39,6 @@
enum class SuperBinding { Needed, NotNeeded };
enum class ThisTDZMode { AlwaysCheck, CheckIfNeeded };
-enum ProfilerMode { ProfilerOff, ProfilerOn };
enum DebuggerMode { DebuggerOff, DebuggerOn };
enum class FunctionMode { FunctionExpression, FunctionDeclaration, MethodDefinition };
diff --git a/Source/JavaScriptCore/profiler/CallIdentifier.h b/Source/JavaScriptCore/profiler/CallIdentifier.h
deleted file mode 100644
index 691fc62..0000000
--- a/Source/JavaScriptCore/profiler/CallIdentifier.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2008, 2014 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#ifndef CallIdentifier_h
-#define CallIdentifier_h
-
-#include <wtf/text/CString.h>
-#include <wtf/text/StringHash.h>
-#include <wtf/text/WTFString.h>
-
-namespace JSC {
-
- struct CallIdentifier {
- WTF_MAKE_FAST_ALLOCATED;
- public:
- CallIdentifier()
- : m_lineNumber(0)
- , m_columnNumber(0)
- {
- }
-
- CallIdentifier(const String& functionName, const String& url, unsigned lineNumber, unsigned columnNumber)
- : m_functionName(functionName)
- , m_url(!url.isNull() ? url : "")
- , m_lineNumber(lineNumber)
- , m_columnNumber(columnNumber)
- {
- }
-
- const String& functionName() const { return m_functionName; }
-
- const String& url() const { return m_url; }
- unsigned lineNumber() const { return m_lineNumber; }
- unsigned columnNumber() const { return m_columnNumber; }
-
- inline bool operator==(const CallIdentifier& other) const { return other.m_lineNumber == m_lineNumber && other.m_columnNumber == m_columnNumber && other.m_functionName == m_functionName && other.m_url == m_url; }
- inline bool operator!=(const CallIdentifier& other) const { return !(*this == other); }
-
- struct Hash {
- static unsigned hash(const CallIdentifier& key)
- {
- unsigned hashCodes[4] = {
- key.m_functionName.impl()->hash(),
- key.m_url.impl()->hash(),
- key.m_lineNumber,
- key.m_columnNumber
- };
- return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
- }
-
- static bool equal(const CallIdentifier& a, const CallIdentifier& b) { return a == b; }
- static const bool safeToCompareToEmptyOrDeleted = true;
- };
-
- unsigned hash() const { return Hash::hash(*this); }
-
-#ifndef NDEBUG
- operator const char*() const { return c_str(); }
- const char* c_str() const { return m_functionName.utf8().data(); }
-#endif
-
- private:
- String m_functionName;
- String m_url;
- unsigned m_lineNumber;
- unsigned m_columnNumber;
- };
-
-} // namespace JSC
-
-namespace WTF {
-
- template<> struct DefaultHash<JSC::CallIdentifier> { typedef JSC::CallIdentifier::Hash Hash; };
-
- template<> struct HashTraits<JSC::CallIdentifier> : GenericHashTraits<JSC::CallIdentifier> {
- static void constructDeletedValue(JSC::CallIdentifier& slot)
- {
- new (NotNull, &slot) JSC::CallIdentifier(String(), String(), std::numeric_limits<unsigned>::max(), std::numeric_limits<unsigned>::max());
- }
-
- static bool isDeletedValue(const JSC::CallIdentifier& value)
- {
- return value.functionName().isNull() && value.url().isNull() && value.lineNumber() == std::numeric_limits<unsigned>::max() && value.columnNumber() == std::numeric_limits<unsigned>::max();
- }
- };
-
-} // namespace WTF
-
-#endif // CallIdentifier_h
diff --git a/Source/JavaScriptCore/profiler/LegacyProfiler.cpp b/Source/JavaScriptCore/profiler/LegacyProfiler.cpp
deleted file mode 100644
index 787d362..0000000
--- a/Source/JavaScriptCore/profiler/LegacyProfiler.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright (C) 2008, 2012, 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "LegacyProfiler.h"
-
-#include "CallFrame.h"
-#include "CodeBlock.h"
-#include "CommonIdentifiers.h"
-#include "InternalFunction.h"
-#include "JSFunction.h"
-#include "JSGlobalObject.h"
-#include "Nodes.h"
-#include "JSCInlines.h"
-#include "Profile.h"
-#include "ProfileGenerator.h"
-#include "ProfileNode.h"
-
-namespace JSC {
-
-static const char* GlobalCodeExecution = "(program)";
-static const char* AnonymousFunction = "(anonymous function)";
-static unsigned ProfilesUID = 0;
-
-static CallIdentifier createCallIdentifierFromFunctionImp(ExecState*, JSObject*, const String& defaultSourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber);
-
-LegacyProfiler* LegacyProfiler::s_sharedLegacyProfiler = nullptr;
-
-LegacyProfiler* LegacyProfiler::profiler()
-{
- if (!s_sharedLegacyProfiler)
- s_sharedLegacyProfiler = new LegacyProfiler();
- return s_sharedLegacyProfiler;
-}
-
-void LegacyProfiler::startProfiling(ExecState* exec, const String& title, PassRefPtr<Stopwatch> stopwatch)
-{
- if (!exec)
- return;
-
- // Check if we currently have a Profile for this global ExecState and title.
- // If so return early and don't create a new Profile.
- JSGlobalObject* origin = exec->lexicalGlobalObject();
-
- for (size_t i = 0; i < m_currentProfiles.size(); ++i) {
- ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
- if (profileGenerator->origin() == origin && profileGenerator->title() == title)
- return;
- }
-
- exec->vm().setEnabledProfiler(this);
- RefPtr<ProfileGenerator> profileGenerator = ProfileGenerator::create(exec, title, ++ProfilesUID, stopwatch);
- m_currentProfiles.append(profileGenerator);
-}
-
-RefPtr<Profile> LegacyProfiler::stopProfiling(ExecState* exec, const String& title)
-{
- if (!exec)
- return nullptr;
-
- JSGlobalObject* origin = exec->lexicalGlobalObject();
- for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
- ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
- if (profileGenerator->origin() == origin && (title.isNull() || profileGenerator->title() == title)) {
- profileGenerator->stopProfiling();
- RefPtr<Profile> returnProfile = profileGenerator->profile();
-
- m_currentProfiles.remove(i);
- if (!m_currentProfiles.size())
- exec->vm().setEnabledProfiler(nullptr);
-
- return returnProfile;
- }
- }
-
- return nullptr;
-}
-
-void LegacyProfiler::stopProfiling(JSGlobalObject* origin)
-{
- for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
- ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
- if (profileGenerator->origin() == origin) {
- profileGenerator->stopProfiling();
- m_currentProfiles.remove(i);
- if (!m_currentProfiles.size())
- origin->vm().setEnabledProfiler(nullptr);
- }
- }
-}
-
-static inline void callFunctionForProfilesWithGroup(std::function<void(ProfileGenerator*)> callback, const Vector<RefPtr<ProfileGenerator>>& profiles, unsigned targetProfileGroup)
-{
- for (const RefPtr<ProfileGenerator>& profile : profiles) {
- if (profile->profileGroup() == targetProfileGroup || !profile->origin())
- callback(profile.get());
- }
-}
-
-void LegacyProfiler::suspendProfiling(JSC::ExecState* exec)
-{
- if (!exec)
- return;
-
- callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::setIsSuspended, std::placeholders::_1, true), m_currentProfiles, exec->lexicalGlobalObject()->profileGroup());
-}
-
-void LegacyProfiler::unsuspendProfiling(JSC::ExecState* exec)
-{
- if (!exec)
- return;
-
- callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::setIsSuspended, std::placeholders::_1, false), m_currentProfiles, exec->lexicalGlobalObject()->profileGroup());
-}
-
-void LegacyProfiler::willExecute(ExecState* callerCallFrame, JSValue function)
-{
- ASSERT(!m_currentProfiles.isEmpty());
-
- CallIdentifier callIdentifier = createCallIdentifier(callerCallFrame, function, StringImpl::empty(), 0, 0);
-
- callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::willExecute, std::placeholders::_1, callerCallFrame, callIdentifier), m_currentProfiles, callerCallFrame->lexicalGlobalObject()->profileGroup());
-}
-
-void LegacyProfiler::willExecute(ExecState* callerCallFrame, const String& sourceURL, unsigned startingLineNumber, unsigned startingColumnNumber)
-{
- ASSERT(!m_currentProfiles.isEmpty());
-
- CallIdentifier callIdentifier = createCallIdentifier(callerCallFrame, JSValue(), sourceURL, startingLineNumber, startingColumnNumber);
-
- callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::willExecute, std::placeholders::_1, callerCallFrame, callIdentifier), m_currentProfiles, callerCallFrame->lexicalGlobalObject()->profileGroup());
-}
-
-void LegacyProfiler::didExecute(ExecState* callerCallFrame, JSValue function)
-{
- ASSERT(!m_currentProfiles.isEmpty());
-
- CallIdentifier callIdentifier = createCallIdentifier(callerCallFrame, function, StringImpl::empty(), 0, 0);
-
- callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::didExecute, std::placeholders::_1, callerCallFrame, callIdentifier), m_currentProfiles, callerCallFrame->lexicalGlobalObject()->profileGroup());
-}
-
-void LegacyProfiler::didExecute(ExecState* callerCallFrame, const String& sourceURL, unsigned startingLineNumber, unsigned startingColumnNumber)
-{
- ASSERT(!m_currentProfiles.isEmpty());
-
- CallIdentifier callIdentifier = createCallIdentifier(callerCallFrame, JSValue(), sourceURL, startingLineNumber, startingColumnNumber);
-
- callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::didExecute, std::placeholders::_1, callerCallFrame, callIdentifier), m_currentProfiles, callerCallFrame->lexicalGlobalObject()->profileGroup());
-}
-
-void LegacyProfiler::exceptionUnwind(ExecState* handlerCallFrame)
-{
- ASSERT(!m_currentProfiles.isEmpty());
-
- CallIdentifier callIdentifier = createCallIdentifier(handlerCallFrame, JSValue(), StringImpl::empty(), 0, 0);
-
- callFunctionForProfilesWithGroup(std::bind(&ProfileGenerator::exceptionUnwind, std::placeholders::_1, handlerCallFrame, callIdentifier), m_currentProfiles, handlerCallFrame->lexicalGlobalObject()->profileGroup());
-}
-
-CallIdentifier LegacyProfiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const String& defaultSourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber)
-{
- if (!functionValue)
- return CallIdentifier(ASCIILiteral(GlobalCodeExecution), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
- if (!functionValue.isObject())
- return CallIdentifier(ASCIILiteral("(unknown)"), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
- if (asObject(functionValue)->inherits(JSFunction::info()) || asObject(functionValue)->inherits(InternalFunction::info()))
- return createCallIdentifierFromFunctionImp(exec, asObject(functionValue), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
- if (asObject(functionValue)->inherits(JSCallee::info()))
- return CallIdentifier(ASCIILiteral(GlobalCodeExecution), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
- return CallIdentifier(asObject(functionValue)->methodTable()->className(asObject(functionValue)), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
-}
-
-CallIdentifier createCallIdentifierFromFunctionImp(ExecState* exec, JSObject* function, const String& defaultSourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber)
-{
- const String& name = getCalculatedDisplayName(exec, function);
- JSFunction* jsFunction = jsDynamicCast<JSFunction*>(function);
- if (jsFunction && !jsFunction->isHostOrBuiltinFunction())
- return CallIdentifier(name.isEmpty() ? ASCIILiteral(AnonymousFunction) : name, jsFunction->jsExecutable()->sourceURL(), jsFunction->jsExecutable()->firstLine(), jsFunction->jsExecutable()->startColumn());
- return CallIdentifier(name.isEmpty() ? ASCIILiteral(AnonymousFunction) : name, defaultSourceURL, defaultLineNumber, defaultColumnNumber);
-}
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/profiler/LegacyProfiler.h b/Source/JavaScriptCore/profiler/LegacyProfiler.h
deleted file mode 100644
index af0ab41..0000000
--- a/Source/JavaScriptCore/profiler/LegacyProfiler.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2008, 2012, 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LegacyProfiler_h
-#define LegacyProfiler_h
-
-#include "Profile.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Stopwatch.h>
-#include <wtf/Vector.h>
-
-namespace JSC {
-
-class ExecState;
-class JSGlobalObject;
-class JSObject;
-class JSValue;
-class ProfileGenerator;
-struct CallIdentifier;
-
-class LegacyProfiler {
- WTF_MAKE_FAST_ALLOCATED;
-public:
- JS_EXPORT_PRIVATE static LegacyProfiler* profiler();
- static CallIdentifier createCallIdentifier(ExecState*, JSValue, const WTF::String& sourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber);
-
- JS_EXPORT_PRIVATE void startProfiling(ExecState*, const WTF::String& title, PassRefPtr<Stopwatch>);
- JS_EXPORT_PRIVATE RefPtr<Profile> stopProfiling(ExecState*, const WTF::String& title);
- void stopProfiling(JSGlobalObject*);
-
- // Used to ignore profile node subtrees rooted at InjectedScript calls.
- JS_EXPORT_PRIVATE void suspendProfiling(ExecState*);
- JS_EXPORT_PRIVATE void unsuspendProfiling(ExecState*);
-
- void willExecute(ExecState* callerCallFrame, JSValue function);
- void willExecute(ExecState* callerCallFrame, const WTF::String& sourceURL, unsigned startingLineNumber, unsigned startingColumnNumber);
- void didExecute(ExecState* callerCallFrame, JSValue function);
- void didExecute(ExecState* callerCallFrame, const WTF::String& sourceURL, unsigned startingLineNumber, unsigned startingColumnNumber);
-
- void exceptionUnwind(ExecState* handlerCallFrame);
-
- const Vector<RefPtr<ProfileGenerator>>& currentProfiles() { return m_currentProfiles; };
-
-private:
- Vector<RefPtr<ProfileGenerator>> m_currentProfiles;
- static LegacyProfiler* s_sharedLegacyProfiler;
-};
-
-} // namespace JSC
-
-#endif // LegacyProfiler_h
diff --git a/Source/JavaScriptCore/profiler/Profile.cpp b/Source/JavaScriptCore/profiler/Profile.cpp
deleted file mode 100644
index f3d450a..0000000
--- a/Source/JavaScriptCore/profiler/Profile.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (C) 2008, 2014 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Profile.h"
-
-#include "ProfileNode.h"
-#include <wtf/DataLog.h>
-
-namespace JSC {
-
-Ref<Profile> Profile::create(const String& title, unsigned uid, double startTime)
-{
- return adoptRef(*new Profile(title, uid, startTime));
-}
-
-Profile::Profile(const String& title, unsigned uid, double startTime)
- : m_title(title)
- , m_uid(uid)
-{
- // FIXME: When multi-threading is supported this will be a vector and calls
- // into the profiler will need to know which thread it is executing on.
- m_rootNode = ProfileNode::create(nullptr, CallIdentifier(ASCIILiteral("Thread_1"), String(), 0, 0), nullptr);
- m_rootNode->appendCall(ProfileNode::Call(startTime));
-}
-
-Profile::~Profile()
-{
-}
-
-#ifndef NDEBUG
-void Profile::debugPrint()
-{
- CalculateProfileSubtreeDataFunctor functor;
- m_rootNode->forEachNodePostorder(functor);
- ProfileNode::ProfileSubtreeData data = functor.returnValue();
-
- dataLogF("Call graph:\n");
- m_rootNode->debugPrintRecursively(0, data);
-}
-
-typedef WTF::KeyValuePair<FunctionCallHashCount::ValueType, unsigned> NameCountPair;
-
-static inline bool functionNameCountPairComparator(const NameCountPair& a, const NameCountPair& b)
-{
- return a.value > b.value;
-}
-
-void Profile::debugPrintSampleStyle()
-{
- typedef Vector<NameCountPair> NameCountPairVector;
-
- CalculateProfileSubtreeDataFunctor functor;
- m_rootNode->forEachNodePostorder(functor);
- ProfileNode::ProfileSubtreeData data = functor.returnValue();
-
- FunctionCallHashCount countedFunctions;
- dataLogF("Call graph:\n");
- m_rootNode->debugPrintSampleStyleRecursively(0, countedFunctions, data);
-
- dataLogF("\nTotal number in stack:\n");
- NameCountPairVector sortedFunctions(countedFunctions.size());
- copyToVector(countedFunctions, sortedFunctions);
-
- std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator);
- for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it)
- dataLogF(" %-12d%s\n", (*it).value, String((*it).key).utf8().data());
-
- dataLogF("\nSort by top of stack, same collapsed (when >= 5):\n");
-}
-#endif
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/profiler/Profile.h b/Source/JavaScriptCore/profiler/Profile.h
deleted file mode 100644
index 41cb670..0000000
--- a/Source/JavaScriptCore/profiler/Profile.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2008, 2014 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef Profile_h
-#define Profile_h
-
-#include "ProfileNode.h"
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/WTFString.h>
-
-namespace JSC {
-
-class JS_EXPORT_PRIVATE Profile : public RefCounted<Profile> {
-public:
- static Ref<Profile> create(const String& title, unsigned uid, double);
- virtual ~Profile();
-
- const String& title() const { return m_title; }
- unsigned uid() const { return m_uid; }
-
- ProfileNode* rootNode() const { return m_rootNode.get(); }
- void setRootNode(PassRefPtr<ProfileNode> rootNode) { m_rootNode = rootNode; }
-
-#ifndef NDEBUG
- void debugPrint();
- void debugPrintSampleStyle();
-#endif
-
-protected:
- Profile(const String& title, unsigned uid, double startTime);
-
-private:
- void removeProfileStart();
- void removeProfileEnd();
-
- String m_title;
- RefPtr<ProfileNode> m_rootNode;
- unsigned m_uid;
-};
-
-} // namespace JSC
-
-#endif // Profile_h
diff --git a/Source/JavaScriptCore/profiler/ProfileGenerator.cpp b/Source/JavaScriptCore/profiler/ProfileGenerator.cpp
deleted file mode 100644
index 25f8a43..0000000
--- a/Source/JavaScriptCore/profiler/ProfileGenerator.cpp
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright (C) 2008, 2014, 2016 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ProfileGenerator.h"
-
-#include "CallFrame.h"
-#include "CodeBlock.h"
-#include "JSGlobalObject.h"
-#include "JSStringRef.h"
-#include "JSFunction.h"
-#include "LegacyProfiler.h"
-#include "JSCInlines.h"
-#include "Profile.h"
-#include "StackVisitor.h"
-
-namespace JSC {
-
-Ref<ProfileGenerator> ProfileGenerator::create(ExecState* exec, const String& title, unsigned uid, PassRefPtr<Stopwatch> stopwatch)
-{
- return adoptRef(*new ProfileGenerator(exec, title, uid, stopwatch));
-}
-
-ProfileGenerator::ProfileGenerator(ExecState* exec, const String& title, unsigned uid, PassRefPtr<Stopwatch> stopwatch)
- : m_origin(exec ? exec->lexicalGlobalObject() : nullptr)
- , m_profileGroup(exec ? exec->lexicalGlobalObject()->profileGroup() : 0)
- , m_stopwatch(stopwatch)
- , m_foundConsoleStartParent(false)
- , m_suspended(false)
-{
- double startTime = m_stopwatch->elapsedTime();
- m_profile = Profile::create(title, uid, startTime);
- m_currentNode = m_rootNode = m_profile->rootNode();
- if (exec)
- addParentForConsoleStart(exec, startTime);
-}
-
-class AddParentForConsoleStartFunctor {
-public:
- AddParentForConsoleStartFunctor(ExecState* exec, RefPtr<ProfileNode>& rootNode, RefPtr<ProfileNode>& currentNode, double startTime)
- : m_exec(exec)
- , m_hasSkippedFirstFrame(false)
- , m_foundParent(false)
- , m_rootNode(rootNode)
- , m_currentNode(currentNode)
- , m_startTime(startTime)
- {
- }
-
- bool foundParent() const { return m_foundParent; }
-
- StackVisitor::Status operator()(StackVisitor& visitor) const
- {
- if (!m_hasSkippedFirstFrame) {
- m_hasSkippedFirstFrame = true;
- return StackVisitor::Continue;
- }
-
- unsigned line = 0;
- unsigned column = 0;
- visitor->computeLineAndColumn(line, column);
- m_currentNode = ProfileNode::create(m_exec, LegacyProfiler::createCallIdentifier(m_exec, visitor->callee(), visitor->sourceURL(), line, column), m_rootNode.get());
- m_currentNode->appendCall(ProfileNode::Call(m_startTime));
- m_rootNode->spliceNode(m_currentNode.get());
-
- m_foundParent = true;
- return StackVisitor::Done;
- }
-
-private:
- ExecState* m_exec;
- mutable bool m_hasSkippedFirstFrame;
- mutable bool m_foundParent;
- RefPtr<ProfileNode>& m_rootNode;
- RefPtr<ProfileNode>& m_currentNode;
- double m_startTime;
-};
-
-void ProfileGenerator::addParentForConsoleStart(ExecState* exec, double startTime)
-{
- AddParentForConsoleStartFunctor functor(exec, m_rootNode, m_currentNode, startTime);
- exec->iterate(functor);
-
- m_foundConsoleStartParent = functor.foundParent();
-}
-
-const String& ProfileGenerator::title() const
-{
- return m_profile->title();
-}
-
-void ProfileGenerator::beginCallEntry(ProfileNode* node, double startTime)
-{
- ASSERT_ARG(node, node);
-
- if (std::isnan(startTime))
- startTime = m_stopwatch->elapsedTime();
-
- node->appendCall(ProfileNode::Call(startTime));
-}
-
-void ProfileGenerator::endCallEntry(ProfileNode* node)
-{
- ASSERT_ARG(node, node);
-
- ProfileNode::Call& last = node->lastCall();
-
- double previousElapsedTime = std::isnan(last.elapsedTime()) ? 0.0 : last.elapsedTime();
- double newlyElapsedTime = m_stopwatch->elapsedTime() - last.startTime();
- last.setElapsedTime(previousElapsedTime + newlyElapsedTime);
-}
-
-void ProfileGenerator::willExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier)
-{
- if (!m_origin)
- return;
-
- if (m_suspended)
- return;
-
- RefPtr<ProfileNode> calleeNode = nullptr;
-
- // Find or create a node for the callee call frame.
- for (const RefPtr<ProfileNode>& child : m_currentNode->children()) {
- if (child->callIdentifier() == callIdentifier)
- calleeNode = child;
- }
-
- if (!calleeNode) {
- calleeNode = ProfileNode::create(callerCallFrame, callIdentifier, m_currentNode.get());
- m_currentNode->addChild(calleeNode);
- }
-
- m_currentNode = calleeNode;
- beginCallEntry(calleeNode.get(), m_stopwatch->elapsedTime());
-}
-
-void ProfileGenerator::didExecute(ExecState* callerCallFrame, const CallIdentifier& callIdentifier)
-{
- if (!m_origin)
- return;
-
- if (m_suspended)
- return;
-
- // Make a new node if the caller node has never seen this callee call frame before.
- // This can happen if |console.profile()| is called several frames deep in the call stack.
- ASSERT(m_currentNode);
- if (m_currentNode->callIdentifier() != callIdentifier) {
- RefPtr<ProfileNode> calleeNode = ProfileNode::create(callerCallFrame, callIdentifier, m_currentNode.get());
- beginCallEntry(calleeNode.get(), m_currentNode->lastCall().startTime());
- endCallEntry(calleeNode.get());
- m_currentNode->spliceNode(calleeNode.release());
- return;
- }
-
- endCallEntry(m_currentNode.get());
- m_currentNode = m_currentNode->parent();
-}
-
-void ProfileGenerator::exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&)
-{
- if (m_suspended)
- return;
-
- // If the current node was called by the handler (==) or any
- // more nested function (>) the we have exited early from it.
- ASSERT(m_currentNode);
- while (m_currentNode->callerCallFrame() >= handlerCallFrame) {
- didExecute(m_currentNode->callerCallFrame(), m_currentNode->callIdentifier());
- ASSERT(m_currentNode);
- }
-}
-
-void ProfileGenerator::stopProfiling()
-{
- for (ProfileNode* node = m_currentNode.get(); node != m_profile->rootNode(); node = node->parent())
- endCallEntry(node);
-
- if (m_foundConsoleStartParent) {
- removeProfileStart();
- removeProfileEnd();
- }
-
- ASSERT(m_currentNode);
-
- // Set the current node to the parent, because we are in a call that
- // will not get didExecute call.
- m_currentNode = m_currentNode->parent();
-}
-
-// The console.profile that started this ProfileGenerator will be the first child.
-void ProfileGenerator::removeProfileStart()
-{
- ProfileNode* currentNode = nullptr;
- for (ProfileNode* next = m_rootNode.get(); next; next = next->firstChild())
- currentNode = next;
-
- if (currentNode->callIdentifier().functionName() != "profile")
- return;
-
- currentNode->parent()->removeChild(currentNode);
-}
-
-// The console.profileEnd that stopped this ProfileGenerator will be the last child.
-void ProfileGenerator::removeProfileEnd()
-{
- ProfileNode* currentNode = nullptr;
- for (ProfileNode* next = m_rootNode.get(); next; next = next->lastChild())
- currentNode = next;
-
- if (currentNode->callIdentifier().functionName() != "profileEnd")
- return;
-
- ASSERT(currentNode->callIdentifier() == (currentNode->parent()->children()[currentNode->parent()->children().size() - 1])->callIdentifier());
- currentNode->parent()->removeChild(currentNode);
-}
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/profiler/ProfileGenerator.h b/Source/JavaScriptCore/profiler/ProfileGenerator.h
deleted file mode 100644
index 387ed5f..0000000
--- a/Source/JavaScriptCore/profiler/ProfileGenerator.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ProfileGenerator_h
-#define ProfileGenerator_h
-
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Stopwatch.h>
-#include <wtf/text/WTFString.h>
-
-namespace JSC {
-
- class DebuggerCallFrame;
- class ExecState;
- class JSGlobalObject;
- class Profile;
- class ProfileNode;
- struct CallIdentifier;
-
- class ProfileGenerator : public RefCounted<ProfileGenerator> {
- public:
- static Ref<ProfileGenerator> create(ExecState*, const WTF::String& title, unsigned uid, PassRefPtr<Stopwatch>);
-
- // Members
- const WTF::String& title() const;
- PassRefPtr<Profile> profile() const { return m_profile; }
- JSGlobalObject* origin() const { return m_origin; }
- unsigned profileGroup() const { return m_profileGroup; }
-
- void willExecute(ExecState* callerCallFrame, const CallIdentifier&);
- void didExecute(ExecState* callerCallFrame, const CallIdentifier&);
- void exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&);
-
- void setIsSuspended(bool suspended) { ASSERT(m_suspended != suspended); m_suspended = suspended; }
-
- void stopProfiling();
-
- private:
- ProfileGenerator(ExecState*, const WTF::String& title, unsigned uid, PassRefPtr<Stopwatch>);
- void addParentForConsoleStart(ExecState*, double);
-
- void removeProfileStart();
- void removeProfileEnd();
-
- void beginCallEntry(ProfileNode*, double startTime);
- void endCallEntry(ProfileNode*);
-
- RefPtr<Profile> m_profile;
- JSGlobalObject* m_origin;
- unsigned m_profileGroup;
- RefPtr<Stopwatch> m_stopwatch;
- RefPtr<ProfileNode> m_rootNode;
- RefPtr<ProfileNode> m_currentNode;
- bool m_foundConsoleStartParent;
- bool m_suspended;
- };
-
-} // namespace JSC
-
-#endif // ProfileGenerator_h
diff --git a/Source/JavaScriptCore/profiler/ProfileNode.cpp b/Source/JavaScriptCore/profiler/ProfileNode.cpp
deleted file mode 100644
index 9bcf375..0000000
--- a/Source/JavaScriptCore/profiler/ProfileNode.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2008, 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ProfileNode.h"
-
-#include "LegacyProfiler.h"
-#include <wtf/DateMath.h>
-#include <wtf/DataLog.h>
-#include <wtf/text/StringHash.h>
-
-using namespace WTF;
-
-namespace JSC {
-
-ProfileNode::ProfileNode(ExecState* callerCallFrame, const CallIdentifier& callIdentifier, ProfileNode* parentNode)
- : m_callerCallFrame(callerCallFrame)
- , m_callIdentifier(callIdentifier)
- , m_parent(parentNode)
-#ifndef NDEBUG
- , m_nextSibling(nullptr)
-#endif
-{
-}
-
-ProfileNode::ProfileNode(ExecState* callerCallFrame, ProfileNode* nodeToCopy)
- : m_callerCallFrame(callerCallFrame)
- , m_callIdentifier(nodeToCopy->callIdentifier())
- , m_parent(nodeToCopy->parent())
- , m_calls(nodeToCopy->calls())
-#ifndef NDEBUG
- , m_nextSibling(nullptr)
-#endif
-{
-}
-
-void ProfileNode::addChild(PassRefPtr<ProfileNode> prpChild)
-{
- RefPtr<ProfileNode> child = prpChild;
- child->setParent(this);
-#ifndef NDEBUG
- if (m_children.size())
- m_children.last()->setNextSibling(child.get());
-#endif
- m_children.append(child.release());
-}
-
-void ProfileNode::removeChild(ProfileNode* node)
-{
- if (!node)
- return;
-
- m_children.removeFirstMatching([node] (const RefPtr<ProfileNode>& current) {
- return *node == current.get();
- });
-
-#ifndef NDEBUG
- size_t size = m_children.size();
- for (size_t i = 0; i < size; ++i)
- m_children[i]->setNextSibling(i + 1 == size ? nullptr : m_children[i + 1].get());
-#endif
-}
-
-void ProfileNode::spliceNode(PassRefPtr<ProfileNode> prpNode)
-{
- RefPtr<ProfileNode> node = prpNode;
-
- for (unsigned i = 0; i < m_children.size(); ++i)
- node->addChild(m_children[i].release());
-
- m_children.clear();
- m_children.append(node.release());
-}
-
-#ifndef NDEBUG
-ProfileNode* ProfileNode::traverseNextNodePostOrder() const
-{
- ProfileNode* next = m_nextSibling;
- if (!next)
- return m_parent;
- while (ProfileNode* firstChild = next->firstChild())
- next = firstChild;
- return next;
-}
-
-void ProfileNode::debugPrint()
-{
- CalculateProfileSubtreeDataFunctor functor;
- forEachNodePostorder(functor);
- ProfileNode::ProfileSubtreeData data = functor.returnValue();
-
- debugPrintRecursively(0, data);
-}
-
-void ProfileNode::debugPrintSampleStyle()
-{
- FunctionCallHashCount countedFunctions;
-
- CalculateProfileSubtreeDataFunctor functor;
- forEachNodePostorder(functor);
- ProfileNode::ProfileSubtreeData data = functor.returnValue();
-
- debugPrintSampleStyleRecursively(0, countedFunctions, data);
-}
-
-void ProfileNode::debugPrintRecursively(int indentLevel, const ProfileSubtreeData& data)
-{
- // Print function names
- for (int i = 0; i < indentLevel; ++i)
- dataLogF(" ");
-
- auto it = data.selfAndTotalTimes.find(this);
- ASSERT(it != data.selfAndTotalTimes.end());
-
- double nodeSelfTime = it->value.first;
- double nodeTotalTime = it->value.second;
- double rootTotalTime = data.rootTotalTime;
-
- dataLogF("Function Name %s %zu SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% Next Sibling %s\n",
- functionName().utf8().data(),
- m_calls.size(), nodeSelfTime, nodeSelfTime / rootTotalTime * 100.0, nodeTotalTime, nodeTotalTime / rootTotalTime * 100.0,
- m_nextSibling ? m_nextSibling->functionName().utf8().data() : "");
-
- ++indentLevel;
-
- // Print children's names and information
- for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild)
- (*currentChild)->debugPrintRecursively(indentLevel, data);
-}
-
-// print the profiled data in a format that matches the tool sample's output.
-double ProfileNode::debugPrintSampleStyleRecursively(int indentLevel, FunctionCallHashCount& countedFunctions, const ProfileSubtreeData& data)
-{
- dataLogF(" ");
-
- auto it = data.selfAndTotalTimes.find(this);
- ASSERT(it != data.selfAndTotalTimes.end());
- double nodeTotalTime = it->value.second;
-
- // Print function names
- const char* name = functionName().utf8().data();
- double sampleCount = nodeTotalTime * 1000;
- if (indentLevel) {
- for (int i = 0; i < indentLevel; ++i)
- dataLogF(" ");
-
- countedFunctions.add(functionName().impl());
-
- dataLogF("%.0f %s\n", sampleCount ? sampleCount : 1, name);
- } else
- dataLogF("%s\n", name);
-
- ++indentLevel;
-
- // Print children's names and information
- double sumOfChildrensCount = 0.0;
- for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild)
- sumOfChildrensCount += (*currentChild)->debugPrintSampleStyleRecursively(indentLevel, countedFunctions, data);
-
- sumOfChildrensCount *= 1000; //
- // Print remainder of samples to match sample's output
- if (sumOfChildrensCount < sampleCount) {
- dataLogF(" ");
- while (indentLevel--)
- dataLogF(" ");
-
- dataLogF("%.0f %s\n", sampleCount - sumOfChildrensCount, functionName().utf8().data());
- }
-
- return nodeTotalTime;
-}
-#endif
-
-} // namespace JSC
diff --git a/Source/JavaScriptCore/profiler/ProfileNode.h b/Source/JavaScriptCore/profiler/ProfileNode.h
deleted file mode 100644
index 7ad149e..0000000
--- a/Source/JavaScriptCore/profiler/ProfileNode.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Copyright (C) 2008, 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ProfileNode_h
-#define ProfileNode_h
-
-#include "CallIdentifier.h"
-#include <wtf/HashCountedSet.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-
-namespace JSC {
-
- class ExecState;
- class ProfileNode;
-
- typedef HashCountedSet<StringImpl*> FunctionCallHashCount;
-
- class ProfileNode : public RefCounted<ProfileNode> {
- public:
- static Ref<ProfileNode> create(ExecState* callerCallFrame, const CallIdentifier& callIdentifier, ProfileNode* parentNode)
- {
- return adoptRef(*new ProfileNode(callerCallFrame, callIdentifier, parentNode));
- }
-
- static Ref<ProfileNode> create(ExecState* callerCallFrame, ProfileNode* node)
- {
- return adoptRef(*new ProfileNode(callerCallFrame, node));
- }
-
- struct Call {
- public:
- Call(double startTime, double elapsedTime = NAN)
- : m_startTime(startTime)
- , m_elapsedTime(elapsedTime)
- {
- }
-
- double startTime() const { return m_startTime; }
- void setStartTime(double time)
- {
- ASSERT_ARG(time, time >= 0.0 || std::isnan(time));
- m_startTime = time;
- }
-
- double elapsedTime() const { return m_elapsedTime; }
- void setElapsedTime(double time)
- {
- ASSERT_ARG(time, time >= 0.0 || std::isnan(time));
- m_elapsedTime = time;
- }
-
- private:
- double m_startTime;
- double m_elapsedTime;
- };
-
- bool operator==(ProfileNode* node) { return m_callIdentifier == node->callIdentifier(); }
-
- ExecState* callerCallFrame() const { return m_callerCallFrame; }
- const CallIdentifier& callIdentifier() const { return m_callIdentifier; }
- unsigned id() const { return m_callIdentifier.hash(); }
- const String& functionName() const { return m_callIdentifier.functionName(); }
- const String& url() const { return m_callIdentifier.url(); }
- unsigned lineNumber() const { return m_callIdentifier.lineNumber(); }
- unsigned columnNumber() const { return m_callIdentifier.columnNumber(); }
-
- ProfileNode* parent() const { return m_parent; }
- void setParent(ProfileNode* parent) { m_parent = parent; }
-
- const Vector<Call>& calls() const { return m_calls; }
- Call& lastCall() { ASSERT(!m_calls.isEmpty()); return m_calls.last(); }
- void appendCall(Call call) { m_calls.append(call); }
-
- const Vector<RefPtr<ProfileNode>>& children() const { return m_children; }
- ProfileNode* firstChild() const { return m_children.size() ? m_children.first().get() : nullptr; }
- ProfileNode* lastChild() const { return m_children.size() ? m_children.last().get() : nullptr; }
-
- void removeChild(ProfileNode*);
- void addChild(PassRefPtr<ProfileNode>);
- // Reparent our child nodes to the passed node, and make it a child node of |this|.
- void spliceNode(PassRefPtr<ProfileNode>);
-
-#ifndef NDEBUG
- struct ProfileSubtreeData {
- HashMap<ProfileNode*, std::pair<double, double>> selfAndTotalTimes;
- double rootTotalTime;
- };
-
- // Use these functions to dump the subtree rooted at this node.
- void debugPrint();
- void debugPrintSampleStyle();
-
- // These are used to recursively print entire subtrees using precomputed self and total times.
- template <typename Functor> void forEachNodePostorder(Functor&);
-
- void debugPrintRecursively(int indentLevel, const ProfileSubtreeData&);
- double debugPrintSampleStyleRecursively(int indentLevel, FunctionCallHashCount&, const ProfileSubtreeData&);
-#endif
-
- private:
- typedef Vector<RefPtr<ProfileNode>>::const_iterator StackIterator;
-
- ProfileNode(ExecState* callerCallFrame, const CallIdentifier&, ProfileNode* parentNode);
- ProfileNode(ExecState* callerCallFrame, ProfileNode* nodeToCopy);
-
-#ifndef NDEBUG
- ProfileNode* nextSibling() const { return m_nextSibling; }
- void setNextSibling(ProfileNode* nextSibling) { m_nextSibling = nextSibling; }
-
- ProfileNode* traverseNextNodePostOrder() const;
-#endif
-
- ExecState* m_callerCallFrame;
- CallIdentifier m_callIdentifier;
- ProfileNode* m_parent;
- Vector<Call> m_calls;
- Vector<RefPtr<ProfileNode>> m_children;
-
-#ifndef NDEBUG
- ProfileNode* m_nextSibling;
-#endif
- };
-
-#ifndef NDEBUG
- template <typename Functor> inline void ProfileNode::forEachNodePostorder(Functor& functor)
- {
- ProfileNode* currentNode = this;
- // Go down to the first node of the traversal, and slowly walk back up.
- for (ProfileNode* nextNode = currentNode; nextNode; nextNode = nextNode->firstChild())
- currentNode = nextNode;
-
- ProfileNode* endNode = this;
- while (currentNode && currentNode != endNode) {
- functor(currentNode);
- currentNode = currentNode->traverseNextNodePostOrder();
- }
-
- functor(endNode);
- }
-
- struct CalculateProfileSubtreeDataFunctor {
- void operator()(ProfileNode* node)
- {
- double selfTime = 0.0;
- for (const ProfileNode::Call& call : node->calls())
- selfTime += call.elapsedTime();
-
- double totalTime = selfTime;
- for (RefPtr<ProfileNode> child : node->children()) {
- auto it = m_data.selfAndTotalTimes.find(child.get());
- if (it != m_data.selfAndTotalTimes.end())
- totalTime += it->value.second;
- }
-
- ASSERT(node);
- m_data.selfAndTotalTimes.set(node, std::make_pair(selfTime, totalTime));
- }
-
- ProfileNode::ProfileSubtreeData returnValue() { return WTFMove(m_data); }
-
- ProfileNode::ProfileSubtreeData m_data;
- };
-#endif
-
-} // namespace JSC
-
-#endif // ProfileNode_h
diff --git a/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp b/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp
index 3068ff3..3751fed 100644
--- a/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp
+++ b/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp
@@ -47,9 +47,6 @@
case JettisonDueToDebuggerStepping:
out.print("DebuggerStepping");
return;
- case JettisonDueToLegacyProfiler:
- out.print("LegacyProfiler");
- return;
case JettisonDueToBaselineLoopReoptimizationTrigger:
out.print("BaselineLoopReoptimizationTrigger");
return;
diff --git a/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h b/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h
index 6a79326..5300a20 100644
--- a/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h
+++ b/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h
@@ -33,7 +33,6 @@
JettisonDueToWeakReference,
JettisonDueToDebuggerBreakpoint,
JettisonDueToDebuggerStepping,
- JettisonDueToLegacyProfiler,
JettisonDueToBaselineLoopReoptimizationTrigger,
JettisonDueToBaselineLoopReoptimizationTriggerOnOSREntryFail,
JettisonDueToOSRExit,
diff --git a/Source/JavaScriptCore/runtime/CodeCache.cpp b/Source/JavaScriptCore/runtime/CodeCache.cpp
index 0b65797..d004f37 100644
--- a/Source/JavaScriptCore/runtime/CodeCache.cpp
+++ b/Source/JavaScriptCore/runtime/CodeCache.cpp
@@ -81,13 +81,13 @@
};
template <class UnlinkedCodeBlockType, class ExecutableType>
-UnlinkedCodeBlockType* CodeCache::getGlobalCodeBlock(VM& vm, ExecutableType* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, ThisTDZMode thisTDZMode, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
+UnlinkedCodeBlockType* CodeCache::getGlobalCodeBlock(VM& vm, ExecutableType* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, ThisTDZMode thisTDZMode, DebuggerMode debuggerMode, ParserError& error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
{
SourceCodeKey key = SourceCodeKey(source, String(), CacheTypes<UnlinkedCodeBlockType>::codeType, builtinMode, strictMode, thisTDZMode);
SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key);
// FIXME: We should do something smart for TDZ instead of just disabling caching.
// https://bugs.webkit.org/show_bug.cgi?id=154010
- bool canCache = debuggerMode == DebuggerOff && profilerMode == ProfilerOff && !vm.typeProfiler() && !vm.controlFlowProfiler() && !variablesUnderTDZ->size();
+ bool canCache = debuggerMode == DebuggerOff && !vm.typeProfiler() && !vm.controlFlowProfiler() && !variablesUnderTDZ->size();
if (cache && canCache) {
UnlinkedCodeBlockType* unlinkedCodeBlock = jsCast<UnlinkedCodeBlockType*>(cache->cell.get());
unsigned firstLine = source.firstLine() + unlinkedCodeBlock->firstLine();
@@ -120,7 +120,7 @@
unlinkedCodeBlock->setSourceURLDirective(source.provider()->sourceURL());
unlinkedCodeBlock->setSourceMappingURLDirective(source.provider()->sourceMappingURL());
- error = BytecodeGenerator::generate(vm, rootNode.get(), unlinkedCodeBlock, debuggerMode, profilerMode, variablesUnderTDZ);
+ error = BytecodeGenerator::generate(vm, rootNode.get(), unlinkedCodeBlock, debuggerMode, variablesUnderTDZ);
if (error.isValid())
return nullptr;
@@ -132,21 +132,21 @@
return unlinkedCodeBlock;
}
-UnlinkedProgramCodeBlock* CodeCache::getProgramCodeBlock(VM& vm, ProgramExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error)
+UnlinkedProgramCodeBlock* CodeCache::getProgramCodeBlock(VM& vm, ProgramExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError& error)
{
VariableEnvironment emptyParentTDZVariables;
- return getGlobalCodeBlock<UnlinkedProgramCodeBlock>(vm, executable, source, builtinMode, strictMode, ThisTDZMode::CheckIfNeeded, debuggerMode, profilerMode, error, EvalContextType::None, &emptyParentTDZVariables);
+ return getGlobalCodeBlock<UnlinkedProgramCodeBlock>(vm, executable, source, builtinMode, strictMode, ThisTDZMode::CheckIfNeeded, debuggerMode, error, EvalContextType::None, &emptyParentTDZVariables);
}
-UnlinkedEvalCodeBlock* CodeCache::getEvalCodeBlock(VM& vm, EvalExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, ThisTDZMode thisTDZMode, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
+UnlinkedEvalCodeBlock* CodeCache::getEvalCodeBlock(VM& vm, EvalExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, ThisTDZMode thisTDZMode, DebuggerMode debuggerMode, ParserError& error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
{
- return getGlobalCodeBlock<UnlinkedEvalCodeBlock>(vm, executable, source, builtinMode, strictMode, thisTDZMode, debuggerMode, profilerMode, error, evalContextType, variablesUnderTDZ);
+ return getGlobalCodeBlock<UnlinkedEvalCodeBlock>(vm, executable, source, builtinMode, strictMode, thisTDZMode, debuggerMode, error, evalContextType, variablesUnderTDZ);
}
-UnlinkedModuleProgramCodeBlock* CodeCache::getModuleProgramCodeBlock(VM& vm, ModuleProgramExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError& error)
+UnlinkedModuleProgramCodeBlock* CodeCache::getModuleProgramCodeBlock(VM& vm, ModuleProgramExecutable* executable, const SourceCode& source, JSParserBuiltinMode builtinMode, DebuggerMode debuggerMode, ParserError& error)
{
VariableEnvironment emptyParentTDZVariables;
- return getGlobalCodeBlock<UnlinkedModuleProgramCodeBlock>(vm, executable, source, builtinMode, JSParserStrictMode::Strict, ThisTDZMode::CheckIfNeeded, debuggerMode, profilerMode, error, EvalContextType::None, &emptyParentTDZVariables);
+ return getGlobalCodeBlock<UnlinkedModuleProgramCodeBlock>(vm, executable, source, builtinMode, JSParserStrictMode::Strict, ThisTDZMode::CheckIfNeeded, debuggerMode, error, EvalContextType::None, &emptyParentTDZVariables);
}
// FIXME: There's no need to add the function's name to the key here. It's already in the source code.
diff --git a/Source/JavaScriptCore/runtime/CodeCache.h b/Source/JavaScriptCore/runtime/CodeCache.h
index e5e211b..0070d90 100644
--- a/Source/JavaScriptCore/runtime/CodeCache.h
+++ b/Source/JavaScriptCore/runtime/CodeCache.h
@@ -187,9 +187,9 @@
CodeCache();
~CodeCache();
- UnlinkedProgramCodeBlock* getProgramCodeBlock(VM&, ProgramExecutable*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ProfilerMode, ParserError&);
- UnlinkedEvalCodeBlock* getEvalCodeBlock(VM&, EvalExecutable*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, ThisTDZMode, DebuggerMode, ProfilerMode, ParserError&, EvalContextType, const VariableEnvironment*);
- UnlinkedModuleProgramCodeBlock* getModuleProgramCodeBlock(VM&, ModuleProgramExecutable*, const SourceCode&, JSParserBuiltinMode, DebuggerMode, ProfilerMode, ParserError&);
+ UnlinkedProgramCodeBlock* getProgramCodeBlock(VM&, ProgramExecutable*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ParserError&);
+ UnlinkedEvalCodeBlock* getEvalCodeBlock(VM&, EvalExecutable*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, ThisTDZMode, DebuggerMode, ParserError&, EvalContextType, const VariableEnvironment*);
+ UnlinkedModuleProgramCodeBlock* getModuleProgramCodeBlock(VM&, ModuleProgramExecutable*, const SourceCode&, JSParserBuiltinMode, DebuggerMode, ParserError&);
UnlinkedFunctionExecutable* getFunctionExecutableFromGlobalCode(VM&, const Identifier&, const SourceCode&, ParserError&);
void clear()
@@ -199,7 +199,7 @@
private:
template <class UnlinkedCodeBlockType, class ExecutableType>
- UnlinkedCodeBlockType* getGlobalCodeBlock(VM&, ExecutableType*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, ThisTDZMode, DebuggerMode, ProfilerMode, ParserError&, EvalContextType, const VariableEnvironment*);
+ UnlinkedCodeBlockType* getGlobalCodeBlock(VM&, ExecutableType*, const SourceCode&, JSParserBuiltinMode, JSParserStrictMode, ThisTDZMode, DebuggerMode, ParserError&, EvalContextType, const VariableEnvironment*);
CodeCacheMap m_sourceCode;
};
diff --git a/Source/JavaScriptCore/runtime/Executable.cpp b/Source/JavaScriptCore/runtime/Executable.cpp
index 9195d55..9fcddf4 100644
--- a/Source/JavaScriptCore/runtime/Executable.cpp
+++ b/Source/JavaScriptCore/runtime/Executable.cpp
@@ -312,10 +312,9 @@
JSGlobalObject* globalObject = scope->globalObject();
ParserError error;
DebuggerMode debuggerMode = globalObject->hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
- ProfilerMode profilerMode = globalObject->hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
UnlinkedFunctionCodeBlock* unlinkedCodeBlock =
executable->m_unlinkedExecutable->unlinkedCodeBlockFor(
- *vm, executable->m_source, kind, debuggerMode, profilerMode, error,
+ *vm, executable->m_source, kind, debuggerMode, error,
executable->parseMode());
recordParse(
executable->m_unlinkedExecutable->features(),
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
index dd35cae..0d3715e 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -112,7 +112,6 @@
#include "JSWithScope.h"
#include "LazyClassStructureInlines.h"
#include "LazyPropertyInlines.h"
-#include "LegacyProfiler.h"
#include "Lookup.h"
#include "MapConstructor.h"
#include "MapIteratorPrototype.h"
@@ -297,9 +296,6 @@
if (m_debugger)
m_debugger->detach(this, Debugger::GlobalObjectIsDestructing);
-
- if (LegacyProfiler* profiler = vm().enabledProfiler())
- profiler->stopProfiling(this);
}
void JSGlobalObject::destroy(JSCell* cell)
@@ -831,12 +827,6 @@
resetPrototype(vm, getPrototypeDirect());
}
-bool JSGlobalObject::hasLegacyProfiler() const
-{
- // FIXME: Remove Legacy Profiler from JavaScriptCore.
- return false;
-}
-
bool JSGlobalObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(cell);
@@ -1226,10 +1216,9 @@
ParserError error;
JSParserStrictMode strictMode = executable->isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
- ProfilerMode profilerMode = hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
UnlinkedProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()->getProgramCodeBlock(
vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, strictMode,
- debuggerMode, profilerMode, error);
+ debuggerMode, error);
if (hasDebugger())
debugger()->sourceParsed(callFrame, executable->source().provider(), error.line(), error.message());
@@ -1249,9 +1238,8 @@
DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
EvalContextType evalContextType = executable->executableInfo().evalContextType();
- ProfilerMode profilerMode = hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
UnlinkedEvalCodeBlock* unlinkedCodeBlock = vm().codeCache()->getEvalCodeBlock(
- vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, strictMode, thisTDZMode, debuggerMode, profilerMode, error, evalContextType, variablesUnderTDZ);
+ vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, strictMode, thisTDZMode, debuggerMode, error, evalContextType, variablesUnderTDZ);
if (hasDebugger())
debugger()->sourceParsed(callFrame, executable->source().provider(), error.line(), error.message());
@@ -1268,9 +1256,8 @@
{
ParserError error;
DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
- ProfilerMode profilerMode = hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
UnlinkedModuleProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()->getModuleProgramCodeBlock(
- vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, debuggerMode, profilerMode, error);
+ vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, debuggerMode, error);
if (hasDebugger())
debugger()->sourceParsed(callFrame, executable->source().provider(), error.line(), error.message());
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h
index 8c0e790..96aecec 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.h
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h
@@ -404,7 +404,6 @@
bool hasDebugger() const;
bool hasInteractiveDebugger() const;
- bool hasLegacyProfiler() const;
const RuntimeFlags& runtimeFlags() const { return m_runtimeFlags; }
protected:
diff --git a/Source/JavaScriptCore/runtime/Options.h b/Source/JavaScriptCore/runtime/Options.h
index c754e81..dab35d0 100644
--- a/Source/JavaScriptCore/runtime/Options.h
+++ b/Source/JavaScriptCore/runtime/Options.h
@@ -131,7 +131,6 @@
v(bool, dumpBytecodeLivenessResults, false, Normal, nullptr) \
v(bool, validateBytecode, false, Normal, nullptr) \
v(bool, forceDebuggerBytecodeGeneration, false, Normal, nullptr) \
- v(bool, forceProfilerBytecodeGeneration, false, Normal, nullptr) \
\
v(bool, useFunctionDotArguments, true, Normal, nullptr) \
v(bool, useTailCalls, true, Normal, nullptr) \
diff --git a/Source/JavaScriptCore/runtime/VM.cpp b/Source/JavaScriptCore/runtime/VM.cpp
index 1b76cc6..a4d3feb 100644
--- a/Source/JavaScriptCore/runtime/VM.cpp
+++ b/Source/JavaScriptCore/runtime/VM.cpp
@@ -190,7 +190,6 @@
#endif
, m_inDefineOwnProperty(false)
, m_codeCache(std::make_unique<CodeCache>())
- , m_enabledProfiler(nullptr)
, m_builtinExecutables(std::make_unique<BuiltinExecutables>(*this))
, m_typeProfilerEnabledCount(0)
, m_controlFlowProfilerEnabledCount(0)
@@ -753,25 +752,6 @@
watchpointSet->fireAll("Impure property added");
}
-class SetEnabledProfilerFunctor {
-public:
- bool operator()(CodeBlock* codeBlock) const
- {
- if (JITCode::isOptimizingJIT(codeBlock->jitType()))
- codeBlock->jettison(Profiler::JettisonDueToLegacyProfiler);
- return false;
- }
-};
-
-void VM::setEnabledProfiler(LegacyProfiler* profiler)
-{
- m_enabledProfiler = profiler;
- if (m_enabledProfiler) {
- SetEnabledProfilerFunctor functor;
- heap.forEachCodeBlock(functor);
- }
-}
-
static bool enableProfilerWithRespectToCount(unsigned& counter, std::function<void()> doEnableWork)
{
bool needsToRecompile = false;
diff --git a/Source/JavaScriptCore/runtime/VM.h b/Source/JavaScriptCore/runtime/VM.h
index c40dbd7..85581b6 100644
--- a/Source/JavaScriptCore/runtime/VM.h
+++ b/Source/JavaScriptCore/runtime/VM.h
@@ -92,7 +92,6 @@
class JSGlobalObject;
class JSObject;
class LLIntOffsetsExtractor;
-class LegacyProfiler;
class NativeExecutable;
class RegExpCache;
class RegisterAtOffsetList;
@@ -355,11 +354,6 @@
return m_inDefineOwnProperty;
}
- LegacyProfiler* enabledProfiler() { return m_enabledProfiler; }
- void setEnabledProfiler(LegacyProfiler*);
-
- void* enabledProfilerAddress() { return &m_enabledProfiler; }
-
#if ENABLE(JIT)
bool canUseJIT() { return m_canUseJIT; }
#else
@@ -648,7 +642,6 @@
bool m_globalConstRedeclarationShouldThrow { true };
bool m_shouldBuildPCToCodeOriginMapping { false };
std::unique_ptr<CodeCache> m_codeCache;
- LegacyProfiler* m_enabledProfiler;
std::unique_ptr<BuiltinExecutables> m_builtinExecutables;
HashMap<String, RefPtr<WatchpointSet>> m_impurePropertyWatchpointSets;
std::unique_ptr<TypeProfiler> m_typeProfiler;