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

Side by Side Diff: test/cctest/test-hashing.cc

Issue 207823003: Rename A64 port to ARM64 port (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: retry Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-fuzz-arm64.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 __ mov(r0, Operand(0)); 89 __ mov(r0, Operand(0));
90 __ mov(ip, Operand(string.at(0))); 90 __ mov(ip, Operand(string.at(0)));
91 StringHelper::GenerateHashInit(masm, r0, ip); 91 StringHelper::GenerateHashInit(masm, r0, ip);
92 for (int i = 1; i < string.length(); i++) { 92 for (int i = 1; i < string.length(); i++) {
93 __ mov(ip, Operand(string.at(i))); 93 __ mov(ip, Operand(string.at(i)));
94 StringHelper::GenerateHashAddCharacter(masm, r0, ip); 94 StringHelper::GenerateHashAddCharacter(masm, r0, ip);
95 } 95 }
96 StringHelper::GenerateHashGetHash(masm, r0); 96 StringHelper::GenerateHashGetHash(masm, r0);
97 __ pop(kRootRegister); 97 __ pop(kRootRegister);
98 __ mov(pc, Operand(lr)); 98 __ mov(pc, Operand(lr));
99 #elif V8_TARGET_ARCH_A64 99 #elif V8_TARGET_ARCH_ARM64
100 // The A64 assembler usually uses jssp (x28) as a stack pointer, but only csp 100 // The ARM64 assembler usually uses jssp (x28) as a stack pointer, but only
101 // is initialized by the calling (C++) code. 101 // csp is initialized by the calling (C++) code.
102 Register old_stack_pointer = __ StackPointer(); 102 Register old_stack_pointer = __ StackPointer();
103 __ SetStackPointer(csp); 103 __ SetStackPointer(csp);
104 __ Push(root, xzr); 104 __ Push(root, xzr);
105 __ InitializeRootRegister(); 105 __ InitializeRootRegister();
106 __ Mov(x0, 0); 106 __ Mov(x0, 0);
107 __ Mov(x10, Operand(string.at(0))); 107 __ Mov(x10, Operand(string.at(0)));
108 StringHelper::GenerateHashInit(masm, x0, x10); 108 StringHelper::GenerateHashInit(masm, x0, x10);
109 for (int i = 1; i < string.length(); i++) { 109 for (int i = 1; i < string.length(); i++) {
110 __ Mov(x10, Operand(string.at(i))); 110 __ Mov(x10, Operand(string.at(i)));
111 StringHelper::GenerateHashAddCharacter(masm, x0, x10); 111 StringHelper::GenerateHashAddCharacter(masm, x0, x10);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 __ popq(rbx); 151 __ popq(rbx);
152 __ popq(kRootRegister); 152 __ popq(kRootRegister);
153 __ Ret(); 153 __ Ret();
154 #elif V8_TARGET_ARCH_ARM 154 #elif V8_TARGET_ARCH_ARM
155 __ push(kRootRegister); 155 __ push(kRootRegister);
156 __ InitializeRootRegister(); 156 __ InitializeRootRegister();
157 __ mov(r0, Operand(key)); 157 __ mov(r0, Operand(key));
158 __ GetNumberHash(r0, ip); 158 __ GetNumberHash(r0, ip);
159 __ pop(kRootRegister); 159 __ pop(kRootRegister);
160 __ mov(pc, Operand(lr)); 160 __ mov(pc, Operand(lr));
161 #elif V8_TARGET_ARCH_A64 161 #elif V8_TARGET_ARCH_ARM64
162 // The A64 assembler usually uses jssp (x28) as a stack pointer, but only csp 162 // The ARM64 assembler usually uses jssp (x28) as a stack pointer, but only
163 // is initialized by the calling (C++) code. 163 // csp is initialized by the calling (C++) code.
164 Register old_stack_pointer = __ StackPointer(); 164 Register old_stack_pointer = __ StackPointer();
165 __ SetStackPointer(csp); 165 __ SetStackPointer(csp);
166 __ Push(root, xzr); 166 __ Push(root, xzr);
167 __ InitializeRootRegister(); 167 __ InitializeRootRegister();
168 __ Mov(x0, key); 168 __ Mov(x0, key);
169 __ GetNumberHash(x0, x10); 169 __ GetNumberHash(x0, x10);
170 __ Pop(xzr, root); 170 __ Pop(xzr, root);
171 __ Ret(); 171 __ Ret();
172 __ SetStackPointer(old_stack_pointer); 172 __ SetStackPointer(old_stack_pointer);
173 #elif V8_TARGET_ARCH_MIPS 173 #elif V8_TARGET_ARCH_MIPS
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 // Some pseudo-random numbers 297 // Some pseudo-random numbers
298 static const uint32_t kLimit = 1000; 298 static const uint32_t kLimit = 1000;
299 for (uint32_t i = 0; i < 5; i++) { 299 for (uint32_t i = 0; i < 5; i++) {
300 for (uint32_t j = 0; j < 5; j++) { 300 for (uint32_t j = 0; j < 5; j++) {
301 check(PseudoRandom(i, j) % kLimit); 301 check(PseudoRandom(i, j) % kLimit);
302 } 302 }
303 } 303 }
304 } 304 }
305 305
306 #undef __ 306 #undef __
OLDNEW
« no previous file with comments | « test/cctest/test-fuzz-arm64.cc ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698