Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Unified Diff: runtime/vm/object_mips_test.cc

Issue 14273015: Implements exception handler stub on MIPS. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_mips_test.cc
===================================================================
--- runtime/vm/object_mips_test.cc (revision 21819)
+++ runtime/vm/object_mips_test.cc (working copy)
@@ -18,21 +18,37 @@
// Generate a simple dart code sequence.
// This is used to test Code and Instruction object creation.
void GenerateIncrement(Assembler* assembler) {
- __ Unimplemented("GenerateIncrement");
+ __ Push(ZR);
+ __ lw(TMP1, Address(SP, 0));
+ __ addiu(TMP1, TMP1, Immediate(1));
+ __ sw(TMP1, Address(SP, 0));
+ __ lw(TMP1, Address(SP, 0));
+ __ addiu(TMP1, TMP1, Immediate(1));
+ __ Pop(V0);
+ __ mov(V0, TMP1);
+ __ 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(V0, 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(V0, smi_object);
+ __ Ret();
}
} // namespace dart
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698