| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 TranscendentalCache::Type type_; | 53 TranscendentalCache::Type type_; |
| 54 ArgumentType argument_type_; | 54 ArgumentType argument_type_; |
| 55 | 55 |
| 56 Major MajorKey() { return TranscendentalCache; } | 56 Major MajorKey() { return TranscendentalCache; } |
| 57 int MinorKey() { return type_ | argument_type_; } | 57 int MinorKey() { return type_ | argument_type_; } |
| 58 Runtime::FunctionId RuntimeFunction(); | 58 Runtime::FunctionId RuntimeFunction(); |
| 59 void GenerateOperation(MacroAssembler* masm); | 59 void GenerateOperation(MacroAssembler* masm); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 | 62 |
| 63 class ToBooleanStub: public CodeStub { | |
| 64 public: | |
| 65 ToBooleanStub() { } | |
| 66 | |
| 67 void Generate(MacroAssembler* masm); | |
| 68 | |
| 69 private: | |
| 70 Major MajorKey() { return ToBoolean; } | |
| 71 int MinorKey() { return 0; } | |
| 72 }; | |
| 73 | |
| 74 | |
| 75 class StoreBufferOverflowStub: public CodeStub { | 63 class StoreBufferOverflowStub: public CodeStub { |
| 76 public: | 64 public: |
| 77 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp) | 65 explicit StoreBufferOverflowStub(SaveFPRegsMode save_fp) |
| 78 : save_doubles_(save_fp) { } | 66 : save_doubles_(save_fp) { } |
| 79 | 67 |
| 80 void Generate(MacroAssembler* masm); | 68 void Generate(MacroAssembler* masm); |
| 81 | 69 |
| 82 private: | 70 private: |
| 83 SaveFPRegsMode save_doubles_; | 71 SaveFPRegsMode save_doubles_; |
| 84 | 72 |
| 85 Major MajorKey() { return StoreBufferOverflow; } | 73 Major MajorKey() { return StoreBufferOverflow; } |
| 86 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 74 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
| 87 }; | 75 }; |
| 88 | 76 |
| 89 | 77 |
| 90 class UnaryOpStub: public CodeStub { | 78 class UnaryOpStub: public CodeStub { |
| 91 public: | 79 public: |
| 92 UnaryOpStub(Token::Value op, UnaryOverwriteMode mode) | 80 UnaryOpStub(Token::Value op, |
| 81 UnaryOverwriteMode mode, |
| 82 UnaryOpIC::TypeInfo operand_type = UnaryOpIC::UNINITIALIZED) |
| 93 : op_(op), | 83 : op_(op), |
| 94 mode_(mode), | 84 mode_(mode), |
| 95 operand_type_(UnaryOpIC::UNINITIALIZED), | |
| 96 name_(NULL) { | |
| 97 } | |
| 98 | |
| 99 UnaryOpStub(int key, UnaryOpIC::TypeInfo operand_type) | |
| 100 : op_(OpBits::decode(key)), | |
| 101 mode_(ModeBits::decode(key)), | |
| 102 operand_type_(operand_type), | 85 operand_type_(operand_type), |
| 103 name_(NULL) { | 86 name_(NULL) { |
| 104 } | 87 } |
| 105 | 88 |
| 106 private: | 89 private: |
| 107 Token::Value op_; | 90 Token::Value op_; |
| 108 UnaryOverwriteMode mode_; | 91 UnaryOverwriteMode mode_; |
| 109 | 92 |
| 110 // Operand type information determined at runtime. | 93 // Operand type information determined at runtime. |
| 111 UnaryOpIC::TypeInfo operand_type_; | 94 UnaryOpIC::TypeInfo operand_type_; |
| 112 | 95 |
| 113 char* name_; | 96 char* name_; |
| 114 | 97 |
| 115 const char* GetName(); | 98 virtual const char* GetName(); |
| 116 | 99 |
| 117 #ifdef DEBUG | 100 #ifdef DEBUG |
| 118 void Print() { | 101 void Print() { |
| 119 PrintF("TypeRecordingUnaryOpStub %d (op %s), " | 102 PrintF("UnaryOpStub %d (op %s), (mode %d, runtime_type_info %s)\n", |
| 120 "(mode %d, runtime_type_info %s)\n", | |
| 121 MinorKey(), | 103 MinorKey(), |
| 122 Token::String(op_), | 104 Token::String(op_), |
| 123 static_cast<int>(mode_), | 105 static_cast<int>(mode_), |
| 124 UnaryOpIC::GetName(operand_type_)); | 106 UnaryOpIC::GetName(operand_type_)); |
| 125 } | 107 } |
| 126 #endif | 108 #endif |
| 127 | 109 |
| 128 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; | 110 class ModeBits: public BitField<UnaryOverwriteMode, 0, 1> {}; |
| 129 class OpBits: public BitField<Token::Value, 1, 7> {}; | 111 class OpBits: public BitField<Token::Value, 1, 7> {}; |
| 130 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; | 112 class OperandTypeInfoBits: public BitField<UnaryOpIC::TypeInfo, 8, 3> {}; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 Token::Value op_; | 194 Token::Value op_; |
| 213 OverwriteMode mode_; | 195 OverwriteMode mode_; |
| 214 bool use_sse3_; | 196 bool use_sse3_; |
| 215 | 197 |
| 216 // Operand type information determined at runtime. | 198 // Operand type information determined at runtime. |
| 217 BinaryOpIC::TypeInfo operands_type_; | 199 BinaryOpIC::TypeInfo operands_type_; |
| 218 BinaryOpIC::TypeInfo result_type_; | 200 BinaryOpIC::TypeInfo result_type_; |
| 219 | 201 |
| 220 char* name_; | 202 char* name_; |
| 221 | 203 |
| 222 const char* GetName(); | 204 virtual const char* GetName(); |
| 223 | 205 |
| 224 #ifdef DEBUG | 206 #ifdef DEBUG |
| 225 void Print() { | 207 void Print() { |
| 226 PrintF("BinaryOpStub %d (op %s), " | 208 PrintF("BinaryOpStub %d (op %s), " |
| 227 "(mode %d, runtime_type_info %s)\n", | 209 "(mode %d, runtime_type_info %s)\n", |
| 228 MinorKey(), | 210 MinorKey(), |
| 229 Token::String(op_), | 211 Token::String(op_), |
| 230 static_cast<int>(mode_), | 212 static_cast<int>(mode_), |
| 231 BinaryOpIC::GetName(operands_type_)); | 213 BinaryOpIC::GetName(operands_type_)); |
| 232 } | 214 } |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 Register scratch1, | 423 Register scratch1, |
| 442 Register scratch2, | 424 Register scratch2, |
| 443 bool object_is_smi, | 425 bool object_is_smi, |
| 444 Label* not_found); | 426 Label* not_found); |
| 445 | 427 |
| 446 private: | 428 private: |
| 447 Major MajorKey() { return NumberToString; } | 429 Major MajorKey() { return NumberToString; } |
| 448 int MinorKey() { return 0; } | 430 int MinorKey() { return 0; } |
| 449 | 431 |
| 450 void Generate(MacroAssembler* masm); | 432 void Generate(MacroAssembler* masm); |
| 451 | |
| 452 const char* GetName() { return "NumberToStringStub"; } | |
| 453 | |
| 454 #ifdef DEBUG | |
| 455 void Print() { | |
| 456 PrintF("NumberToStringStub\n"); | |
| 457 } | |
| 458 #endif | |
| 459 }; | 433 }; |
| 460 | 434 |
| 461 | 435 |
| 462 class StringDictionaryLookupStub: public CodeStub { | 436 class StringDictionaryLookupStub: public CodeStub { |
| 463 public: | 437 public: |
| 464 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 438 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 465 | 439 |
| 466 StringDictionaryLookupStub(Register dictionary, | 440 StringDictionaryLookupStub(Register dictionary, |
| 467 Register result, | 441 Register result, |
| 468 Register index, | 442 Register index, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 492 static const int kTotalProbes = 20; | 466 static const int kTotalProbes = 20; |
| 493 | 467 |
| 494 static const int kCapacityOffset = | 468 static const int kCapacityOffset = |
| 495 StringDictionary::kHeaderSize + | 469 StringDictionary::kHeaderSize + |
| 496 StringDictionary::kCapacityIndex * kPointerSize; | 470 StringDictionary::kCapacityIndex * kPointerSize; |
| 497 | 471 |
| 498 static const int kElementsStartOffset = | 472 static const int kElementsStartOffset = |
| 499 StringDictionary::kHeaderSize + | 473 StringDictionary::kHeaderSize + |
| 500 StringDictionary::kElementsStartIndex * kPointerSize; | 474 StringDictionary::kElementsStartIndex * kPointerSize; |
| 501 | 475 |
| 502 | |
| 503 #ifdef DEBUG | |
| 504 void Print() { | |
| 505 PrintF("StringDictionaryLookupStub\n"); | |
| 506 } | |
| 507 #endif | |
| 508 | |
| 509 Major MajorKey() { return StringDictionaryNegativeLookup; } | 476 Major MajorKey() { return StringDictionaryNegativeLookup; } |
| 510 | 477 |
| 511 int MinorKey() { | 478 int MinorKey() { |
| 512 return DictionaryBits::encode(dictionary_.code()) | | 479 return DictionaryBits::encode(dictionary_.code()) | |
| 513 ResultBits::encode(result_.code()) | | 480 ResultBits::encode(result_.code()) | |
| 514 IndexBits::encode(index_.code()) | | 481 IndexBits::encode(index_.code()) | |
| 515 LookupModeBits::encode(mode_); | 482 LookupModeBits::encode(mode_); |
| 516 } | 483 } |
| 517 | 484 |
| 518 class DictionaryBits: public BitField<int, 0, 3> {}; | 485 class DictionaryBits: public BitField<int, 0, 3> {}; |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 Register scratch1, | 793 Register scratch1, |
| 827 bool load_elements_from_receiver, | 794 bool load_elements_from_receiver, |
| 828 Label* key_not_smi, | 795 Label* key_not_smi, |
| 829 Label* value_not_smi, | 796 Label* value_not_smi, |
| 830 Label* not_pixel_array, | 797 Label* not_pixel_array, |
| 831 Label* out_of_range); | 798 Label* out_of_range); |
| 832 | 799 |
| 833 } } // namespace v8::internal | 800 } } // namespace v8::internal |
| 834 | 801 |
| 835 #endif // V8_IA32_CODE_STUBS_IA32_H_ | 802 #endif // V8_IA32_CODE_STUBS_IA32_H_ |
| OLD | NEW |