Qt 4.8
|
Represents a static scope object. More...
#include <qscriptstaticscopeobject_p.h>
Classes | |
struct | Data |
struct | PropertyInfo |
Public Functions | |
virtual const JSC::ClassInfo * | classInfo () const |
virtual bool | deleteProperty (JSC::ExecState *, const JSC::Identifier &propertyName) |
virtual bool | getOwnPropertyDescriptor (JSC::ExecState *, const JSC::Identifier &propertyName, JSC::PropertyDescriptor &) |
virtual bool | getOwnPropertySlot (JSC::ExecState *, const JSC::Identifier &propertyName, JSC::PropertySlot &) |
virtual bool | isDynamicScope () const |
virtual void | markChildren (JSC::MarkStack &) |
virtual void | put (JSC::ExecState *, const JSC::Identifier &propertyName, JSC::JSValue value, JSC::PutPropertySlot &) |
virtual void | putWithAttributes (JSC::ExecState *exec, const JSC::Identifier &propertyName, JSC::JSValue value, unsigned attributes) |
QScriptStaticScopeObject (WTF::NonNullPassRefPtr< JSC::Structure > structure, int propertyCount, const PropertyInfo *) | |
Creates a static scope object with a fixed set of undeletable properties. More... | |
QScriptStaticScopeObject (WTF::NonNullPassRefPtr< JSC::Structure > structure) | |
Creates an empty static scope object. More... | |
virtual | ~QScriptStaticScopeObject () |
Static Public Functions | |
static WTF::PassRefPtr< JSC::Structure > | createStructure (JSC::JSValue proto) |
Static Public Variables | |
static const JSC::ClassInfo | info = { "QScriptStaticScopeObject", 0, 0, 0 } |
Protected Functions | |
Data * | d_ptr () const |
Static Protected Variables | |
static const unsigned | StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::NeedsThisConversion | JSC::OverridesMarkChildren | JSC::OverridesGetPropertyNames | JSC::JSVariableObject::StructureFlags |
Private Functions | |
void | addSymbolTableProperty (const JSC::Identifier &, JSC::JSValue, unsigned attributes) |
int | growRegisterArray (int) |
Grows the register array by count elements, and returns the offset of the newly added elements (note that the register file grows downwards, starting at index -1). More... | |
Represents a static scope object.
This class allows the VM to determine at JS script compile time whether the object has a given property or not. If the object has the property, a fast, index-based read/write operation will be used. If the object doesn't have the property, the compiler knows it can safely skip this object when dynamically resolving the property. Either way, this can greatly improve performance.
Definition at line 44 of file qscriptstaticscopeobject_p.h.
QScriptStaticScopeObject::QScriptStaticScopeObject | ( | WTF::NonNullPassRefPtr< JSC::Structure > | structure, |
int | propertyCount, | ||
const PropertyInfo * | props | ||
) |
Creates a static scope object with a fixed set of undeletable properties.
It's not possible to add new properties to the object after construction.
Definition at line 60 of file qscriptstaticscopeobject.cpp.
QScriptStaticScopeObject::QScriptStaticScopeObject | ( | WTF::NonNullPassRefPtr< JSC::Structure > | structure | ) |
Creates an empty static scope object.
Properties can be added to the object after construction, either by calling QScriptValue::setProperty(), or by pushing the object on the scope chain; variable declarations ("var" statements) and function declarations in JavaScript will create properties on the scope object.
Note that once the scope object has been used in a closure and the resulting function has been compiled, it's no longer safe to add properties to the scope object (because the VM will bypass this object the next time the function is executed).
Definition at line 86 of file qscriptstaticscopeobject.cpp.
|
virtual |
Definition at line 91 of file qscriptstaticscopeobject.cpp.
|
private |
Definition at line 135 of file qscriptstaticscopeobject.cpp.
Referenced by d_ptr(), put(), and putWithAttributes().
|
inlinevirtual |
Definition at line 74 of file qscriptstaticscopeobject_p.h.
|
inlinestatic |
Definition at line 77 of file qscriptstaticscopeobject_p.h.
Referenced by QScriptEnginePrivate::QScriptEnginePrivate().
|
inlineprotected |
Definition at line 94 of file qscriptstaticscopeobject_p.h.
Referenced by growRegisterArray(), markChildren(), put(), putWithAttributes(), and ~QScriptStaticScopeObject().
|
virtual |
Definition at line 122 of file qscriptstaticscopeobject.cpp.
Referenced by isDynamicScope().
|
virtual |
Definition at line 101 of file qscriptstaticscopeobject.cpp.
Referenced by isDynamicScope().
|
virtual |
Definition at line 96 of file qscriptstaticscopeobject.cpp.
Referenced by isDynamicScope().
|
private |
Grows the register array by count elements, and returns the offset of the newly added elements (note that the register file grows downwards, starting at index -1).
Definition at line 148 of file qscriptstaticscopeobject.cpp.
Referenced by addSymbolTableProperty(), d_ptr(), and QScriptStaticScopeObject().
|
inlinevirtual |
Definition at line 62 of file qscriptstaticscopeobject_p.h.
|
virtual |
Definition at line 127 of file qscriptstaticscopeobject.cpp.
Referenced by isDynamicScope().
|
virtual |
Definition at line 114 of file qscriptstaticscopeobject.cpp.
Referenced by isDynamicScope().
|
virtual |
Definition at line 106 of file qscriptstaticscopeobject.cpp.
Referenced by isDynamicScope().
|
static |
Definition at line 75 of file qscriptstaticscopeobject_p.h.
Referenced by classInfo().
|
staticprotected |
Definition at line 82 of file qscriptstaticscopeobject_p.h.
Referenced by createStructure().