From 5454b37f308e78e240ac19947121fae344cda606 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 6 Jun 2018 14:22:38 +0200 Subject: Get rid of the unused JumpEmpty instruction Change-Id: I117687939e0f02d801dbad8de7761b4c799f2035 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4bytecodehandler.cpp | 4 ---- src/qml/compiler/qv4instr_moth.cpp | 4 ---- src/qml/compiler/qv4instr_moth_p.h | 2 -- src/qml/jit/qv4assembler.cpp | 19 ------------------- src/qml/jit/qv4assembler_p.h | 1 - src/qml/jit/qv4baselinejit.cpp | 1 - src/qml/jit/qv4baselinejit_p.h | 1 - src/qml/jsruntime/qv4vme_moth.cpp | 5 ----- 8 files changed, 37 deletions(-) (limited to 'src') diff --git a/src/qml/compiler/qv4bytecodehandler.cpp b/src/qml/compiler/qv4bytecodehandler.cpp index ccd54c7444..5709d84f58 100644 --- a/src/qml/compiler/qv4bytecodehandler.cpp +++ b/src/qml/compiler/qv4bytecodehandler.cpp @@ -387,10 +387,6 @@ std::vector ByteCodeHandler::collectLabelsInBytecode(const char *code, uint addLabel(code - start + offset); COLLECTOR_END_INSTR(JumpNotUndefined) - COLLECTOR_BEGIN_INSTR(JumpEmpty) - addLabel(code - start + offset); - COLLECTOR_END_INSTR(JumpEmpty) - COLLECTOR_BEGIN_INSTR(CmpEqNull) COLLECTOR_END_INSTR(CmpEqNull) diff --git a/src/qml/compiler/qv4instr_moth.cpp b/src/qml/compiler/qv4instr_moth.cpp index 4a11f46dc5..0fb789f479 100644 --- a/src/qml/compiler/qv4instr_moth.cpp +++ b/src/qml/compiler/qv4instr_moth.cpp @@ -522,10 +522,6 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int /*st d << ABSOLUTE_OFFSET(); MOTH_END_INSTR(JumpNoException) - MOTH_BEGIN_INSTR(JumpEmpty) - d << ABSOLUTE_OFFSET(); - MOTH_END_INSTR(JumpEmpty) - MOTH_BEGIN_INSTR(CmpEqNull) MOTH_END_INSTR(CmpEqNull) diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 3adb9c2e0f..a2bb85749b 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -148,7 +148,6 @@ QT_BEGIN_NAMESPACE #define INSTR_JumpFalse(op) INSTRUCTION(op, JumpFalse, 1, offset) #define INSTR_JumpNotUndefined(op) INSTRUCTION(op, JumpNotUndefined, 1, offset) #define INSTR_JumpNoException(op) INSTRUCTION(op, JumpNoException, 1, offset) -#define INSTR_JumpEmpty(op) INSTRUCTION(op, JumpEmpty, 1, offset) #define INSTR_CmpEqNull(op) INSTRUCTION(op, CmpEqNull, 0) #define INSTR_CmpNeNull(op) INSTRUCTION(op, CmpNeNull, 0) #define INSTR_CmpEqInt(op) INSTRUCTION(op, CmpEqInt, 1, lhs) @@ -278,7 +277,6 @@ QT_BEGIN_NAMESPACE F(JumpFalse) \ F(JumpNoException) \ F(JumpNotUndefined) \ - F(JumpEmpty) \ F(CmpEqNull) \ F(CmpNeNull) \ F(CmpEqInt) \ diff --git a/src/qml/jit/qv4assembler.cpp b/src/qml/jit/qv4assembler.cpp index 5702774cd7..bf7fb8a536 100644 --- a/src/qml/jit/qv4assembler.cpp +++ b/src/qml/jit/qv4assembler.cpp @@ -706,12 +706,6 @@ struct PlatformAssembler64 : PlatformAssemblerCommon patches.push_back({ jump, offset }); } - void jumpEmpty(int offset) - { - auto jump = branch64(Equal, AccumulatorRegister, TrustedImm64(Primitive::emptyValue().asReturnedValue())); - patches.push_back({ jump, offset }); - } - Jump jumpEmpty() { return branch64(Equal, AccumulatorRegister, TrustedImm64(Primitive::emptyValue().asReturnedValue())); @@ -1140,14 +1134,6 @@ struct PlatformAssembler32 : PlatformAssemblerCommon patches.push_back({ jump, offset }); } - void jumpEmpty(int offset) - { - auto notEqual = branch32(NotEqual, AccumulatorRegisterTag, TrustedImm32(Primitive::emptyValue().asReturnedValue() >> 32)); - auto jump = branch32(Equal, AccumulatorRegisterValue, TrustedImm32(Primitive::emptyValue().asReturnedValue() & 0xffffffff)); - notEqual.link(this); - patches.push_back({ jump, offset }); - } - Jump jumpEmpty() { return branch32(Equal, AccumulatorRegisterTag, TrustedImm32(Primitive::emptyValue().asReturnedValue() >> 32)); @@ -1986,11 +1972,6 @@ void Assembler::jumpNotUndefined(int offset) pasm()->jumpNotUndefined(offset); } -void JIT::Assembler::jumpEmpty(int offset) -{ - pasm()->jumpEmpty(offset); -} - void Assembler::prepareCallWithArgCount(int argc) { #ifndef QT_NO_DEBUG diff --git a/src/qml/jit/qv4assembler_p.h b/src/qml/jit/qv4assembler_p.h index d41b79f562..ac30a534df 100644 --- a/src/qml/jit/qv4assembler_p.h +++ b/src/qml/jit/qv4assembler_p.h @@ -142,7 +142,6 @@ public: void jumpFalse(int offset); void jumpNoException(int offset); void jumpNotUndefined(int offset); - void jumpEmpty(int offset); // stuff for runtime calls void prepareCallWithArgCount(int argc); diff --git a/src/qml/jit/qv4baselinejit.cpp b/src/qml/jit/qv4baselinejit.cpp index 6c298d9331..b994d38c2b 100644 --- a/src/qml/jit/qv4baselinejit.cpp +++ b/src/qml/jit/qv4baselinejit.cpp @@ -904,7 +904,6 @@ void BaselineJIT::generate_JumpTrue(int offset) { as->jumpTrue(instructionOffset void BaselineJIT::generate_JumpFalse(int offset) { as->jumpFalse(instructionOffset() + offset); } void BaselineJIT::generate_JumpNoException(int offset) { as->jumpNoException(instructionOffset() + offset); } void BaselineJIT::generate_JumpNotUndefined(int offset) { as->jumpNotUndefined(instructionOffset() + offset); } -void BaselineJIT::generate_JumpEmpty(int offset) { as->jumpEmpty(instructionOffset() + offset); } void BaselineJIT::generate_CmpEqNull() { as->cmpeqNull(); } void BaselineJIT::generate_CmpNeNull() { as->cmpneNull(); } diff --git a/src/qml/jit/qv4baselinejit_p.h b/src/qml/jit/qv4baselinejit_p.h index 5441ea974b..112cb92c75 100644 --- a/src/qml/jit/qv4baselinejit_p.h +++ b/src/qml/jit/qv4baselinejit_p.h @@ -165,7 +165,6 @@ public: void generate_JumpFalse(int offset) override; void generate_JumpNoException(int offset) override; void generate_JumpNotUndefined(int offset) override; - void generate_JumpEmpty(int offset) override; void generate_CmpEqNull() override; void generate_CmpNeNull() override; void generate_CmpEqInt(int lhs) override; diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp index 165902ed36..a5d114dd78 100644 --- a/src/qml/jsruntime/qv4vme_moth.cpp +++ b/src/qml/jsruntime/qv4vme_moth.cpp @@ -1127,11 +1127,6 @@ QV4::ReturnedValue VME::interpret(CppStackFrame &frame, const char *code) code += offset; MOTH_END_INSTR(JumpNotUndefined) - MOTH_BEGIN_INSTR(JumpEmpty) - if (Q_UNLIKELY(acc == QV4::Primitive::emptyValue().asReturnedValue())) - code += offset; - MOTH_END_INSTR(JumpEmpty) - MOTH_BEGIN_INSTR(CmpEqNull) acc = Encode(ACC.isNullOrUndefined()); MOTH_END_INSTR(CmpEqNull) -- cgit v1.2.3