<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qt/qtdeclarative.git/src/qml/jsruntime/qv4debugging.cpp, branch wip/dbus</title>
<subtitle>Qt Declarative (Quick 2)
</subtitle>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/'/>
<entry>
<title>Rename currentExecutionContext to currentContext</title>
<updated>2015-09-15T07:37:26+00:00</updated>
<author>
<name>Lars Knoll</name>
<email>lars.knoll@theqtcompany.com</email>
</author>
<published>2015-08-24T14:18:11+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=830376c9621dc8ada8e63b8b15f9abf856facfef'/>
<id>830376c9621dc8ada8e63b8b15f9abf856facfef</id>
<content type='text'>
Now that the other method is gone, let's use
the shorter currentContext

Change-Id: I2a6fb3b77f83a1ffdf314ad29081e303d17030ed
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now that the other method is gone, let's use
the shorter currentContext

Change-Id: I2a6fb3b77f83a1ffdf314ad29081e303d17030ed
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup usage of ExecutionEngine::currentContext</title>
<updated>2015-09-15T07:37:22+00:00</updated>
<author>
<name>Lars Knoll</name>
<email>lars.knoll@theqtcompany.com</email>
</author>
<published>2015-08-24T14:16:56+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=0e6195a85c5b9beceac719a7ea0c1389667bfcb3'/>
<id>0e6195a85c5b9beceac719a7ea0c1389667bfcb3</id>
<content type='text'>
Change-Id: Ic79d6da162375928ec25871cd0341daeab6483d2
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ic79d6da162375928ec25871cd0341daeab6483d2
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Store the stack of executioncontext's on the JS stack</title>
<updated>2015-09-15T07:37:16+00:00</updated>
<author>
<name>Lars Knoll</name>
<email>lars.knoll@theqtcompany.com</email>
</author>
<published>2015-08-24T13:31:46+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=3a8d6123d1947d18db15bf8b30f59cdea7e31380'/>
<id>3a8d6123d1947d18db15bf8b30f59cdea7e31380</id>
<content type='text'>
This saves one pointer per allocated execution context.
Now every execution context that is pushed, allocates two
Values on the js stack. One contains the context itself, the
other one the offset to the parent context.

Things are a bit tricky for with and catch scopes, as those
are called from the generated code, and can't open a Scope
anymore. In addition, all methods iterating over the js
stack frames need to work with ExecutionContext pointers,
not ScopedContext's.

Change-Id: I6f3013749d4e73d2fac37973b976ba6029686b82
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This saves one pointer per allocated execution context.
Now every execution context that is pushed, allocates two
Values on the js stack. One contains the context itself, the
other one the offset to the parent context.

Things are a bit tricky for with and catch scopes, as those
are called from the generated code, and can't open a Scope
anymore. In addition, all methods iterating over the js
stack frames need to work with ExecutionContext pointers,
not ScopedContext's.

Change-Id: I6f3013749d4e73d2fac37973b976ba6029686b82
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Cleanup the ExecutionContextSaver</title>
<updated>2015-09-15T07:37:08+00:00</updated>
<author>
<name>Lars Knoll</name>
<email>lars.knoll@theqtcompany.com</email>
</author>
<published>2015-08-21T12:55:53+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=7dab89a65ef859ef1982d5b882cb74a0a34e53a9'/>
<id>7dab89a65ef859ef1982d5b882cb74a0a34e53a9</id>
<content type='text'>
Always operate on the current context (as that's what we do
in practice anyway).

Change-Id: I4171207a7a86e69aa685754956c0764ac6e152a7
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Always operate on the current context (as that's what we do
in practice anyway).

Change-Id: I4171207a7a86e69aa685754956c0764ac6e152a7
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>V4 debugger: Fix expression evaluation</title>
<updated>2015-08-19T11:28:27+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@theqtcompany.com</email>
</author>
<published>2015-08-18T09:14:56+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=b7521acd2c77f9f7ace8d49cf1e11affe2ccbd21'/>
<id>b7521acd2c77f9f7ace8d49cf1e11affe2ccbd21</id>
<content type='text'>
We need to collect the refs in the debugService's list in order for
them to show up on addRefs() and we need to generate proper error
responses if either the debugger is not stopped or the evaluation
throws an exception.

Task-number: QTBUG-47797
Task-number: QTBUG-47816
Change-Id: I98f17c1f3976859ee50b9bfac41091276ff60982
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need to collect the refs in the debugService's list in order for
them to show up on addRefs() and we need to generate proper error
responses if either the debugger is not stopped or the evaluation
throws an exception.

