aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2016-08-19 13:27:33 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2016-08-24 08:50:59 +0000
commit92debe6b2c69c959cb2bc27bf788edcef5e9f292 (patch)
treeefe5453500b7596c25c50d223347f91313d27266
parent3b08205d2dea5a324b52308ed36da36b1989ab78 (diff)
V4: Replace foreach with for in masm
Change-Id: Idb01fb9272ccbe69263d1152996ab18c72a393fe Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/qml/jit/qv4isel_masm.cpp14
-rw-r--r--src/qml/jit/qv4targetplatform_p.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index 9759b72794..8211dab0b3 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -151,7 +151,7 @@ JSC::MacroAssemblerCodeRef Assembler::link(int *codeSize)
IR::BasicBlock *block = it.key();
Label target = _addrs.value(block);
Q_ASSERT(target.isSet());
- foreach (Jump jump, it.value())
+ for (Jump jump : qAsConst(it.value()))
jump.linkTo(target, this);
}
}
@@ -159,11 +159,11 @@ JSC::MacroAssemblerCodeRef Assembler::link(int *codeSize)
JSC::JSGlobalData dummy(_executableAllocator);
JSC::LinkBuffer linkBuffer(dummy, this, 0);
- foreach (const DataLabelPatch &p, _dataLabelPatches)
+ for (const DataLabelPatch &p : qAsConst(_dataLabelPatches))
linkBuffer.patch(p.dataLabel, linkBuffer.locationOf(p.target));
// link exception handlers
- foreach(Jump jump, exceptionPropagationJumps)
+ for (Jump jump : qAsConst(exceptionPropagationJumps))
linkBuffer.link(jump, linkBuffer.locationOf(exceptionReturnLabel));
{
@@ -173,7 +173,7 @@ JSC::MacroAssemblerCodeRef Assembler::link(int *codeSize)
IR::BasicBlock *block = it.key();
Label target = _addrs.value(block);
Q_ASSERT(target.isSet());
- foreach (DataLabelPtr label, it.value())
+ for (DataLabelPtr label : qAsConst(it.value()))
linkBuffer.patch(label, linkBuffer.locationOf(target));
}
}
@@ -188,7 +188,7 @@ JSC::MacroAssemblerCodeRef Assembler::link(int *codeSize)
if (showCode) {
QHash<void*, const char*> functions;
#ifndef QT_NO_DEBUG
- foreach (CallInfo call, _callInfos)
+ for (CallInfo call : qAsConst(_callInfos))
functions[linkBuffer.locationOf(call.label).dataLocation()] = call.functionName;
#endif
@@ -344,7 +344,7 @@ void InstructionSelection::run(int functionIndex)
continue;
_as->registerBlock(_block, nextBlock);
- foreach (IR::Stmt *s, _block->statements()) {
+ for (IR::Stmt *s : _block->statements()) {
if (s->location.isValid()) {
if (int(s->location.startLine) != lastLine) {
_as->loadPtr(Address(Assembler::EngineRegister, qOffsetOf(QV4::ExecutionEngine, current)), Assembler::ScratchRegister);
@@ -1689,7 +1689,7 @@ void InstructionSelection::calculateRegistersToSave(const RegisterInformation &u
regularRegistersToSave.clear();
fpRegistersToSave.clear();
- foreach (const RegisterInfo &ri, Assembler::getRegisterInfo()) {
+ for (const RegisterInfo &ri : Assembler::getRegisterInfo()) {
#if defined(RESTORE_EBX_ON_CALL)
if (ri.isRegularRegister() && ri.reg<JSC::X86Registers::RegisterID>() == JSC::X86Registers::ebx) {
regularRegistersToSave.append(ri);
diff --git a/src/qml/jit/qv4targetplatform_p.h b/src/qml/jit/qv4targetplatform_p.h
index 6f0a7374c3..7e265258d5 100644
--- a/src/qml/jit/qv4targetplatform_p.h
+++ b/src/qml/jit/qv4targetplatform_p.h
@@ -563,7 +563,7 @@ public:
#endif // Linux on MIPS (32 bit)
public: // utility functions
- static RegisterInformation getRegisterInfo()
+ static const RegisterInformation getRegisterInfo()
{
static const RegisterInformation info = getPlatformRegisterInfo();