Changeset 93920 in webkit for trunk/Source/JavaScriptCore/runtime/Executable.h
- Timestamp:
- Aug 26, 2011, 3:32:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/Executable.h
r93835 r93920 59 59 , m_numParametersForConstruct(numParameters) 60 60 { 61 finishCreation(globalData);62 61 } 63 62 … … 76 75 static ExecutableBase* create(JSGlobalData& globalData, Structure* structure, int numParameters) 77 76 { 78 return new (allocateCell<ExecutableBase>(globalData.heap)) ExecutableBase(globalData, structure, numParameters); 77 ExecutableBase* executable = new (allocateCell<ExecutableBase>(globalData.heap)) ExecutableBase(globalData, structure, numParameters); 78 executable->finishCreation(globalData); 79 return executable; 79 80 } 80 81 … … 181 182 static NativeExecutable* create(JSGlobalData& globalData, MacroAssemblerCodePtr callThunk, NativeFunction function, MacroAssemblerCodePtr constructThunk, NativeFunction constructor) 182 183 { 184 NativeExecutable* executable; 183 185 if (!callThunk) 184 return new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, JITCode(), function, JITCode(), constructor); 185 return new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, JITCode::HostFunction(callThunk), function, JITCode::HostFunction(constructThunk), constructor); 186 executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, JITCode(), function, JITCode(), constructor); 187 else 188 executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, JITCode::HostFunction(callThunk), function, JITCode::HostFunction(constructThunk), constructor); 189 return executable; 186 190 } 187 191 #else … … 199 203 200 204 static const ClassInfo s_info; 201 205 206 protected: 207 #if ENABLE(JIT) 208 void finishCreation(JSGlobalData& globalData, JITCode callThunk, JITCode constructThunk) 209 { 210 Base::finishCreation(globalData); 211 m_jitCodeForCall = callThunk; 212 m_jitCodeForConstruct = constructThunk; 213 m_jitCodeForCallWithArityCheck = callThunk.addressForCall(); 214 m_jitCodeForConstructWithArityCheck = constructThunk.addressForCall(); 215 } 216 #endif 217 202 218 private: 203 219 #if ENABLE(JIT) … … 207 223 , m_constructor(constructor) 208 224 { 209 m_jitCodeForCall = callThunk; 210 m_jitCodeForConstruct = constructThunk; 211 m_jitCodeForCallWithArityCheck = callThunk.addressForCall(); 212 m_jitCodeForConstructWithArityCheck = constructThunk.addressForCall(); 225 finishCreation(globalData, callThunk, constructThunk); 213 226 } 214 227 #else … … 218 231 , m_constructor(constructor) 219 232 { 233 finishCreation(globalData); 220 234 } 221 235 #endif … … 236 250 , m_features(isInStrictContext ? StrictModeFeature : 0) 237 251 { 238 #if ENABLE(CODEBLOCK_SAMPLING) 239 if (SamplingTool* sampler = globalData.interpreter->sampler()) 240 sampler->notifyOfScope(globalData, this); 241 #else 242 UNUSED_PARAM(globalData); 243 #endif 252 finishCreation(globalData); 244 253 } 245 254 … … 249 258 , m_features(isInStrictContext ? StrictModeFeature : 0) 250 259 { 251 #if ENABLE(CODEBLOCK_SAMPLING) 252 if (SamplingTool* sampler = exec->globalData().interpreter->sampler()) 253 sampler->notifyOfScope(exec->globalData(), this); 254 #else 255 UNUSED_PARAM(exec); 256 #endif 260 finishCreation(exec->globalData()); 257 261 } 258 262 … … 271 275 272 276 static const ClassInfo s_info; 277 273 278 protected: 279 void finishCreation(JSGlobalData& globalData) 280 { 281 Base::finishCreation(globalData); 282 #if ENABLE(CODEBLOCK_SAMPLING) 283 if (SamplingTool* sampler = globalData.interpreter->sampler()) 284 sampler->notifyOfScope(globalData, this); 285 #endif 286 } 287 274 288 void recordParse(CodeFeatures features, bool hasCapturedVariables, int firstLine, int lastLine) 275 289 {
Note:
See TracChangeset
for help on using the changeset viewer.