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