OLD | NEW |
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void GenerateOperation(MacroAssembler* masm); | 58 void GenerateOperation(MacroAssembler* masm); |
59 }; | 59 }; |
60 | 60 |
61 | 61 |
62 class ToBooleanStub: public CodeStub { | 62 class ToBooleanStub: public CodeStub { |
63 public: | 63 public: |
64 ToBooleanStub() { } | 64 ToBooleanStub() { } |
65 | 65 |
66 void Generate(MacroAssembler* masm); | 66 void Generate(MacroAssembler* masm); |
67 | 67 |
| 68 virtual bool SometimesSetsUpAFrame() { return false; } |
| 69 |
68 private: | 70 private: |
69 Major MajorKey() { return ToBoolean; } | 71 Major MajorKey() { return ToBoolean; } |
70 int MinorKey() { return 0; } | 72 int MinorKey() { return 0; } |
71 }; | 73 }; |
72 | 74 |
73 | 75 |
74 class UnaryOpStub: public CodeStub { | 76 class UnaryOpStub: public CodeStub { |
75 public: | 77 public: |
76 UnaryOpStub(Token::Value op, UnaryOverwriteMode mode) | 78 UnaryOpStub(Token::Value op, UnaryOverwriteMode mode) |
77 : op_(op), | 79 : op_(op), |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 Register r0); | 464 Register r0); |
463 | 465 |
464 static void GeneratePositiveLookup(MacroAssembler* masm, | 466 static void GeneratePositiveLookup(MacroAssembler* masm, |
465 Label* miss, | 467 Label* miss, |
466 Label* done, | 468 Label* done, |
467 Register elements, | 469 Register elements, |
468 Register name, | 470 Register name, |
469 Register r0, | 471 Register r0, |
470 Register r1); | 472 Register r1); |
471 | 473 |
| 474 virtual bool SometimesSetsUpAFrame() { return false; } |
| 475 |
472 private: | 476 private: |
473 static const int kInlinedProbes = 4; | 477 static const int kInlinedProbes = 4; |
474 static const int kTotalProbes = 20; | 478 static const int kTotalProbes = 20; |
475 | 479 |
476 static const int kCapacityOffset = | 480 static const int kCapacityOffset = |
477 StringDictionary::kHeaderSize + | 481 StringDictionary::kHeaderSize + |
478 StringDictionary::kCapacityIndex * kPointerSize; | 482 StringDictionary::kCapacityIndex * kPointerSize; |
479 | 483 |
480 static const int kElementsStartOffset = | 484 static const int kElementsStartOffset = |
481 StringDictionary::kHeaderSize + | 485 StringDictionary::kHeaderSize + |
482 StringDictionary::kElementsStartIndex * kPointerSize; | 486 StringDictionary::kElementsStartIndex * kPointerSize; |
483 | 487 |
484 | 488 |
485 #ifdef DEBUG | 489 #ifdef DEBUG |
486 void Print() { | 490 void Print() { |
487 PrintF("StringDictionaryLookupStub\n"); | 491 PrintF("StringDictionaryLookupStub\n"); |
488 } | 492 } |
489 #endif | 493 #endif |
490 | 494 |
491 Major MajorKey() { return StringDictionaryNegativeLookup; } | 495 Major MajorKey() { return StringDictionaryLookup; } |
492 | 496 |
493 int MinorKey() { | 497 int MinorKey() { |
494 return DictionaryBits::encode(dictionary_.code()) | | 498 return DictionaryBits::encode(dictionary_.code()) | |
495 ResultBits::encode(result_.code()) | | 499 ResultBits::encode(result_.code()) | |
496 IndexBits::encode(index_.code()) | | 500 IndexBits::encode(index_.code()) | |
497 LookupModeBits::encode(mode_); | 501 LookupModeBits::encode(mode_); |
498 } | 502 } |
499 | 503 |
500 class DictionaryBits: public BitField<int, 0, 4> {}; | 504 class DictionaryBits: public BitField<int, 0, 4> {}; |
501 class ResultBits: public BitField<int, 4, 4> {}; | 505 class ResultBits: public BitField<int, 4, 4> {}; |
502 class IndexBits: public BitField<int, 8, 4> {}; | 506 class IndexBits: public BitField<int, 8, 4> {}; |
503 class LookupModeBits: public BitField<LookupMode, 12, 1> {}; | 507 class LookupModeBits: public BitField<LookupMode, 12, 1> {}; |
504 | 508 |
505 Register dictionary_; | 509 Register dictionary_; |
506 Register result_; | 510 Register result_; |
507 Register index_; | 511 Register index_; |
508 LookupMode mode_; | 512 LookupMode mode_; |
509 }; | 513 }; |
510 | 514 |
511 | 515 |
512 } } // namespace v8::internal | 516 } } // namespace v8::internal |
513 | 517 |
514 #endif // V8_X64_CODE_STUBS_X64_H_ | 518 #endif // V8_X64_CODE_STUBS_X64_H_ |
OLD | NEW |