Index: runtime/vm/object_arm_test.cc |
=================================================================== |
--- runtime/vm/object_arm_test.cc (revision 21676) |
+++ runtime/vm/object_arm_test.cc (working copy) |
@@ -18,21 +18,38 @@ |
// Generate a simple dart code sequence. |
// This is used to test Code and Instruction object creation. |
void GenerateIncrement(Assembler* assembler) { |
- __ Unimplemented("GenerateIncrement"); |
+ __ LoadImmediate(R0, 0); |
+ __ Push(R0); |
+ __ ldr(IP, Address(SP, 0)); |
+ __ add(IP, IP, ShifterOperand(1)); |
+ __ str(IP, Address(SP, 0)); |
+ __ ldr(IP, Address(SP, 0)); |
+ __ add(IP, IP, ShifterOperand(1)); |
+ __ Pop(R0); |
+ __ mov(R0, ShifterOperand(IP)); |
+ __ Ret(); |
} |
// Generate a dart code sequence that embeds a string object in it. |
// This is used to test Embedded String objects in the instructions. |
void GenerateEmbedStringInCode(Assembler* assembler, const char* str) { |
- __ Unimplemented("GenerateEmbedStringInCode"); |
+ __ EnterDartFrame(0); // To setup pp. |
+ const String& string_object = |
+ String::ZoneHandle(String::New(str, Heap::kOld)); |
+ __ LoadObject(R0, string_object); |
+ __ LeaveDartFrame(); |
+ __ Ret(); |
} |
// Generate a dart code sequence that embeds a smi object in it. |
// This is used to test Embedded Smi objects in the instructions. |
void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) { |
- __ Unimplemented("GenerateEmbedSmiInCode"); |
+ // No need to setup pp, since Smis are not stored in the object pool. |
+ const Smi& smi_object = Smi::ZoneHandle(Smi::New(value)); |
+ __ LoadObject(R0, smi_object); |
+ __ Ret(); |
} |
} // namespace dart |