diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-04-05 21:15:58 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2013-04-06 23:34:21 +0200 |
commit | f2971f053f2a24677fc2bcaf907435f4e949a54b (patch) | |
tree | 0d02f198aa6af9a64aec599b74996d651086f878 /src/v4/qv4stringobject.cpp | |
parent | 13650a052f910dd42e9b7936f055e15588bdc3a9 (diff) |
Introduce a SimpleCallContext for simple functions
Use it for most builtin methods. Gives ~10% speed
improvement on the V8 benchmark.
Change-Id: I0039f102e561c0adbe1a9b070150ad32142a33e8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/v4/qv4stringobject.cpp')
-rw-r--r-- | src/v4/qv4stringobject.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/v4/qv4stringobject.cpp b/src/v4/qv4stringobject.cpp index 7195d160b4..ba9e6ac5de 100644 --- a/src/v4/qv4stringobject.cpp +++ b/src/v4/qv4stringobject.cpp @@ -400,7 +400,7 @@ static QString makeReplacementString(const QString &input, const QString& replac return result; } -Value StringPrototype::method_replace(CallContext *ctx) +Value StringPrototype::method_replace(SimpleCallContext *ctx) { QString string; if (StringObject *thisString = ctx->thisObject.asStringObject()) @@ -488,7 +488,7 @@ Value StringPrototype::method_replace(CallContext *ctx) return Value::fromString(ctx, result); } -Value StringPrototype::method_search(CallContext *ctx) +Value StringPrototype::method_search(SimpleCallContext *ctx) { QString string; if (StringObject *thisString = ctx->thisObject.asStringObject()) @@ -509,7 +509,7 @@ Value StringPrototype::method_search(CallContext *ctx) return Value::fromUInt32(result); } -Value StringPrototype::method_slice(CallContext *ctx) +Value StringPrototype::method_slice(SimpleCallContext *ctx) { const QString text = getThisString(ctx); const double length = text.length(); @@ -535,7 +535,7 @@ Value StringPrototype::method_slice(CallContext *ctx) return Value::fromString(ctx, text.mid(intStart, count)); } -Value StringPrototype::method_split(CallContext *ctx) +Value StringPrototype::method_split(SimpleCallContext *ctx) { QString text; if (StringObject *thisObject = ctx->thisObject.asStringObject()) @@ -676,24 +676,24 @@ Value StringPrototype::method_substring(ExecutionContext *parentCtx, Value thisO return Value::fromString(parentCtx, value.mid(x, y)); } -Value StringPrototype::method_toLowerCase(CallContext *ctx) +Value StringPrototype::method_toLowerCase(SimpleCallContext *ctx) { QString value = getThisString(ctx); return Value::fromString(ctx, value.toLower()); } -Value StringPrototype::method_toLocaleLowerCase(CallContext *ctx) +Value StringPrototype::method_toLocaleLowerCase(SimpleCallContext *ctx) { return method_toLowerCase(ctx); } -Value StringPrototype::method_toUpperCase(CallContext *ctx) +Value StringPrototype::method_toUpperCase(SimpleCallContext *ctx) { QString value = getThisString(ctx); return Value::fromString(ctx, value.toUpper()); } -Value StringPrototype::method_toLocaleUpperCase(CallContext *ctx) +Value StringPrototype::method_toLocaleUpperCase(SimpleCallContext *ctx) { return method_toUpperCase(ctx); } @@ -709,7 +709,7 @@ Value StringPrototype::method_fromCharCode(ExecutionContext *parentCtx, Value, V return Value::fromString(parentCtx, str); } -Value StringPrototype::method_trim(CallContext *ctx) +Value StringPrototype::method_trim(SimpleCallContext *ctx) { if (ctx->thisObject.isNull() || ctx->thisObject.isUndefined()) ctx->throwTypeError(); |