Changeset 37257 in webkit for trunk/JavaScriptCore/kjs/ExecState.h
- Timestamp:
- Oct 3, 2008, 2:39:16 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/ExecState.h
r37215 r37257 42 42 friend class DebuggerCallFrame; 43 43 public: 44 ExecState(JSGlobalObject*, Register* callFrame); 44 explicit ExecState(Register* callFrame) 45 : m_exception(0) 46 , m_callFrame(callFrame) 47 { 48 } 45 49 46 50 // Global object in which execution began. 47 JSGlobalObject* dynamicGlobalObject() const { return m_globalObject; } 48 51 JSGlobalObject* dynamicGlobalObject() const 52 { 53 return Machine::scopeChain(Machine::firstCallFrame(m_callFrame))->globalObject(); 54 } 55 49 56 // Global object in which the current script was defined. (Can differ 50 57 // from dynamicGlobalObject() during function calls across frames.) … … 53 60 return Machine::scopeChain(m_callFrame)->globalObject(); 54 61 } 55 56 JSObject* globalThisValue() const { return Machine::scopeChain(m_callFrame)->globalThisObject(); } 57 62 63 JSObject* globalThisValue() const 64 { 65 return Machine::scopeChain(m_callFrame)->globalThisObject(); 66 } 67 58 68 // Exception propogation. 59 69 void setException(JSValue* exception) { m_exception = exception; } … … 67 77 #endif 68 78 69 JSGlobalData& globalData() { return *m_globalData; } 79 JSGlobalData& globalData() const 80 { 81 return *Machine::scopeChain(m_callFrame)->globalData; 82 } 70 83 71 IdentifierTable* identifierTable() { return m_globalData->identifierTable; }72 const CommonIdentifiers& propertyNames() const { return * m_globalData->propertyNames; }73 const ArgList& emptyList() const { return * m_globalData->emptyList; }74 Lexer* lexer() { return m_globalData->lexer; }75 Parser* parser() { return m_globalData->parser; }76 Machine* machine() const { return m_globalData->machine; }77 static const HashTable* arrayTable(ExecState* exec) { return exec-> m_globalData->arrayTable; }78 static const HashTable* dateTable(ExecState* exec) { return exec-> m_globalData->dateTable; }79 static const HashTable* mathTable(ExecState* exec) { return exec-> m_globalData->mathTable; }80 static const HashTable* numberTable(ExecState* exec) { return exec-> m_globalData->numberTable; }81 static const HashTable* regExpTable(ExecState* exec) { return exec-> m_globalData->regExpTable; }82 static const HashTable* regExpConstructorTable(ExecState* exec) { return exec-> m_globalData->regExpConstructorTable; }83 static const HashTable* stringTable(ExecState* exec) { return exec-> m_globalData->stringTable; }84 IdentifierTable* identifierTable() { return globalData().identifierTable; } 85 const CommonIdentifiers& propertyNames() const { return *globalData().propertyNames; } 86 const ArgList& emptyList() const { return *globalData().emptyList; } 87 Lexer* lexer() { return globalData().lexer; } 88 Parser* parser() { return globalData().parser; } 89 Machine* machine() const { return globalData().machine; } 90 static const HashTable* arrayTable(ExecState* exec) { return exec->globalData().arrayTable; } 91 static const HashTable* dateTable(ExecState* exec) { return exec->globalData().dateTable; } 92 static const HashTable* mathTable(ExecState* exec) { return exec->globalData().mathTable; } 93 static const HashTable* numberTable(ExecState* exec) { return exec->globalData().numberTable; } 94 static const HashTable* regExpTable(ExecState* exec) { return exec->globalData().regExpTable; } 95 static const HashTable* regExpConstructorTable(ExecState* exec) { return exec->globalData().regExpConstructorTable; } 96 static const HashTable* stringTable(ExecState* exec) { return exec->globalData().stringTable; } 84 97 85 Heap* heap() const { return & m_globalData->heap; }98 Heap* heap() const { return &globalData().heap; } 86 99 87 100 private: … … 89 102 ExecState() { } 90 103 91 ExecState(ExecState*, Register* callFrame);92 93 104 bool isGlobalObject(JSObject*) const; 94 95 JSGlobalObject* m_globalObject;96 105 97 106 JSValue* m_exception; … … 99 108 void* m_ctiReturnAddress; 100 109 #endif 101 JSGlobalData* m_globalData;102 103 110 Register* m_callFrame; // The most recent call frame. 104 111 }; 105 106 enum CodeType { GlobalCode, EvalCode, FunctionCode };107 112 108 113 } // namespace JSC
Note:
See TracChangeset
for help on using the changeset viewer.