Task-number: QTBUG-47797
Task-number: QTBUG-47816
Change-Id: I98f17c1f3976859ee50b9bfac41091276ff60982
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move DataCollector into debugger plugin</title>
<updated>2015-08-10T10:05:14+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@theqtcompany.com</email>
</author>
<published>2015-07-22T16:50:34+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=a2ccdd33888cb0eb4516089d3418dd01c8cca25c'/>
<id>a2ccdd33888cb0eb4516089d3418dd01c8cca25c</id>
<content type='text'>
The data collector and all the jobs it uses to interact with the engine
are only used from the debugger plugin. We can as well move them there.

Change-Id: Ia48251f08b48c7e1e607b8ae2a3d1de29f80f742
Reviewed-by: Erik Verbruggen &lt;erik.verbruggen@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The data collector and all the jobs it uses to interact with the engine
are only used from the debugger plugin. We can as well move them there.

Change-Id: Ia48251f08b48c7e1e607b8ae2a3d1de29f80f742
Reviewed-by: Erik Verbruggen &lt;erik.verbruggen@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move V4 debugger agent into the debugger plugin</title>
<updated>2015-08-10T10:05:09+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@theqtcompany.com</email>
</author>
<published>2015-07-21T16:56:32+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=bf5db2bbc1da83a9930832e628e65ec64cd4b831'/>
<id>bf5db2bbc1da83a9930832e628e65ec64cd4b831</id>
<content type='text'>
The debugger is the only thing that actually needs it. Note that for
this to work we need to make QV4::Debugging::Debugger a QObject and
add some signals. The net effect is still a reduction in binary size
of about 1kb.

Change-Id: Ibecb8cfa140fc26fc13c8cbefb3d027ebdcd28a4
Reviewed-by: Erik Verbruggen &lt;erik.verbruggen@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The debugger is the only thing that actually needs it. Note that for
this to work we need to make QV4::Debugging::Debugger a QObject and
add some signals. The net effect is still a reduction in binary size
of about 1kb.

Change-Id: Ibecb8cfa140fc26fc13c8cbefb3d027ebdcd28a4
Reviewed-by: Erik Verbruggen &lt;erik.verbruggen@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Change data collection for debugging to use QV4::Value.</title>
<updated>2015-08-10T10:05:01+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@theqtcompany.com</email>
</author>
<published>2015-07-27T12:40:26+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=dc341e6c1c524330b838a62ceeaa148a01dc0729'/>
<id>dc341e6c1c524330b838a62ceeaa148a01dc0729</id>
<content type='text'>
This patch changes the variable collection to store QV4::Value values
into a JS array, which is retained by the collector. This prevents any
GC issues, and gives a nice mapping from handle (used in the debugging
protocol) to JS value. It also allows for easy "shallow" object
serialization: any lookup can start with the QV4::Value, and add any
values it encounters to the array.

Testing is changed to use this collector directly, thereby testing the
class that is actually used to generate protocol data.

Task-number: QTBUG-47061
Change-Id: Iec75c4f74c08495e2a8af0fedf304f76f8385fd7
Reviewed-by: Erik Verbruggen &lt;erik.verbruggen@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch changes the variable collection to store QV4::Value values
into a JS array, which is retained by the collector. This prevents any
GC issues, and gives a nice mapping from handle (used in the debugging
protocol) to JS value. It also allows for easy "shallow" object
serialization: any lookup can start with the QV4::Value, and add any
values it encounters to the array.

Testing is changed to use this collector directly, thereby testing the
class that is actually used to generate protocol data.

