OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 | 417 |
418 const char* GetName() { return "NumberToStringStub"; } | 418 const char* GetName() { return "NumberToStringStub"; } |
419 | 419 |
420 #ifdef DEBUG | 420 #ifdef DEBUG |
421 void Print() { | 421 void Print() { |
422 PrintF("NumberToStringStub\n"); | 422 PrintF("NumberToStringStub\n"); |
423 } | 423 } |
424 #endif | 424 #endif |
425 }; | 425 }; |
426 | 426 |
427 | |
428 class StringDictionaryLookupStub: public CodeStub { | |
429 public: | |
430 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | |
431 | |
432 StringDictionaryLookupStub(Register dictionary, | |
433 Register result, | |
434 Register index, | |
435 LookupMode mode) | |
436 : dictionary_(dictionary), result_(result), index_(index), mode_(mode) { } | |
437 | |
438 void Generate(MacroAssembler* masm); | |
439 | |
440 static void GenerateNegativeLookup(MacroAssembler* masm, | |
441 Label* miss, | |
442 Label* done, | |
443 Register properties, | |
444 String* name, | |
445 Register r0); | |
446 | |
447 static void GeneratePositiveLookup(MacroAssembler* masm, | |
448 Label* miss, | |
449 Label* done, | |
450 Register elements, | |
451 Register name, | |
452 Register r0, | |
453 Register r1); | |
454 private: | |
Mads Ager (chromium)
2011/05/05 11:54:56
Ditto.
Vyacheslav Egorov (Chromium)
2011/05/05 12:30:16
Done.
| |
455 | |
456 static const int kInlinedProbes = 4; | |
457 static const int kTotalProbes = 20; | |
458 | |
459 static const int kCapacityOffset = | |
460 StringDictionary::kHeaderSize + | |
461 StringDictionary::kCapacityIndex * kPointerSize; | |
462 | |
463 static const int kElementsStartOffset = | |
464 StringDictionary::kHeaderSize + | |
465 StringDictionary::kElementsStartIndex * kPointerSize; | |
466 | |
467 | |
468 #ifdef DEBUG | |
469 void Print() { | |
470 PrintF("StringDictionaryLookupStub\n"); | |
471 } | |
472 #endif | |
473 | |
474 Major MajorKey() { return StringDictionaryNegativeLookup; } | |
475 | |
476 int MinorKey() { | |
477 return DictionaryBits::encode(dictionary_.code()) | | |
478 ResultBits::encode(result_.code()) | | |
479 IndexBits::encode(index_.code()) | | |
480 LookupModeBits::encode(mode_); | |
481 } | |
482 | |
483 class DictionaryBits: public BitField<int, 0, 3> {}; | |
484 class ResultBits: public BitField<int, 3, 3> {}; | |
485 class IndexBits: public BitField<int, 6, 3> {}; | |
486 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; | |
487 | |
488 Register dictionary_; | |
489 Register result_; | |
490 Register index_; | |
491 LookupMode mode_; | |
492 }; | |
493 | |
494 | |
427 } } // namespace v8::internal | 495 } } // namespace v8::internal |
428 | 496 |
429 #endif // V8_IA32_CODE_STUBS_IA32_H_ | 497 #endif // V8_IA32_CODE_STUBS_IA32_H_ |
OLD | NEW |