X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63..1df5f87f1309a8daa30dabdee855f48ae40d14ab:/bytecode/SamplingTool.h diff --git a/bytecode/SamplingTool.h b/bytecode/SamplingTool.h index 8e3ed9e..1d77b31 100644 --- a/bytecode/SamplingTool.h +++ b/bytecode/SamplingTool.h @@ -29,19 +29,18 @@ #ifndef SamplingTool_h #define SamplingTool_h +#include "Strong.h" +#include "Nodes.h" +#include "Opcode.h" #include #include #include -#include "Nodes.h" -#include "Opcode.h" - namespace JSC { class ScriptExecutable; class SamplingFlags { - friend class JIT; public: static void start(); static void stop(); @@ -80,6 +79,11 @@ namespace JSC { int m_flag; }; + static const void* addressOfFlags() + { + return &s_flags; + } + #endif private: static uint32_t s_flags; @@ -95,8 +99,8 @@ namespace JSC { struct Instruction; struct ScriptSampleRecord { - ScriptSampleRecord(ScriptExecutable* executable) - : m_executable(executable) + ScriptSampleRecord(JSGlobalData& globalData, ScriptExecutable* executable) + : m_executable(globalData, executable) , m_codeBlock(0) , m_sampleCount(0) , m_opcodeSampleCount(0) @@ -113,7 +117,7 @@ namespace JSC { void sample(CodeBlock*, Instruction*); - RefPtr m_executable; + Strong m_executable; CodeBlock* m_codeBlock; int m_sampleCount; int m_opcodeSampleCount; @@ -142,7 +146,8 @@ namespace JSC { friend class HostCallRecord; #if ENABLE(OPCODE_SAMPLING) - class CallRecord : public Noncopyable { + class CallRecord { + WTF_MAKE_NONCOPYABLE(CallRecord); public: CallRecord(SamplingTool* samplingTool) : m_samplingTool(samplingTool) @@ -172,7 +177,8 @@ namespace JSC { } }; #else - class CallRecord : public Noncopyable { + class CallRecord { + WTF_MAKE_NONCOPYABLE(CallRecord); public: CallRecord(SamplingTool*) { @@ -278,7 +284,6 @@ namespace JSC { // Implements a named set of counters, printed on exit if ENABLE(SAMPLING_COUNTERS). // See subclasses below, SamplingCounter, GlobalSamplingCounter and DeletableSamplingCounter. class AbstractSamplingCounter { - friend class JIT; friend class DeletableSamplingCounter; public: void count(uint32_t count = 1) @@ -288,6 +293,8 @@ namespace JSC { static void dump(); + int64_t* addressOfCounter() { return &m_counter; } + protected: // Effectively the contructor, however called lazily in the case of GlobalSamplingCounter. void init(const char* name)