diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2012-12-04 12:00:23 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2012-12-04 18:56:56 +0100 |
commit | 955f5f03afd9915b7f43ff07ce4b624a86c58a1a (patch) | |
tree | 90eeb1d31ec3b976c38ec615a4dd28bed188f441 /qmljs_objects.cpp | |
parent | 070e0d07d821342bfbe7a409a51c4c53185c62c7 (diff) |
Allow only the ExecutionEngine's StringPool to create Strings.
Strings are the only non-Object Values living on the heap. So by
tracking creation, we can help the future GC a lot.
Change-Id: I5d5044f9ff10da42aeb75dd4a556d6ab3d839b1a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'qmljs_objects.cpp')
-rw-r--r-- | qmljs_objects.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/qmljs_objects.cpp b/qmljs_objects.cpp index e2cb5cf5b4..f12999bc22 100644 --- a/qmljs_objects.cpp +++ b/qmljs_objects.cpp @@ -543,14 +543,14 @@ QQmlJS::IR::Function *EvalFunction::parseSource(QQmlJS::VM::ExecutionContext *ct VM::DiagnosticMessage *error = 0, **errIt = &error; foreach (const QQmlJS::DiagnosticMessage &m, parser.diagnosticMessages()) { if (m.isError()) { - *errIt = new VM::DiagnosticMessage; // FIXME: should we ask the engine to create this object? - (*errIt)->fileName = ctx->engine->newString(fileName); + *errIt = new VM::DiagnosticMessage; + (*errIt)->fileName = fileName; (*errIt)->offset = m.loc.offset; (*errIt)->length = m.loc.length; (*errIt)->startLine = m.loc.startLine; (*errIt)->startColumn = m.loc.startColumn; (*errIt)->type = VM::DiagnosticMessage::Error; - (*errIt)->message = ctx->engine->newString(m.message); + (*errIt)->message = m.message; errIt = &(*errIt)->next; } else { std::cerr << qPrintable(fileName) << ':' << m.loc.startLine << ':' << m.loc.startColumn @@ -570,7 +570,7 @@ QQmlJS::IR::Function *EvalFunction::parseSource(QQmlJS::VM::ExecutionContext *ct } Codegen cg(ctx); - globalCode = cg(program, &module, mode); + globalCode = cg(fileName, program, &module, mode); if (globalCode) { // only generate other functions if global code generation succeeded. foreach (IR::Function *function, module.functions) { |