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 |
| 429 class StringDictionaryLookupStub: public CodeStub { |
| 430 public: |
| 431 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 432 |
| 433 StringDictionaryLookupStub(Register dictionary, |
| 434 Register result, |
| 435 Register index, |
| 436 LookupMode mode) |
| 437 : dictionary_(dictionary), result_(result), index_(index), mode_(mode) { } |
| 438 |
| 439 void Generate(MacroAssembler* masm); |
| 440 |
| 441 private: |
| 442 |
| 443 #ifdef DEBUG |
| 444 void Print() { |
| 445 PrintF("StringDictionaryLookupStub\n"); |
| 446 } |
| 447 #endif |
| 448 |
| 449 Major MajorKey() { return StringDictionaryNegativeLookup; } |
| 450 |
| 451 int MinorKey() { |
| 452 return DictionaryBits::encode(dictionary_.code()) | |
| 453 ResultBits::encode(result_.code()) | |
| 454 IndexBits::encode(index_.code()) | |
| 455 LookupModeBits::encode(mode_); |
| 456 } |
| 457 |
| 458 class DictionaryBits: public BitField<int, 0, 3> {}; |
| 459 class ResultBits: public BitField<int, 3, 3> {}; |
| 460 class IndexBits: public BitField<int, 6, 3> {}; |
| 461 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; |
| 462 |
| 463 Register dictionary_; |
| 464 Register result_; |
| 465 Register index_; |
| 466 LookupMode mode_; |
| 467 }; |
| 468 |
| 469 |
427 } } // namespace v8::internal | 470 } } // namespace v8::internal |
428 | 471 |
429 #endif // V8_IA32_CODE_STUBS_IA32_H_ | 472 #endif // V8_IA32_CODE_STUBS_IA32_H_ |
OLD | NEW |