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

Unified Diff: test/cctest/test-hashing.cc

Issue 422063005: Contribution of PowerPC port. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: re-upload - catch up to 8/19 level Created 6 years, 4 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
Index: test/cctest/test-hashing.cc
diff --git a/test/cctest/test-hashing.cc b/test/cctest/test-hashing.cc
index 9857f9d88a248c6756dfe8713783ef046034534b..97d5918172a6e293a0a069adbbc5f4a971ebb8b7 100644
--- a/test/cctest/test-hashing.cc
+++ b/test/cctest/test-hashing.cc
@@ -129,6 +129,24 @@ void generate(MacroAssembler* masm, i::Vector<const uint8_t> string) {
__ pop(kRootRegister);
__ jr(ra);
__ nop();
+#elif V8_TARGET_ARCH_PPC
+#if ABI_USES_FUNCTION_DESCRIPTORS
+ __ function_descriptor();
+#endif
+
+ __ push(kRootRegister);
+ __ InitializeRootRegister();
+
+ __ li(r3, Operand::Zero());
+ __ li(ip, Operand(string.at(0)));
+ StringHelper::GenerateHashInit(masm, r3, ip, r0);
+ for (int i = 1; i < string.length(); i++) {
+ __ li(ip, Operand(string.at(i)));
+ StringHelper::GenerateHashAddCharacter(masm, r3, ip, r0);
+ }
+ StringHelper::GenerateHashGetHash(masm, r3, r0);
+ __ pop(kRootRegister);
+ __ blr();
#else
#error Unsupported architecture.
#endif
@@ -178,6 +196,16 @@ void generate(MacroAssembler* masm, uint32_t key) {
__ pop(kRootRegister);
__ jr(ra);
__ nop();
+#elif V8_TARGET_ARCH_PPC
+#if ABI_USES_FUNCTION_DESCRIPTORS
+ __ function_descriptor();
+#endif
+ __ push(kRootRegister);
+ __ InitializeRootRegister();
+ __ li(r3, Operand(key));
+ __ GetNumberHash(r3, ip);
+ __ pop(kRootRegister);
+ __ blr();
#else
#error Unsupported architecture.
#endif

Powered by Google App Engine
This is Rietveld 408576698