| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 Token::Value op_; | 74 Token::Value op_; |
| 75 UnaryOverwriteMode mode_; | 75 UnaryOverwriteMode mode_; |
| 76 | 76 |
| 77 // Operand type information determined at runtime. | 77 // Operand type information determined at runtime. |
| 78 UnaryOpIC::TypeInfo operand_type_; | 78 UnaryOpIC::TypeInfo operand_type_; |
| 79 | 79 |
| 80 char* name_; | 80 char* name_; |
| 81 | 81 |
| 82 const char* GetName(); | 82 virtual const char* GetName(); |
| 83 | 83 |
| 84 #ifdef DEBUG | 84 #ifdef DEBUG |
| 85 void Print() { | 85 void Print() { |
| 86 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n", | 86 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n", |
| 87 MinorKey(), | 87 MinorKey(), |
| 88 Token::String(op_), | 88 Token::String(op_), |
| 89 static_cast<int>(mode_), | 89 static_cast<int>(mode_), |
| 90 UnaryOpIC::GetName(operand_type_)); | 90 UnaryOpIC::GetName(operand_type_)); |
| 91 } | 91 } |
| 92 #endif | 92 #endif |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 172 |
| 173 Token::Value op_; | 173 Token::Value op_; |
| 174 OverwriteMode mode_; | 174 OverwriteMode mode_; |
| 175 | 175 |
| 176 // Operand type information determined at runtime. | 176 // Operand type information determined at runtime. |
| 177 BinaryOpIC::TypeInfo operands_type_; | 177 BinaryOpIC::TypeInfo operands_type_; |
| 178 BinaryOpIC::TypeInfo result_type_; | 178 BinaryOpIC::TypeInfo result_type_; |
| 179 | 179 |
| 180 char* name_; | 180 char* name_; |
| 181 | 181 |
| 182 const char* GetName(); | 182 virtual const char* GetName(); |
| 183 | 183 |
| 184 #ifdef DEBUG | 184 #ifdef DEBUG |
| 185 void Print() { | 185 void Print() { |
| 186 PrintF("BinaryOpStub %d (op %s), " | 186 PrintF("BinaryOpStub %d (op %s), " |
| 187 "(mode %d, runtime_type_info %s)\n", | 187 "(mode %d, runtime_type_info %s)\n", |
| 188 MinorKey(), | 188 MinorKey(), |
| 189 Token::String(op_), | 189 Token::String(op_), |
| 190 static_cast<int>(mode_), | 190 static_cast<int>(mode_), |
| 191 BinaryOpIC::GetName(operands_type_)); | 191 BinaryOpIC::GetName(operands_type_)); |
| 192 } | 192 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 | 403 |
| 404 private: | 404 private: |
| 405 static void GenerateConvertHashCodeToIndex(MacroAssembler* masm, | 405 static void GenerateConvertHashCodeToIndex(MacroAssembler* masm, |
| 406 Register hash, | 406 Register hash, |
| 407 Register mask); | 407 Register mask); |
| 408 | 408 |
| 409 Major MajorKey() { return NumberToString; } | 409 Major MajorKey() { return NumberToString; } |
| 410 int MinorKey() { return 0; } | 410 int MinorKey() { return 0; } |
| 411 | 411 |
| 412 void Generate(MacroAssembler* masm); | 412 void Generate(MacroAssembler* masm); |
| 413 | |
| 414 const char* GetName() { return "NumberToStringStub"; } | |
| 415 | |
| 416 #ifdef DEBUG | |
| 417 void Print() { | |
| 418 PrintF("NumberToStringStub\n"); | |
| 419 } | |
| 420 #endif | |
| 421 }; | 413 }; |
| 422 | 414 |
| 423 | 415 |
| 424 class StringDictionaryLookupStub: public CodeStub { | 416 class StringDictionaryLookupStub: public CodeStub { |
| 425 public: | 417 public: |
| 426 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 418 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 427 | 419 |
| 428 StringDictionaryLookupStub(Register dictionary, | 420 StringDictionaryLookupStub(Register dictionary, |
| 429 Register result, | 421 Register result, |
| 430 Register index, | 422 Register index, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 454 static const int kTotalProbes = 20; | 446 static const int kTotalProbes = 20; |
| 455 | 447 |
| 456 static const int kCapacityOffset = | 448 static const int kCapacityOffset = |
| 457 StringDictionary::kHeaderSize + | 449 StringDictionary::kHeaderSize + |
| 458 StringDictionary::kCapacityIndex * kPointerSize; | 450 StringDictionary::kCapacityIndex * kPointerSize; |
| 459 | 451 |
| 460 static const int kElementsStartOffset = | 452 static const int kElementsStartOffset = |
| 461 StringDictionary::kHeaderSize + | 453 StringDictionary::kHeaderSize + |
| 462 StringDictionary::kElementsStartIndex * kPointerSize; | 454 StringDictionary::kElementsStartIndex * kPointerSize; |
| 463 | 455 |
| 464 | |
| 465 #ifdef DEBUG | |
| 466 void Print() { | |
| 467 PrintF("StringDictionaryLookupStub\n"); | |
| 468 } | |
| 469 #endif | |
| 470 | |
| 471 Major MajorKey() { return StringDictionaryNegativeLookup; } | 456 Major MajorKey() { return StringDictionaryNegativeLookup; } |
| 472 | 457 |
| 473 int MinorKey() { | 458 int MinorKey() { |
| 474 return DictionaryBits::encode(dictionary_.code()) | | 459 return DictionaryBits::encode(dictionary_.code()) | |
| 475 ResultBits::encode(result_.code()) | | 460 ResultBits::encode(result_.code()) | |
| 476 IndexBits::encode(index_.code()) | | 461 IndexBits::encode(index_.code()) | |
| 477 LookupModeBits::encode(mode_); | 462 LookupModeBits::encode(mode_); |
| 478 } | 463 } |
| 479 | 464 |
| 480 class DictionaryBits: public BitField<int, 0, 4> {}; | 465 class DictionaryBits: public BitField<int, 0, 4> {}; |
| 481 class ResultBits: public BitField<int, 4, 4> {}; | 466 class ResultBits: public BitField<int, 4, 4> {}; |
| 482 class IndexBits: public BitField<int, 8, 4> {}; | 467 class IndexBits: public BitField<int, 8, 4> {}; |
| 483 class LookupModeBits: public BitField<LookupMode, 12, 1> {}; | 468 class LookupModeBits: public BitField<LookupMode, 12, 1> {}; |
| 484 | 469 |
| 485 Register dictionary_; | 470 Register dictionary_; |
| 486 Register result_; | 471 Register result_; |
| 487 Register index_; | 472 Register index_; |
| 488 LookupMode mode_; | 473 LookupMode mode_; |
| 489 }; | 474 }; |
| 490 | 475 |
| 491 | 476 |
| 492 } } // namespace v8::internal | 477 } } // namespace v8::internal |
| 493 | 478 |
| 494 #endif // V8_X64_CODE_STUBS_X64_H_ | 479 #endif // V8_X64_CODE_STUBS_X64_H_ |
| OLD | NEW |