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

Side by Side Diff: src/mips/code-stubs-mips.h

Issue 8512004: Fixing generated hash function on all platforms. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/mips/code-stubs-mips.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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 virtual void FinishCode(Code* code) { 239 virtual void FinishCode(Code* code) {
240 code->set_binary_op_type(operands_type_); 240 code->set_binary_op_type(operands_type_);
241 code->set_binary_op_result_type(result_type_); 241 code->set_binary_op_result_type(result_type_);
242 } 242 }
243 243
244 friend class CodeGenerator; 244 friend class CodeGenerator;
245 }; 245 };
246 246
247 247
248 class StringHelper : public AllStatic {
249 public:
250 // Generate code for copying characters using a simple loop. This should only
251 // be used in places where the number of characters is small and the
252 // additional setup and checking in GenerateCopyCharactersLong adds too much
253 // overhead. Copying of overlapping regions is not supported.
254 // Dest register ends at the position after the last character written.
255 static void GenerateCopyCharacters(MacroAssembler* masm,
256 Register dest,
257 Register src,
258 Register count,
259 Register scratch,
260 bool ascii);
261
262 // Generate code for copying a large number of characters. This function
263 // is allowed to spend extra time setting up conditions to make copying
264 // faster. Copying of overlapping regions is not supported.
265 // Dest register ends at the position after the last character written.
266 static void GenerateCopyCharactersLong(MacroAssembler* masm,
267 Register dest,
268 Register src,
269 Register count,
270 Register scratch1,
271 Register scratch2,
272 Register scratch3,
273 Register scratch4,
274 Register scratch5,
275 int flags);
276
277
278 // Probe the symbol table for a two character string. If the string is
279 // not found by probing a jump to the label not_found is performed. This jump
280 // does not guarantee that the string is not in the symbol table. If the
281 // string is found the code falls through with the string in register r0.
282 // Contents of both c1 and c2 registers are modified. At the exit c1 is
283 // guaranteed to contain halfword with low and high bytes equal to
284 // initial contents of c1 and c2 respectively.
285 static void GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm,
286 Register c1,
287 Register c2,
288 Register scratch1,
289 Register scratch2,
290 Register scratch3,
291 Register scratch4,
292 Register scratch5,
293 Label* not_found);
294
295 // Generate string hash.
296 static void GenerateHashInit(MacroAssembler* masm,
297 Register hash,
298 Register character);
299
300 static void GenerateHashAddCharacter(MacroAssembler* masm,
301 Register hash,
302 Register character);
303
304 static void GenerateHashGetHash(MacroAssembler* masm,
305 Register hash);
306
307 private:
308 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
309 };
310
311
248 // Flag that indicates how to generate code for the stub StringAddStub. 312 // Flag that indicates how to generate code for the stub StringAddStub.
249 enum StringAddFlags { 313 enum StringAddFlags {
250 NO_STRING_ADD_FLAGS = 0, 314 NO_STRING_ADD_FLAGS = 0,
251 // Omit left string check in stub (left is definitely a string). 315 // Omit left string check in stub (left is definitely a string).
252 NO_STRING_CHECK_LEFT_IN_STUB = 1 << 0, 316 NO_STRING_CHECK_LEFT_IN_STUB = 1 << 0,
253 // Omit right string check in stub (right is definitely a string). 317 // Omit right string check in stub (right is definitely a string).
254 NO_STRING_CHECK_RIGHT_IN_STUB = 1 << 1, 318 NO_STRING_CHECK_RIGHT_IN_STUB = 1 << 1,
255 // Omit both string checks in stub. 319 // Omit both string checks in stub.
256 NO_STRING_CHECK_IN_STUB = 320 NO_STRING_CHECK_IN_STUB =
257 NO_STRING_CHECK_LEFT_IN_STUB | NO_STRING_CHECK_RIGHT_IN_STUB 321 NO_STRING_CHECK_LEFT_IN_STUB | NO_STRING_CHECK_RIGHT_IN_STUB
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 894
831 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 895 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
832 896
833 LookupMode mode_; 897 LookupMode mode_;
834 }; 898 };
835 899
836 900
837 } } // namespace v8::internal 901 } } // namespace v8::internal
838 902
839 #endif // V8_MIPS_CODE_STUBS_ARM_H_ 903 #endif // V8_MIPS_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698