diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-02-05 14:38:03 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-05 16:14:56 +0100 |
commit | 4dfe58d27ced74c0e28c1764ac036d7ec27f14c9 (patch) | |
tree | a18f06e009fea392bf7fd960f1cf4bce01fcd46b /src/qml/compiler/qv4instr_moth_p.h | |
parent | 1cf089f9d436715955d6eb267ff609d7fafad78c (diff) |
Add a special Debug instruction to the interpreter and use it
This avoid having to check for the debugger at every instruction
we execute. Instead we only add debug instructions at the beginning
of every line and every basic block when we have a debugger.
This still allows interrupting the JS execution at any time (as we
can't loop inside a basic block), and single stepping through lines.
But it has no overhead when the debugger is not running and a lot
less when it is running.
Change-Id: Ib17170b42944b608fc6caa1891082205dd2b2763
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4instr_moth_p.h')
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 293452cf47..bd8fc2301d 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE #define FOR_EACH_MOTH_INSTR(F) \ F(Ret, ret) \ + F(Debug, debug) \ F(LoadRuntimeString, loadRuntimeString) \ F(LoadRegExp, loadRegExp) \ F(LoadClosure, loadClosure) \ @@ -142,11 +143,9 @@ QT_BEGIN_NAMESPACE #define MOTH_INSTR_ALIGN_MASK (Q_ALIGNOF(QQmlJS::Moth::Instr) - 1) #ifdef MOTH_THREADED_INTERPRETER -# define MOTH_INSTR_HEADER void *code; \ - unsigned int breakPoint : 1; +# define MOTH_INSTR_HEADER void *code; #else -# define MOTH_INSTR_HEADER quint8 instructionType; \ - unsigned int breakPoint : 1; +# define MOTH_INSTR_HEADER quint32 instructionType; #endif #define MOTH_INSTR_ENUM(I, FMT) I, @@ -234,6 +233,10 @@ union Instr MOTH_INSTR_HEADER Param result; }; + struct instr_debug { + MOTH_INSTR_HEADER + quint32 breakPoint; + }; struct instr_loadRuntimeString { MOTH_INSTR_HEADER int stringId; @@ -703,6 +706,7 @@ union Instr instr_common common; instr_ret ret; + instr_debug debug; instr_loadRuntimeString loadRuntimeString; instr_loadRegExp loadRegExp; instr_move move; |