diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-13 08:39:28 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-13 13:24:12 (GMT) |
commit | 04ac768f2ac5e3800893370c13c261a075a723ff (patch) | |
tree | a14a6c9580cde04bb962c350b9667d4510e66972 /src/script/api/qscriptengine_p.h | |
parent | 88c6dc6ec7f73de279703b30874b30511901854b (diff) | |
download | Qt-04ac768f2ac5e3800893370c13c261a075a723ff.zip Qt-04ac768f2ac5e3800893370c13c261a075a723ff.tar.gz Qt-04ac768f2ac5e3800893370c13c261a075a723ff.tar.bz2 |
Lazily construct the QScriptActivationObject
We can store flags on the ReturnValueRegister entry in the stackframe
header (as native function don't use that)
Then when requesting an activation object we can lookup the flags to
know if we should create it.
This reduce a lot the cost of a native call.
Reviewed-by: Kent Hansen
Diffstat (limited to 'src/script/api/qscriptengine_p.h')
-rw-r--r-- | src/script/api/qscriptengine_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index 86c7616..1f59d36 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -165,6 +165,15 @@ public: bool isCollecting() const; void collectGarbage(); + //flags that we set on the return value register for native function. (ie when codeBlock is 0) + enum ContextFlags { + NativeContext = 1, + CalledAsConstructorContext = 2, + HasScopeContext = 4 + }; + static uint contextFlags(JSC::ExecState *); + static void setContextFlags(JSC::ExecState *, uint); + QScript::TimeoutCheckerProxy *timeoutChecker() const; #ifndef QT_NO_QOBJECT |