Changeset 59801 in webkit for trunk/JavaScriptCore/runtime/JSFunction.cpp
- Timestamp:
- May 19, 2010, 6:15:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSFunction.cpp
r59800 r59801 44 44 ASSERT_CLASS_FITS_IN_CELL(JSFunction); 45 45 46 const ClassInfo JSFunction::info = { "Function", 0, 0, 0 };46 const ClassInfo JSFunction::info = { "Function", &InternalFunction::info, 0, 0 }; 47 47 48 48 bool JSFunction::isHostFunctionNonInline() const … … 59 59 60 60 JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr<Structure> structure, int length, const Identifier& name, PassRefPtr<NativeExecutable> thunk) 61 : Base( structure)61 : Base(&exec->globalData(), structure, name) 62 62 #if ENABLE(JIT) 63 63 , m_executable(thunk) … … 65 65 , m_scopeChain(NoScopeChain()) 66 66 { 67 putDirect(exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);68 67 #if ENABLE(JIT) 69 68 putDirect(exec->propertyNames().length, jsNumber(exec, length), DontDelete | ReadOnly | DontEnum); … … 76 75 77 76 JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr<Structure> structure, int length, const Identifier& name, NativeFunction func) 78 : Base( structure)77 : Base(&exec->globalData(), structure, name) 79 78 #if ENABLE(JIT) 80 79 , m_executable(exec->globalData().getHostFunction(func)) … … 82 81 , m_scopeChain(NoScopeChain()) 83 82 { 84 putDirect(exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);85 83 #if ENABLE(JIT) 86 84 putDirect(exec->propertyNames().length, jsNumber(exec, length), DontDelete | ReadOnly | DontEnum); … … 93 91 94 92 JSFunction::JSFunction(ExecState* exec, NonNullPassRefPtr<FunctionExecutable> executable, ScopeChainNode* scopeChainNode) 95 : Base( exec->lexicalGlobalObject()->functionStructure())93 : Base(&exec->globalData(), exec->lexicalGlobalObject()->functionStructure(), executable->name()) 96 94 , m_executable(executable) 97 95 , m_scopeChain(scopeChainNode) 98 96 { 99 const Identifier& name = static_cast<FunctionExecutable*>(m_executable.get())->name();100 putDirect(exec->globalData().propertyNames->name, jsString(exec, name.isNull() ? "" : name.ustring()), DontDelete | ReadOnly | DontEnum);101 97 } 102 98 … … 119 115 } 120 116 121 const UString& JSFunction::name(ExecState* exec)122 {123 return asString(getDirect(exec->globalData().propertyNames->name))->value(exec);124 }125 126 const UString JSFunction::displayName(ExecState* exec)127 {128 JSValue displayName = getDirect(exec->globalData().propertyNames->displayName);129 130 if (displayName && isJSString(&exec->globalData(), displayName))131 return asString(displayName)->value(exec);132 133 return UString::null();134 }135 136 const UString JSFunction::calculatedDisplayName(ExecState* exec)137 {138 const UString explicitName = displayName(exec);139 140 if (!explicitName.isEmpty())141 return explicitName;142 143 return name(exec);144 }145 146 117 void JSFunction::markChildren(MarkStack& markStack) 147 118 {
Note:
See TracChangeset
for help on using the changeset viewer.