Index: test/cctest/test-hashing.cc |
diff --git a/test/cctest/test-hashing.cc b/test/cctest/test-hashing.cc |
index 0e2c6676e2eafea5c63c2dfeefd0fdc94b5f2026..7eda01379387da20a16b553b5abcf7e6d4b8d7f5 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 |