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

Unified Diff: runtime/vm/object_x64_test.cc

Issue 8758012: Port object tests to x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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/object_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_x64_test.cc
===================================================================
--- runtime/vm/object_x64_test.cc (revision 1958)
+++ runtime/vm/object_x64_test.cc (working copy)
@@ -18,30 +18,34 @@
// Generate a simple dart code sequence.
// This is used to test Code and Instruction object creation.
void GenerateIncrement(Assembler* assembler) {
- __ Unimplemented("GenerateIncrement");
+ __ movq(RAX, Immediate(0));
+ __ pushq(RAX);
+ __ incq(Address(RSP, 0));
+ __ movq(RCX, Address(RSP, 0));
+ __ incq(RCX);
+ __ popq(RAX);
+ __ movq(RAX, RCX);
+ __ 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");
+ const String& string_object = String::ZoneHandle(String::New(str));
+ __ LoadObject(RAX, string_object);
+ __ 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, int value) {
- __ Unimplemented("GenerateEmbedSmiInCode");
+void GenerateEmbedSmiInCode(Assembler* assembler, intptr_t value) {
+ const Smi& smi_object = Smi::ZoneHandle(Smi::New(value));
+ __ LoadObject(RAX, smi_object);
+ __ ret();
}
-
-// Generate code for a simple static dart function that returns 42.
-// This is used to test invocation of dart functions from C++.
-void GenerateReturn42(Assembler* assembler) {
- __ Unimplemented("GenerateReturn42");
-}
-
} // namespace dart
#endif // defined TARGET_ARCH_X64
« no previous file with comments | « runtime/vm/object_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698