aboutsummaryrefslogtreecommitdiffstats
path: root/qv4isel_masm.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-12-11 14:43:50 +0100
committerLars Knoll <lars.knoll@digia.com>2012-12-12 11:50:43 +0100
commit018af32fc2d902ff47482d0501195f7e0739cdcf (patch)
treeae9d1fe09df944d00fd69f0cb60d7caddd3910b8 /qv4isel_masm.cpp
parent5cf108e7a530229f4c9fa2751ec0aac42924fea6 (diff)
Cleanup: Added a storeValue() overload that operates on an IR::Temp*
Change-Id: Iab23eaa41f4ef4d3f99dccd6d2075fa4ba8e918e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'qv4isel_masm.cpp')
-rw-r--r--qv4isel_masm.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/qv4isel_masm.cpp b/qv4isel_masm.cpp
index b3d7b781e3..09147e4bcd 100644
--- a/qv4isel_masm.cpp
+++ b/qv4isel_masm.cpp
@@ -117,6 +117,12 @@ void Assembler::copyValue(Result result, Source source)
#endif
}
+void Assembler::storeValue(VM::Value value, IR::Temp* destination)
+{
+ Address addr = loadTempAddress(ScratchRegister, destination);
+ storeValue(value, addr);
+}
+
void Assembler::enterStandardStackFrame(int locals)
{
#if CPU(ARM)
@@ -471,9 +477,7 @@ void InstructionSelection::callActivationProperty(IR::Call *call, IR::Temp *resu
return;
} else if (call->args->expr->asTemp()){
// ### should throw in strict mode
- Address dest = _asm->loadTempAddress(Assembler::ScratchRegister, result);
- Value v = Value::fromBoolean(false);
- _asm->storeValue(v, dest);
+ _asm->storeValue(Value::fromBoolean(false), result);
return;
}
break;
@@ -633,22 +637,19 @@ void InstructionSelection::visitMove(IR::Move *s)
}
return;
} else if (IR::Const *c = s->source->asConst()) {
- Address dest = _asm->loadTempAddress(Assembler::ScratchRegister, t);
Value v = convertToValue(c);
- _asm->storeValue(v, dest);
+ _asm->storeValue(t, dest);
return;
} else if (IR::Temp *t2 = s->source->asTemp()) {
_asm->copyValue(t, t2);
return;
} else if (IR::String *str = s->source->asString()) {
- Address dest = _asm->loadTempAddress(Assembler::ScratchRegister, t);
Value v = Value::fromString(engine()->newString(*str->value));
- _asm->storeValue(v, dest);
+ _asm->storeValue(v, t);
return;
} else if (IR::RegExp *re = s->source->asRegExp()) {
- Address dest = _asm->loadTempAddress(Assembler::ScratchRegister, t);
Value v = Value::fromObject(engine()->newRegExpObject(*re->value, re->flags));
- _asm->storeValue(v, dest);
+ _asm->storeValue(v, t);
return;
} else if (IR::Closure *clos = s->source->asClosure()) {
VM::Function *vmFunc = vmFunction(clos->value);