diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-09-14 14:54:42 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-09-19 09:44:33 +0000 |
commit | 042aa2eb0e55616fc754d0d71246efb531ca6dfe (patch) | |
tree | f48118a1f8564b4c4cbadc0ebf291d56d59dbb70 /src/qml/jsruntime/qv4context_p.h | |
parent | b7ddcdad876cf0a46aa14a0f78ee8b3e4f685c19 (diff) |
Change CallData::argc to be a QV4::Value
Instead of mimicking a Value. This makes sure that argc now stays
correct even when anything on Value changes.
Most of the change is mechanical: replace callData->argc by
callData->argc().
Change-Id: I521831ae1ffb3966bad6589c18d7a373e13439d7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4context_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4context_p.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index ec027c9fd3..7ed3320f8a 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -86,17 +86,20 @@ struct CallData Value context; Value accumulator; Value thisObject; + Value _argc; + + int argc() const { + Q_ASSERT(_argc.isInteger()); + return _argc.int_32(); + } + + void setArgc(int argc) { + Q_ASSERT(argc >= 0); + _argc.setInt_32(argc); + } - // below is to be compatible with Value. Initialize tag to 0 -#if Q_BYTE_ORDER != Q_LITTLE_ENDIAN - uint tag; -#endif - int argc; -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - uint tag; -#endif inline ReturnedValue argument(int i) const { - return i < argc ? args[i].asReturnedValue() : Primitive::undefinedValue().asReturnedValue(); + return i < argc() ? args[i].asReturnedValue() : Primitive::undefinedValue().asReturnedValue(); } Value args[1]; |