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

Unified Diff: test/cctest/test-macro-assembler-mips.cc

Issue 24266007: MIPS: Fixed a bug in CopyBytes() and new test cases for MIPS macro assembler. (Closed) Base URL: https://github.com/v8/v8.git@gbl
Patch Set: fix comments. Created 7 years, 3 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 | « test/cctest/cctest.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-macro-assembler-mips.cc
diff --git a/test/cctest/test-macro-assembler-arm.cc b/test/cctest/test-macro-assembler-mips.cc
similarity index 87%
copy from test/cctest/test-macro-assembler-arm.cc
copy to test/cctest/test-macro-assembler-mips.cc
index 77f7abbd44356c7684e90c99cd12d77247a60cba..b20094967970feb682f791a050d322297758359a 100644
--- a/test/cctest/test-macro-assembler-arm.cc
+++ b/test/cctest/test-macro-assembler-mips.cc
@@ -29,8 +29,8 @@
#include "v8.h"
#include "macro-assembler.h"
-#include "arm/macro-assembler-arm.h"
-#include "arm/simulator-arm.h"
+#include "mips/macro-assembler-mips.h"
+#include "mips/simulator-mips.h"
#include "cctest.h"
@@ -73,21 +73,21 @@ TEST(CopyBytes) {
CHECK(dest_buffer);
CHECK(act_size >= static_cast<size_t>(data_size));
- // Storage for R0 and R1.
- byte* r0_;
- byte* r1_;
+ // Storage for a0 and a1.
+ byte* a0_;
+ byte* a1_;
MacroAssembler assembler(isolate, NULL, 0);
MacroAssembler* masm = &assembler;
- // Code to be generated: The stuff in CopyBytes followed by a store of R0 and
- // R1, respectively.
- __ CopyBytes(r0, r1, r2, r3);
- __ mov(r2, Operand(reinterpret_cast<int>(&r0_)));
- __ mov(r3, Operand(reinterpret_cast<int>(&r1_)));
- __ str(r0, MemOperand(r2));
- __ str(r1, MemOperand(r3));
- __ bx(lr);
+ // Code to be generated: The stuff in CopyBytes followed by a store of a0 and
+ // a1, respectively.
+ __ CopyBytes(a0, a1, a2, a3);
+ __ li(a2, Operand(reinterpret_cast<int>(&a0_)));
+ __ li(a3, Operand(reinterpret_cast<int>(&a1_)));
+ __ sw(a0, MemOperand(a2));
+ __ jr(ra);
+ __ sw(a1, MemOperand(a3));
CodeDesc desc;
masm->GetCode(&desc);
@@ -97,7 +97,7 @@ TEST(CopyBytes) {
Handle<Code>())->ToObjectChecked();
CHECK(code->IsCode());
- F f = FUNCTION_CAST<F>(Code::cast(code)->entry());
+ ::F f = FUNCTION_CAST< ::F>(Code::cast(code)->entry());
// Initialise source data with non-zero bytes.
for (int i = 0; i < data_size; i++) {
@@ -113,9 +113,9 @@ TEST(CopyBytes) {
CHECK(dest + size < dest_buffer + data_size);
(void) CALL_GENERATED_CODE(f, reinterpret_cast<int>(src),
reinterpret_cast<int>(dest), size, 0, 0);
- // R0 and R1 should point at the first byte after the copied data.
- CHECK_EQ(src + size, r0_);
- CHECK_EQ(dest + size, r1_);
+ // a0 and a1 should point at the first byte after the copied data.
+ CHECK_EQ(src + size, a0_);
+ CHECK_EQ(dest + size, a1_);
// Check that we haven't written outside the target area.
CHECK(all_zeroes(dest_buffer, dest));
CHECK(all_zeroes(dest + size, dest_buffer + data_size));
« no previous file with comments | « test/cctest/cctest.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698