diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-01-05 18:48:20 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-01-25 08:31:10 +0000 |
commit | c2a4277ae5c60a7b7f1e2a083a89ae4e528794c5 (patch) | |
tree | e525af4b0b241b9cdbcc1b10bc0103ac1695a83b /src/qml/jsruntime/qv4scopedvalue_p.h | |
parent | 3e67a40860e0cda4cf6118c97e47cbe55aa672d6 (diff) |
Speed up invocation of builtin functions
Completely avoid creation of a CallContext for those methods,
as we don't need it.
Change-Id: Iff1a38fd3c7e846df6ec0374cb7b3fb8f1b4de3a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4scopedvalue_p.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index 4e627e003f..379c3babda 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -68,6 +68,32 @@ namespace QV4 { struct ScopedValue; +#define CHECK_EXCEPTION() \ + do { \ + if (scope.hasException()) { \ + scope.result = Encode::undefined(); \ + return; \ + } \ + } while (false) + +#define RETURN_UNDEFINED() \ + do { \ + scope.result = Encode::undefined(); \ + return; \ + } while (false) + +#define RETURN_RESULT(r) \ + do { \ + scope.result = r; \ + return; \ + } while (false) + +#define THROW_TYPE_ERROR() \ + do { \ + scope.result = scope.engine->throwTypeError(); \ + return; \ + } while (false) + struct Scope { inline Scope(ExecutionContext *ctx) : engine(ctx->d()->engine) |