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

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

Issue 6932010: Unroll more StringDictionary lookup probes both for positive and negative dictionary lookups. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ported to arm&x64, cleaned up ia32 impl Created 9 years, 7 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
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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 const char* GetName() { return "NumberToStringStub"; } 414 const char* GetName() { return "NumberToStringStub"; }
415 415
416 #ifdef DEBUG 416 #ifdef DEBUG
417 void Print() { 417 void Print() {
418 PrintF("NumberToStringStub\n"); 418 PrintF("NumberToStringStub\n");
419 } 419 }
420 #endif 420 #endif
421 }; 421 };
422 422
423 423
424 class StringDictionaryLookupStub: public CodeStub {
425 public:
426 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP };
427
428 StringDictionaryLookupStub(Register dictionary,
429 Register result,
430 Register index,
431 LookupMode mode)
432 : dictionary_(dictionary), result_(result), index_(index), mode_(mode) { }
433
434 void Generate(MacroAssembler* masm);
435
436 static void GenerateNegativeLookup(MacroAssembler* masm,
437 Label* miss,
438 Label* done,
439 Register properties,
440 String* name,
441 Register r0);
442
443 static void GeneratePositiveLookup(MacroAssembler* masm,
444 Label* miss,
445 Label* done,
446 Register elements,
447 Register name,
448 Register r0,
449 Register r1);
450 private:
Mads Ager (chromium) 2011/05/05 11:54:56 Move.
Vyacheslav Egorov (Chromium) 2011/05/05 12:30:16 Done.
451
452 static const int kInlinedProbes = 4;
453 static const int kTotalProbes = 20;
454
455 static const int kCapacityOffset =
456 StringDictionary::kHeaderSize +
457 StringDictionary::kCapacityIndex * kPointerSize;
458
459 static const int kElementsStartOffset =
460 StringDictionary::kHeaderSize +
461 StringDictionary::kElementsStartIndex * kPointerSize;
462
463
464 #ifdef DEBUG
465 void Print() {
466 PrintF("StringDictionaryLookupStub\n");
467 }
468 #endif
469
470 Major MajorKey() { return StringDictionaryNegativeLookup; }
471
472 int MinorKey() {
473 return DictionaryBits::encode(dictionary_.code()) |
474 ResultBits::encode(result_.code()) |
475 IndexBits::encode(index_.code()) |
476 LookupModeBits::encode(mode_);
477 }
478
479 class DictionaryBits: public BitField<int, 0, 4> {};
480 class ResultBits: public BitField<int, 4, 4> {};
481 class IndexBits: public BitField<int, 8, 4> {};
482 class LookupModeBits: public BitField<LookupMode, 12, 1> {};
483
484 Register dictionary_;
485 Register result_;
486 Register index_;
487 LookupMode mode_;
488 };
489
490
424 } } // namespace v8::internal 491 } } // namespace v8::internal
425 492
426 #endif // V8_X64_CODE_STUBS_X64_H_ 493 #endif // V8_X64_CODE_STUBS_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698