Changeset 48662 in webkit for trunk/JavaScriptCore/runtime/Executable.h
- Timestamp:
- Sep 22, 2009, 5:40:58 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/Executable.h
r47775 r48662 28 28 29 29 #include "JSFunction.h" 30 #include "Interpreter.h" 30 31 #include "Nodes.h" 32 #include "SamplingTool.h" 31 33 32 34 namespace JSC { … … 103 105 class ScriptExecutable : public ExecutableBase { 104 106 public: 105 ScriptExecutable( const SourceCode& source)107 ScriptExecutable(JSGlobalData* globalData, const SourceCode& source) 106 108 : ExecutableBase(NUM_PARAMETERS_NOT_COMPILED) 107 109 , m_source(source) 108 110 , m_features(0) 109 111 { 112 #if ENABLE(CODEBLOCK_SAMPLING) 113 if (SamplingTool* sampler = globalData->interpreter->sampler()) 114 sampler->notifyOfScope(this); 115 #else 116 UNUSED_PARAM(globalData); 117 #endif 118 } 119 120 ScriptExecutable(ExecState* exec, const SourceCode& source) 121 : ExecutableBase(NUM_PARAMETERS_NOT_COMPILED) 122 , m_source(source) 123 , m_features(0) 124 { 125 #if ENABLE(CODEBLOCK_SAMPLING) 126 if (SamplingTool* sampler = exec->globalData().interpreter->sampler()) 127 sampler->notifyOfScope(this); 128 #else 129 UNUSED_PARAM(exec); 130 #endif 110 131 } 111 132 … … 138 159 class EvalExecutable : public ScriptExecutable { 139 160 public: 140 EvalExecutable( const SourceCode& source)141 : ScriptExecutable( source)161 EvalExecutable(ExecState* exec, const SourceCode& source) 162 : ScriptExecutable(exec, source) 142 163 , m_evalCodeBlock(0) 143 164 { … … 158 179 159 180 ExceptionInfo* reparseExceptionInfo(JSGlobalData*, ScopeChainNode*, CodeBlock*); 160 static PassRefPtr<EvalExecutable> create( const SourceCode& source) { return adoptRef(new EvalExecutable(source)); }181 static PassRefPtr<EvalExecutable> create(ExecState* exec, const SourceCode& source) { return adoptRef(new EvalExecutable(exec, source)); } 161 182 162 183 private: … … 179 200 class ProgramExecutable : public ScriptExecutable { 180 201 public: 181 ProgramExecutable( const SourceCode& source)182 : ScriptExecutable( source)202 ProgramExecutable(ExecState* exec, const SourceCode& source) 203 : ScriptExecutable(exec, source) 183 204 , m_programCodeBlock(0) 184 205 { … … 222 243 friend class JIT; 223 244 public: 224 static PassRefPtr<FunctionExecutable> create(const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine) 225 { 226 return adoptRef(new FunctionExecutable(name, source, forceUsesArguments, parameters, firstLine, lastLine)); 245 static PassRefPtr<FunctionExecutable> create(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine) 246 { 247 return adoptRef(new FunctionExecutable(exec, name, source, forceUsesArguments, parameters, firstLine, lastLine)); 248 } 249 250 static PassRefPtr<FunctionExecutable> create(JSGlobalData* globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine) 251 { 252 return adoptRef(new FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, firstLine, lastLine)); 227 253 } 228 254 … … 264 290 265 291 private: 266 FunctionExecutable( const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine)267 : ScriptExecutable( source)292 FunctionExecutable(JSGlobalData* globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine) 293 : ScriptExecutable(globalData, source) 268 294 , m_forceUsesArguments(forceUsesArguments) 269 295 , m_parameters(parameters) … … 276 302 } 277 303 304 FunctionExecutable(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, int firstLine, int lastLine) 305 : ScriptExecutable(exec, source) 306 , m_forceUsesArguments(forceUsesArguments) 307 , m_parameters(parameters) 308 , m_codeBlock(0) 309 , m_name(name) 310 , m_numVariables(0) 311 { 312 m_firstLine = firstLine; 313 m_lastLine = lastLine; 314 } 315 278 316 void compile(ExecState*, ScopeChainNode*); 279 317
Note:
See TracChangeset
for help on using the changeset viewer.