diff options
| author | laknoll <lars.knoll@digia.com> | 2012-09-19 21:08:47 +0200 |
|---|---|---|
| committer | laknoll <lars.knoll@digia.com> | 2012-09-19 23:28:50 +0200 |
| commit | aaea2a9a964a587372c8dc2a249f4a7e7ccea4f3 (patch) | |
| tree | a4d278785aa024f6a337b8c5765ed790d69d9cd9 /main.cpp | |
| parent | a1eb099a4a7fda46cc1b5e0ecb34cbde27ebaf30 (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.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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))); |
