aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authorlaknoll <lars.knoll@digia.com>2012-09-19 21:08:47 +0200
committerlaknoll <lars.knoll@digia.com>2012-09-19 23:28:50 +0200
commitaaea2a9a964a587372c8dc2a249f4a7e7ccea4f3 (patch)
treea4d278785aa024f6a337b8c5765ed790d69d9cd9 /main.cpp
parenta1eb099a4a7fda46cc1b5e0ecb34cbde27ebaf30 (diff)
Proper NaN boxing for Value
All JS types are now encoded in a 8 byte data structure. We use the 52 bits that are unused when a double is a NaN to encode all other types that can be stored inside a double. This is being done by using a few bits to determine the type, and up to 48 bits for data. This works even on x64, as addresses (ie. pointers) are limited to 48 bits on these platforms. For most other types (except doubles), we store the data in the lower 32 bits of the double.
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.cpp b/main.cpp
index 6f337178a9..08917aee04 100644
--- a/main.cpp
+++ b/main.cpp
@@ -168,7 +168,7 @@ int evaluateCompiledCode(const QStringList &files)
VM::ExecutionEngine vm;
VM::Context *ctx = vm.rootContext;
- QQmlJS::VM::Object *globalObject = vm.globalObject.objectValue;
+ QQmlJS::VM::Object *globalObject = vm.globalObject.objectValue();
globalObject->setProperty(ctx, vm.identifier(QStringLiteral("print")),
QQmlJS::VM::Value::fromObject(new builtins::Print(ctx)));
@@ -244,7 +244,7 @@ static void evaluate(QQmlJS::VM::Context *ctx, const QString &fileName, const QS
__qmljs_init_object(&ctx->activation, new QQmlJS::VM::Object());
foreach (const QString *local, globalCode->locals) {
- ctx->activation.objectValue->setProperty(ctx, *local, QQmlJS::VM::Value::undefinedValue());
+ ctx->activation.objectValue()->setProperty(ctx, *local, QQmlJS::VM::Value::undefinedValue());
}
if (useMoth) {
@@ -289,7 +289,7 @@ int main(int argc, char *argv[])
QQmlJS::VM::ExecutionEngine vm;
QQmlJS::VM::Context *ctx = vm.rootContext;
- QQmlJS::VM::Object *globalObject = vm.globalObject.objectValue;
+ QQmlJS::VM::Object *globalObject = vm.globalObject.objectValue();
globalObject->setProperty(ctx, vm.identifier(QStringLiteral("print")),
QQmlJS::VM::Value::fromObject(new builtins::Print(ctx)));