Changeset 59637 in webkit for trunk/JavaScriptCore/runtime/JSFunction.h
- Timestamp:
- May 17, 2010, 7:39:20 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSFunction.h
r58286 r59637 44 44 public: 45 45 JSFunction(ExecState*, NonNullPassRefPtr<Structure>, int length, const Identifier&, NativeFunction); 46 JSFunction(ExecState*, NonNullPassRefPtr<Structure>, int length, const Identifier&, NativeExecutable*, NativeFunction);46 JSFunction(ExecState*, NonNullPassRefPtr<Structure>, int length, const Identifier&, PassRefPtr<NativeExecutable>); 47 47 JSFunction(ExecState*, NonNullPassRefPtr<FunctionExecutable>, ScopeChainNode*); 48 48 virtual ~JSFunction(); … … 51 51 JSValue call(ExecState*, JSValue thisValue, const ArgList&); 52 52 53 void setScope(const ScopeChain& scopeChain) { setScopeChain(scopeChain); } 54 ScopeChain& scope() { return scopeChain(); } 53 ScopeChain& scope() 54 { 55 ASSERT(!isHostFunctionNonInline()); 56 return m_scopeChain; 57 } 58 void setScope(const ScopeChain& scopeChain) 59 { 60 ASSERT(!isHostFunctionNonInline()); 61 m_scopeChain = scopeChain; 62 } 55 63 56 64 ExecutableBase* executable() const { return m_executable.get(); } … … 67 75 } 68 76 69 NativeFunction nativeFunction() 70 { 71 return *WTF::bitwise_cast<NativeFunction*>(m_data); 72 } 77 NativeFunction nativeFunction(); 73 78 74 79 virtual ConstructType getConstructData(ConstructData&); … … 98 103 99 104 RefPtr<ExecutableBase> m_executable; 100 ScopeChain& scopeChain() 101 { 102 ASSERT(!isHostFunctionNonInline()); 103 return *WTF::bitwise_cast<ScopeChain*>(m_data); 104 } 105 void clearScopeChain() 106 { 107 ASSERT(!isHostFunctionNonInline()); 108 new (m_data) ScopeChain(NoScopeChain()); 109 } 110 void setScopeChain(ScopeChainNode* sc) 111 { 112 ASSERT(!isHostFunctionNonInline()); 113 new (m_data) ScopeChain(sc); 114 } 115 void setScopeChain(const ScopeChain& sc) 116 { 117 ASSERT(!isHostFunctionNonInline()); 118 *WTF::bitwise_cast<ScopeChain*>(m_data) = sc; 119 } 120 void setNativeFunction(NativeFunction func) 121 { 122 *WTF::bitwise_cast<NativeFunction*>(m_data) = func; 123 } 124 unsigned char m_data[sizeof(void*)]; 105 ScopeChain m_scopeChain; 125 106 }; 126 107
Note:
See TracChangeset
for help on using the changeset viewer.