Changeset 91194 in webkit for trunk/Source/JavaScriptCore/runtime/Executable.h
- Timestamp:
- Jul 18, 2011, 10:47:13 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Executable.h
r90938 r91194 53 53 static const int NUM_PARAMETERS_IS_HOST = 0; 54 54 static const int NUM_PARAMETERS_NOT_COMPILED = -1; 55 56 p ublic:55 56 protected: 57 57 ExecutableBase(JSGlobalData& globalData, Structure* structure, int numParameters) 58 58 : JSCell(globalData, structure) … … 64 64 finalizer.leakHandle(); 65 65 #endif 66 } 67 68 public: 69 static ExecutableBase* create(JSGlobalData& globalData, Structure* structure, int numParameters) 70 { 71 return new (allocateCell<ExecutableBase>(globalData.heap)) ExecutableBase(globalData, structure, numParameters); 66 72 } 67 73 … … 167 173 { 168 174 if (!callThunk) 169 return new ( &globalData) NativeExecutable(globalData, JITCode(), function, JITCode(), constructor);170 return new ( &globalData) NativeExecutable(globalData, JITCode::HostFunction(callThunk), function, JITCode::HostFunction(constructThunk), constructor);175 return new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, JITCode(), function, JITCode(), constructor); 176 return new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, JITCode::HostFunction(callThunk), function, JITCode::HostFunction(constructThunk), constructor); 171 177 } 172 178 #else 173 179 static NativeExecutable* create(JSGlobalData& globalData, NativeFunction function, NativeFunction constructor) 174 180 { 175 return new ( &globalData) NativeExecutable(globalData, function, constructor);181 return new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor); 176 182 } 177 183 #endif … … 214 220 class ScriptExecutable : public ExecutableBase { 215 221 public: 216 ScriptExecutable(Structure* structure, JSGlobalData *globalData, const SourceCode& source, bool isInStrictContext)217 : ExecutableBase( *globalData, structure, NUM_PARAMETERS_NOT_COMPILED)222 ScriptExecutable(Structure* structure, JSGlobalData& globalData, const SourceCode& source, bool isInStrictContext) 223 : ExecutableBase(globalData, structure, NUM_PARAMETERS_NOT_COMPILED) 218 224 , m_source(source) 219 225 , m_features(isInStrictContext ? StrictModeFeature : 0) 220 226 { 221 227 #if ENABLE(CODEBLOCK_SAMPLING) 222 if (SamplingTool* sampler = globalData ->interpreter->sampler())228 if (SamplingTool* sampler = globalData.interpreter->sampler()) 223 229 sampler->notifyOfScope(*globalData, this); 224 230 #else … … 291 297 } 292 298 293 static EvalExecutable* create(ExecState* exec, const SourceCode& source, bool isInStrictContext) { return new (exec) EvalExecutable(exec, source, isInStrictContext); } 299 static EvalExecutable* create(ExecState* exec, const SourceCode& source, bool isInStrictContext) 300 { 301 return new (allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext); 302 } 294 303 295 304 #if ENABLE(JIT) … … 320 329 static ProgramExecutable* create(ExecState* exec, const SourceCode& source) 321 330 { 322 return new ( exec) ProgramExecutable(exec, source);331 return new (allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source); 323 332 } 324 333 … … 373 382 static FunctionExecutable* create(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine) 374 383 { 375 return new ( exec) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);376 } 377 378 static FunctionExecutable* create(JSGlobalData *globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)379 { 380 return new ( globalData) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);384 return new (allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine); 385 } 386 387 static FunctionExecutable* create(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine) 388 { 389 return new (allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine); 381 390 } 382 391 383 392 JSFunction* make(ExecState* exec, ScopeChainNode* scopeChain) 384 393 { 385 return new (exec) JSFunction(exec, this, scopeChain);394 return JSFunction::create(exec, this, scopeChain); 386 395 } 387 396 … … 480 489 481 490 private: 482 FunctionExecutable(JSGlobalData *, const Identifier& name, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool, int firstLine, int lastLine);491 FunctionExecutable(JSGlobalData&, const Identifier& name, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool, int firstLine, int lastLine); 483 492 FunctionExecutable(ExecState*, const Identifier& name, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool, int firstLine, int lastLine); 484 493
Note:
See TracChangeset
for help on using the changeset viewer.