Task-number: QTBUG-47061
Change-Id: Iec75c4f74c08495e2a8af0fedf304f76f8385fd7
Reviewed-by: Erik Verbruggen &lt;erik.verbruggen@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add namespace declarations to qv4debugging.cpp</title>
<updated>2015-07-29T14:36:29+00:00</updated>
<author>
<name>Ulf Hermann</name>
<email>ulf.hermann@theqtcompany.com</email>
</author>
<published>2015-07-28T17:18:24+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=e6114a88bbbbe3936391d180044ea89a3bcce4a0'/>
<id>e6114a88bbbbe3936391d180044ea89a3bcce4a0</id>
<content type='text'>
Change-Id: Ia7c4e6e29726276bbfe8888b2b2902abc971cad3
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ia7c4e6e29726276bbfe8888b2b2902abc971cad3
Reviewed-by: Simon Hausmann &lt;simon.hausmann@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove type punning from QV4::Value.</title>
<updated>2015-07-24T11:44:05+00:00</updated>
<author>
<name>Erik Verbruggen</name>
<email>erik.verbruggen@digia.com</email>
</author>
<published>2015-07-08T08:52:59+00:00</published>
<link rel='alternate' type='text/html' href='https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=92836d052efb6d8073136e8507083f93fb60bb80'/>
<id>92836d052efb6d8073136e8507083f93fb60bb80</id>
<content type='text'>
The union in QV4::Value is used to do type punning. In C++, this is
compiler-defined behavior. For example, Clang and GCC will try to detect
it and try to do the proper thing. However, it can play havoc with Alias
Analysis, and it is not guaranteed that some Undefined Behavior (or
Compiler depenedent behavior) might occur.

The really problematic part is the struct inside the union: depending on
the calling convention and the register size, it results in some
exciting code. For example, the AMD64 ABI specifies that a struct of two
values of INTEGER class can be passed in separate registers when doing a
function call. Now, if the AA in the compiler looses track of the fact
that the tag overlaps with the double, you might get:

    ecx := someTag
    ... conditional jumps
double_case:
    rdx := xorredDoubleValue
    callq someWhere

If the someWhere function checks for the tag first, mayhem ensues: the
double value in rdx does not overwrite the tag that is passed in ecx.

Changing the code to do reinterpret_cast&lt;&gt;s might also give problems
on 32bit architectures, because there is a double, whose size is not the
same as the size of the tag, which could confuse AA.

So, to fix this, the following is changed:
- only have a quint64 field in the QV4::Value, which has the added
  benefit that it's very clear for the compiler that it's a POD
- as memcpy is the only approved way to ensure bit-by-bit "conversion"
  between types (esp. FP&lt;-&gt;non-FP types), change all conversions to use
  memcpy. Use bitops (shift/and/or) for anything else.
- only use accessor functions for non-quint64 values

As any modern compiler has memcpy as an intrinsic, the call will be
replaced with one or a few move instructions. The accessor functions
also get inlined, the bitops get optimized, so in all cases the compiler
can generate the most compact code possible.

This patch obsoletes f558bc48585c69de36151248c969a484a969ebb4 (which had
the exact aliassing problem of the double and the tag as described
above).

Change-Id: I60a39d8564be5ce6106403a56a8de90943217006
Reviewed-by: Ulf Hermann &lt;ulf.hermann@theqtcompany.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The union in QV4::Value is used to do type punning. In C++, this is
compiler-defined behavior. For example, Clang and GCC will try to detect
it and try to do the proper thing. However, it can play havoc with Alias
Analysis, and it is not guaranteed that some Undefined Behavior (or
Compiler depenedent behavior) might occur.

The really problematic part is the struct inside the union: depending on
the calling convention and the register size, it results in some
exciting code. For example, the AMD64 ABI specifies that a struct of two
values of INTEGER class can be passed in separate registers when doing a
function call. Now, if the AA in the compiler looses track of the fact
that the tag overlaps with the double, you might get:

    ecx := someTag
    ... conditional jumps
double_case:
    rdx := xorredDoubleValue
    callq someWhere

If the someWhere function checks for the tag first, mayhem ensues: the
double value in rdx does not overwrite the tag that is passed in ecx.

Changing the code to do reinterpret_cast&lt;&gt;s might also give problems
on 32bit architectures, because there is a double, whose size is not the
same as the size of the tag, which could confuse AA.

So, to fix this, the following is changed:
- only have a quint64 field in the QV4::Value, which has the added
  benefit that it's very clear for the compiler that it's a POD
- as memcpy is the only approved way to ensure bit-by-bit "conversion"
  between types (esp. FP&lt;-&gt;non-FP types), change all conversions to use
  memcpy. Use bitops (shift/and/or) for anything else.
- only use accessor functions for non-quint64 values

As any modern compiler has memcpy as an intrinsic, the call will be
replaced with one or a few move instructions. The accessor functions
also get inlined, the bitops get optimized, so in all cases the compiler
can generate the most compact code possible.

This patch obsoletes f558bc48585c69de36151248c969a484a969ebb4 (which had
the exact aliassing problem of the double and the tag as described
above).

Change-Id: I60a39d8564be5ce6106403a56a8de90943217006
Reviewed-by: Ulf Hermann &lt;ulf.hermann@theqtcompany.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
