diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-11 11:07:32 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-17 07:47:09 +0000 |
commit | 1dac47c1418b44cf4a56b42bfca2b277795fd213 (patch) | |
tree | 26727943c30628340662a66d7cbe9f52d75c5b58 /src/qml/jsruntime/qv4atomics.cpp | |
parent | d89d5cffe79bd060a1b04a2c47a3d728bffbe195 (diff) |
Cleanups in Value/Primitive
Get rid of Primitive and move the corresponding methods
directly into Value. Mark many methods in Value as
constexpr and turn Value into a POD type again.
Keep Primitive as a pure alias to Value for source
compatibility of other modules that might be using it.
Change-Id: Icb47458947dd3482c8852e95782123ea4346f5ec
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4atomics.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4atomics.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/jsruntime/qv4atomics.cpp b/src/qml/jsruntime/qv4atomics.cpp index b29e46db78..4299aef859 100644 --- a/src/qml/jsruntime/qv4atomics.cpp +++ b/src/qml/jsruntime/qv4atomics.cpp @@ -114,11 +114,11 @@ ReturnedValue atomicReadModifyWrite(const FunctionObject *f, const Value *argv, if (!buffer) return Encode::undefined(); const TypedArray &a = static_cast<const TypedArray &>(argv[0]); - int index = validateAtomicAccess(scope, a, argc > 1 ? argv[1] : Primitive::undefinedValue()); + int index = validateAtomicAccess(scope, a, argc > 1 ? argv[1] : Value::undefinedValue()); if (index < 0) return Encode::undefined(); - Value v = Primitive::fromReturnedValue((argc > 2 ? argv[2] : Primitive::undefinedValue()).convertedToNumber()); + Value v = Value::fromReturnedValue((argc > 2 ? argv[2] : Value::undefinedValue()).convertedToNumber()); if (scope.hasException()) return Encode::undefined(); @@ -148,14 +148,14 @@ ReturnedValue Atomics::method_compareExchange(const FunctionObject *f, const Val if (!buffer) return Encode::undefined(); const TypedArray &a = static_cast<const TypedArray &>(argv[0]); - int index = validateAtomicAccess(scope, a, argc > 1 ? argv[1] : Primitive::undefinedValue()); + int index = validateAtomicAccess(scope, a, argc > 1 ? argv[1] : Value::undefinedValue()); if (index < 0) return Encode::undefined(); - Value expected = Primitive::fromReturnedValue((argc > 2 ? argv[2] : Primitive::undefinedValue()).convertedToNumber()); + Value expected = Value::fromReturnedValue((argc > 2 ? argv[2] : Value::undefinedValue()).convertedToNumber()); if (scope.hasException()) return Encode::undefined(); - Value v = Primitive::fromReturnedValue((argc > 3 ? argv[3] : Primitive::undefinedValue()).convertedToNumber()); + Value v = Value::fromReturnedValue((argc > 3 ? argv[3] : Value::undefinedValue()).convertedToNumber()); if (scope.hasException()) return Encode::undefined(); @@ -196,7 +196,7 @@ ReturnedValue Atomics::method_load(const FunctionObject *f, const Value *, const if (!buffer) return Encode::undefined(); const TypedArray &a = static_cast<const TypedArray &>(argv[0]); - int index = validateAtomicAccess(scope, a, argc > 1 ? argv[1] : Primitive::undefinedValue()); + int index = validateAtomicAccess(scope, a, argc > 1 ? argv[1] : Value::undefinedValue()); if (index < 0) return Encode::undefined(); @@ -221,11 +221,11 @@ ReturnedValue Atomics::method_store(const FunctionObject *f, const Value *, cons if (!buffer) return Encode::undefined(); const TypedArray &a = static_cast<const TypedArray &>(argv[0]); - int index = validateAtomicAccess(scope, a, argc > 1 ? argv[1] : Primitive::undefinedValue()); + int index = validateAtomicAccess(scope, a, argc > 1 ? argv[1] : Value::undefinedValue()); if (index < 0) return Encode::undefined(); - Value v = Primitive::fromReturnedValue((argc > 2 ? argv[2] : Primitive::undefinedValue()).convertedToNumber()); + Value v = Value::fromReturnedValue((argc > 2 ? argv[2] : Value::undefinedValue()).convertedToNumber()); if (scope.hasException()) return Encode::undefined(); |