summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSGlobalObject.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-09-10 19:10:20 +0200
commit284837daa07b29d6a63a748544a90b1f5842ac5c (patch)
treeecd258180bde91fe741e0cfd2638beb3c6da7e8e /Source/JavaScriptCore/runtime/JSGlobalObject.h
parent2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff)
downloadqtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSGlobalObject.h')
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalObject.h35
1 files changed, 25 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h
index 248004bd5..406a65b51 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.h
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h
@@ -77,6 +77,7 @@ namespace JSC {
class JSGlobalObject : public JSSegmentedVariableObject {
private:
+ typedef JSSegmentedVariableObject Base;
typedef HashSet<RefPtr<OpaqueJSWeakObjectMap> > WeakMapSet;
struct JSGlobalObjectRareData {
@@ -93,7 +94,7 @@ namespace JSC {
Register m_globalCallFrame[RegisterFile::CallFrameHeaderSize];
- WriteBarrier<ScopeChainNode> m_globalScopeChain;
+ WriteBarrier<JSObject> m_globalThis;
WriteBarrier<JSObject> m_methodCallDummy;
WriteBarrier<RegExpConstructor> m_regExpConstructor;
@@ -120,6 +121,10 @@ namespace JSC {
WriteBarrier<RegExpPrototype> m_regExpPrototype;
WriteBarrier<ErrorPrototype> m_errorPrototype;
+ WriteBarrier<Structure> m_withScopeStructure;
+ WriteBarrier<Structure> m_strictEvalActivationStructure;
+ WriteBarrier<Structure> m_activationStructure;
+ WriteBarrier<Structure> m_nameScopeStructure;
WriteBarrier<Structure> m_argumentsStructure;
WriteBarrier<Structure> m_arrayStructure;
WriteBarrier<Structure> m_booleanObjectStructure;
@@ -149,8 +154,6 @@ namespace JSC {
WeakRandom m_weakRandom;
- SymbolTable m_symbolTable;
-
bool m_evalEnabled;
bool m_experimentsEnabled;
@@ -166,8 +169,6 @@ namespace JSC {
}
public:
- typedef JSSegmentedVariableObject Base;
-
static JSGlobalObject* create(JSGlobalData& globalData, Structure* structure)
{
JSGlobalObject* globalObject = new (NotNull, allocateCell<JSGlobalObject>(globalData.heap)) JSGlobalObject(globalData, structure);
@@ -252,6 +253,10 @@ namespace JSC {
JSObject* methodCallDummy() const { return m_methodCallDummy.get(); }
+ Structure* withScopeStructure() const { return m_withScopeStructure.get(); }
+ Structure* strictEvalActivationStructure() const { return m_strictEvalActivationStructure.get(); }
+ Structure* activationStructure() const { return m_activationStructure.get(); }
+ Structure* nameScopeStructure() const { return m_nameScopeStructure.get(); }
Structure* argumentsStructure() const { return m_argumentsStructure.get(); }
Structure* arrayStructure() const { return m_arrayStructure.get(); }
Structure* booleanObjectStructure() const { return m_booleanObjectStructure.get(); }
@@ -292,8 +297,6 @@ namespace JSC {
static bool supportsProfiling(const JSGlobalObject*) { return false; }
static bool supportsRichSourceInfo(const JSGlobalObject*) { return true; }
- ScopeChainNode* globalScopeChain() { return m_globalScopeChain.get(); }
-
JS_EXPORT_PRIVATE ExecState* globalExec();
static bool shouldInterruptScript(const JSGlobalObject*) { return true; }
@@ -307,6 +310,7 @@ namespace JSC {
void resetPrototype(JSGlobalData&, JSValue prototype);
JSGlobalData& globalData() const { return *Heap::heap(this)->globalData(); }
+ JSObject* globalThis() const;
static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
{
@@ -329,7 +333,7 @@ namespace JSC {
unsigned weakRandomInteger() { return m_weakRandom.getUint32(); }
protected:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | JSSegmentedVariableObject::StructureFlags;
+ static const unsigned StructureFlags = OverridesGetOwnPropertySlot | OverridesVisitChildren | OverridesGetPropertyNames | Base::StructureFlags;
struct GlobalPropertyInfo {
GlobalPropertyInfo(const Identifier& i, JSValue v, unsigned a)
@@ -351,6 +355,7 @@ namespace JSC {
// FIXME: Fold reset into init.
JS_EXPORT_PRIVATE void init(JSObject* thisValue);
void reset(JSValue prototype);
+ void setGlobalThis(JSGlobalData&, JSObject* globalThis);
void createThrowTypeError(ExecState*);
@@ -368,7 +373,7 @@ namespace JSC {
inline bool JSGlobalObject::hasOwnPropertyForWrite(ExecState* exec, PropertyName propertyName)
{
PropertySlot slot;
- if (JSSegmentedVariableObject::getOwnPropertySlot(this, exec, propertyName, slot))
+ if (Base::getOwnPropertySlot(this, exec, propertyName, slot))
return true;
bool slotIsWriteable;
return symbolTableGet(this, propertyName, slot, slotIsWriteable);
@@ -376,7 +381,7 @@ namespace JSC {
inline bool JSGlobalObject::symbolTableHasProperty(PropertyName propertyName)
{
- SymbolTableEntry entry = symbolTable().inlineGet(propertyName.publicName());
+ SymbolTableEntry entry = symbolTable()->inlineGet(propertyName.publicName());
return !entry.isNull();
}
@@ -491,6 +496,16 @@ namespace JSC {
return true;
}
+ inline JSObject* JSScope::globalThis()
+ {
+ return globalObject()->globalThis();
+ }
+
+ inline JSObject* JSGlobalObject::globalThis() const
+ {
+ return m_globalThis.get();
+ }
+
} // namespace JSC
#endif // JSGlobalObject_h