Changeset 82971 in webkit
- Timestamp:
- Apr 5, 2011 1:03:08 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r82931 r82971 1 2011-04-05 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Make caches window show more info about non-jsobject GC values 6 https://bugs.webkit.org/show_bug.cgi?id=57874 7 8 Add ClassInfo to the various internal JS types that currently 9 don't have any, and make the text for caches window show the 10 classname for non-JSObject instances. 11 12 * runtime/Executable.cpp: 13 * runtime/Executable.h: 14 (JSC::ExecutableBase::createStructure): 15 (JSC::NativeExecutable::createStructure): 16 (JSC::NativeExecutable::NativeExecutable): 17 (JSC::EvalExecutable::createStructure): 18 (JSC::ProgramExecutable::createStructure): 19 (JSC::FunctionExecutable::createStructure): 20 * runtime/Heap.cpp: 21 (JSC::TypeCounter::typeName): 22 * runtime/JSGlobalData.cpp: 23 (JSC::JSGlobalData::JSGlobalData): 24 * runtime/JSGlobalData.h: 25 * runtime/ScopeChain.cpp: 26 * runtime/ScopeChain.h: 27 (JSC::ScopeChainNode::createStructure): 28 * runtime/StructureChain.cpp: 29 * runtime/StructureChain.h: 30 (JSC::StructureChain::createStructure): 31 1 32 2011-04-05 Nikolas Zimmermann <nzimmermann@rim.com> 2 33 -
trunk/Source/JavaScriptCore/runtime/Executable.cpp
r81483 r82971 41 41 namespace JSC { 42 42 43 const ClassInfo ExecutableBase::s_info = { "Executable", 0, 0, 0 }; 44 45 const ClassInfo NativeExecutable::s_info = { "NativeExecutable", &ExecutableBase::s_info, 0, 0 }; 46 43 47 NativeExecutable::~NativeExecutable() 44 48 { … … 48 52 { 49 53 } 54 55 const ClassInfo EvalExecutable::s_info = { "EvalExecutable", &ScriptExecutable::s_info, 0, 0 }; 50 56 51 57 EvalExecutable::EvalExecutable(ExecState* exec, const SourceCode& source, bool inStrictContext) … … 58 64 } 59 65 66 const ClassInfo ProgramExecutable::s_info = { "ProgramExecutable", &ScriptExecutable::s_info, 0, 0 }; 67 60 68 ProgramExecutable::ProgramExecutable(ExecState* exec, const SourceCode& source) 61 69 : ScriptExecutable(exec->globalData().programExecutableStructure.get(), exec, source, false) … … 66 74 { 67 75 } 76 77 const ClassInfo FunctionExecutable::s_info = { "FunctionExecutable", &ScriptExecutable::s_info, 0, 0 }; 68 78 69 79 FunctionExecutable::FunctionExecutable(JSGlobalData* globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool inStrictContext, int firstLine, int lastLine) -
trunk/Source/JavaScriptCore/runtime/Executable.h
r81904 r82971 66 66 } 67 67 68 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, 0); }68 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, &s_info); } 69 69 70 70 protected: 71 71 static const unsigned StructureFlags = 0; 72 static const ClassInfo s_info; 72 73 int m_numParametersForCall; 73 74 int m_numParametersForConstruct; … … 116 117 NativeFunction function() { return m_function; } 117 118 119 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, &s_info); } 120 118 121 private: 119 122 #if ENABLE(JIT) 120 123 NativeExecutable(JSGlobalData& globalData, JITCode callThunk, NativeFunction function, JITCode constructThunk, NativeFunction constructor) 121 : ExecutableBase(globalData. executableStructure.get(), NUM_PARAMETERS_IS_HOST)124 : ExecutableBase(globalData.nativeExecutableStructure.get(), NUM_PARAMETERS_IS_HOST) 122 125 , m_function(function) 123 126 , m_constructor(constructor) … … 130 133 #else 131 134 NativeExecutable(JSGlobalData& globalData, NativeFunction function, NativeFunction constructor) 132 : ExecutableBase(globalData. executableStructure.get(), NUM_PARAMETERS_IS_HOST)135 : ExecutableBase(globalData.nativeExecutableStructure.get(), NUM_PARAMETERS_IS_HOST) 133 136 , m_function(function) 134 137 , m_constructor(constructor) … … 141 144 // trampoline. It may be easier to make NativeFunction be passed 'this' as a part of the ArgList. 142 145 NativeFunction m_constructor; 146 static const ClassInfo s_info; 143 147 }; 144 148 … … 239 243 } 240 244 #endif 241 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, 0); }245 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, &s_info); } 242 246 243 247 private: 244 248 static const unsigned StructureFlags = OverridesMarkChildren | ScriptExecutable::StructureFlags; 249 static const ClassInfo s_info; 245 250 EvalExecutable(ExecState*, const SourceCode&, bool); 246 251 … … 285 290 #endif 286 291 287 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, 0); }292 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, &s_info); } 288 293 289 294 private: 290 295 static const unsigned StructureFlags = OverridesMarkChildren | ScriptExecutable::StructureFlags; 296 static const ClassInfo s_info; 291 297 ProgramExecutable(ExecState*, const SourceCode&); 292 298 … … 377 383 void markChildren(MarkStack&); 378 384 static FunctionExecutable* fromGlobalCode(const Identifier&, ExecState*, Debugger*, const SourceCode&, JSObject** exception); 379 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, 0); }385 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, &s_info); } 380 386 381 387 private: … … 387 393 388 394 static const unsigned StructureFlags = OverridesMarkChildren | ScriptExecutable::StructureFlags; 395 static const ClassInfo s_info; 389 396 unsigned m_numCapturedVariables : 31; 390 397 bool m_forceUsesArguments : 1; -
trunk/Source/JavaScriptCore/runtime/Heap.cpp
r82875 r82971 319 319 if (cell->isPropertyNameIterator()) 320 320 return "For-in iterator"; 321 if (const ClassInfo* info = cell->classInfo()) 322 return info->className; 321 323 if (!cell->isObject()) 322 324 return "[empty cell]"; 323 const ClassInfo* info = cell->classInfo(); 324 return info ? info->className : "Object"; 325 return "Object"; 325 326 } 326 327 -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp
r82849 r82971 181 181 scopeChainNodeStructure = ScopeChainNode::createStructure(*this, jsNull()); 182 182 executableStructure = ExecutableBase::createStructure(*this, jsNull()); 183 nativeExecutableStructure = NativeExecutable::createStructure(*this, jsNull()); 183 184 evalExecutableStructure = EvalExecutable::createStructure(*this, jsNull()); 184 185 programExecutableStructure = ProgramExecutable::createStructure(*this, jsNull()); -
trunk/Source/JavaScriptCore/runtime/JSGlobalData.h
r82849 r82971 158 158 RefPtr<Structure> scopeChainNodeStructure; 159 159 RefPtr<Structure> executableStructure; 160 RefPtr<Structure> nativeExecutableStructure; 160 161 RefPtr<Structure> evalExecutableStructure; 161 162 RefPtr<Structure> programExecutableStructure; -
trunk/Source/JavaScriptCore/runtime/ScopeChain.cpp
r79904 r82971 52 52 #endif 53 53 54 const ClassInfo ScopeChainNode::s_info = { "ScopeChainNode", 0, 0, 0 }; 55 54 56 int ScopeChainNode::localDepth() 55 57 { -
trunk/Source/JavaScriptCore/runtime/ScopeChain.h
r82898 r82971 66 66 #endif 67 67 68 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, 0); }68 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue proto) { return Structure::create(globalData, proto, TypeInfo(CompoundType, StructureFlags), AnonymousSlotCount, &s_info); } 69 69 virtual void markChildren(MarkStack&); 70 70 private: 71 71 static const unsigned StructureFlags = OverridesMarkChildren; 72 static const ClassInfo s_info; 72 73 }; 73 74 -
trunk/Source/JavaScriptCore/runtime/StructureChain.cpp
r82849 r82971 32 32 33 33 namespace JSC { 34 35 ClassInfo StructureChain::s_info = { "StructureChain", 0, 0, 0 }; 34 36 35 37 StructureChain::StructureChain(NonNullPassRefPtr<Structure> structure, Structure* head) -
trunk/Source/JavaScriptCore/runtime/StructureChain.h
r82898 r82971 47 47 void markChildren(MarkStack&); 48 48 49 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype) { return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesMarkChildren), 0, 0); }49 static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype) { return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesMarkChildren), 0, &s_info); } 50 50 51 51 private: … … 53 53 ~StructureChain(); 54 54 OwnArrayPtr<RefPtr<Structure> > m_vector; 55 static ClassInfo s_info; 55 56 }; 56 57
Note: See TracChangeset
for help on using the changeset viewer.