| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_IA32_CODE_STUBS_IA32_H_ | 5 #ifndef V8_IA32_CODE_STUBS_IA32_H_ |
| 6 #define V8_IA32_CODE_STUBS_IA32_H_ | 6 #define V8_IA32_CODE_STUBS_IA32_H_ |
| 7 | 7 |
| 8 #include "src/ic-inl.h" | 8 #include "src/ic-inl.h" |
| 9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 : PlatformCodeStub(isolate), save_doubles_(save_fp) { } | 23 : PlatformCodeStub(isolate), save_doubles_(save_fp) { } |
| 24 | 24 |
| 25 void Generate(MacroAssembler* masm); | 25 void Generate(MacroAssembler* masm); |
| 26 | 26 |
| 27 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 27 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
| 28 virtual bool SometimesSetsUpAFrame() { return false; } | 28 virtual bool SometimesSetsUpAFrame() { return false; } |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 SaveFPRegsMode save_doubles_; | 31 SaveFPRegsMode save_doubles_; |
| 32 | 32 |
| 33 Major MajorKey() { return StoreBufferOverflow; } | 33 Major MajorKey() const { return StoreBufferOverflow; } |
| 34 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 34 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 | 37 |
| 38 class StringHelper : public AllStatic { | 38 class StringHelper : public AllStatic { |
| 39 public: | 39 public: |
| 40 // Generate code for copying characters using the rep movs instruction. | 40 // Generate code for copying characters using the rep movs instruction. |
| 41 // Copies ecx characters from esi to edi. Copying of overlapping regions is | 41 // Copies ecx characters from esi to edi. Copying of overlapping regions is |
| 42 // not supported. | 42 // not supported. |
| 43 static void GenerateCopyCharacters(MacroAssembler* masm, | 43 static void GenerateCopyCharacters(MacroAssembler* masm, |
| 44 Register dest, | 44 Register dest, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 63 private: | 63 private: |
| 64 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | 64 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 | 67 |
| 68 class SubStringStub: public PlatformCodeStub { | 68 class SubStringStub: public PlatformCodeStub { |
| 69 public: | 69 public: |
| 70 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 70 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 Major MajorKey() { return SubString; } | 73 Major MajorKey() const { return SubString; } |
| 74 int MinorKey() { return 0; } | 74 int MinorKey() const { return 0; } |
| 75 | 75 |
| 76 void Generate(MacroAssembler* masm); | 76 void Generate(MacroAssembler* masm); |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 | 79 |
| 80 class StringCompareStub: public PlatformCodeStub { | 80 class StringCompareStub: public PlatformCodeStub { |
| 81 public: | 81 public: |
| 82 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 82 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 83 | 83 |
| 84 // Compares two flat ASCII strings and returns result in eax. | 84 // Compares two flat ASCII strings and returns result in eax. |
| 85 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 85 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 86 Register left, | 86 Register left, |
| 87 Register right, | 87 Register right, |
| 88 Register scratch1, | 88 Register scratch1, |
| 89 Register scratch2, | 89 Register scratch2, |
| 90 Register scratch3); | 90 Register scratch3); |
| 91 | 91 |
| 92 // Compares two flat ASCII strings for equality and returns result | 92 // Compares two flat ASCII strings for equality and returns result |
| 93 // in eax. | 93 // in eax. |
| 94 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | 94 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
| 95 Register left, | 95 Register left, |
| 96 Register right, | 96 Register right, |
| 97 Register scratch1, | 97 Register scratch1, |
| 98 Register scratch2); | 98 Register scratch2); |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 virtual Major MajorKey() { return StringCompare; } | 101 virtual Major MajorKey() const { return StringCompare; } |
| 102 virtual int MinorKey() { return 0; } | 102 virtual int MinorKey() const { return 0; } |
| 103 virtual void Generate(MacroAssembler* masm); | 103 virtual void Generate(MacroAssembler* masm); |
| 104 | 104 |
| 105 static void GenerateAsciiCharsCompareLoop( | 105 static void GenerateAsciiCharsCompareLoop( |
| 106 MacroAssembler* masm, | 106 MacroAssembler* masm, |
| 107 Register left, | 107 Register left, |
| 108 Register right, | 108 Register right, |
| 109 Register length, | 109 Register length, |
| 110 Register scratch, | 110 Register scratch, |
| 111 Label* chars_not_equal, | 111 Label* chars_not_equal, |
| 112 Label::Distance chars_not_equal_near = Label::kFar); | 112 Label::Distance chars_not_equal_near = Label::kFar); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 static const int kTotalProbes = 20; | 149 static const int kTotalProbes = 20; |
| 150 | 150 |
| 151 static const int kCapacityOffset = | 151 static const int kCapacityOffset = |
| 152 NameDictionary::kHeaderSize + | 152 NameDictionary::kHeaderSize + |
| 153 NameDictionary::kCapacityIndex * kPointerSize; | 153 NameDictionary::kCapacityIndex * kPointerSize; |
| 154 | 154 |
| 155 static const int kElementsStartOffset = | 155 static const int kElementsStartOffset = |
| 156 NameDictionary::kHeaderSize + | 156 NameDictionary::kHeaderSize + |
| 157 NameDictionary::kElementsStartIndex * kPointerSize; | 157 NameDictionary::kElementsStartIndex * kPointerSize; |
| 158 | 158 |
| 159 Major MajorKey() { return NameDictionaryLookup; } | 159 Major MajorKey() const { return NameDictionaryLookup; } |
| 160 | 160 |
| 161 int MinorKey() { | 161 int MinorKey() const { |
| 162 return DictionaryBits::encode(dictionary_.code()) | | 162 return DictionaryBits::encode(dictionary_.code()) | |
| 163 ResultBits::encode(result_.code()) | | 163 ResultBits::encode(result_.code()) | |
| 164 IndexBits::encode(index_.code()) | | 164 IndexBits::encode(index_.code()) | |
| 165 LookupModeBits::encode(mode_); | 165 LookupModeBits::encode(mode_); |
| 166 } | 166 } |
| 167 | 167 |
| 168 class DictionaryBits: public BitField<int, 0, 3> {}; | 168 class DictionaryBits: public BitField<int, 0, 3> {}; |
| 169 class ResultBits: public BitField<int, 3, 3> {}; | 169 class ResultBits: public BitField<int, 3, 3> {}; |
| 170 class IndexBits: public BitField<int, 6, 3> {}; | 170 class IndexBits: public BitField<int, 6, 3> {}; |
| 171 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; | 171 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 } | 398 } |
| 399 ; | 399 ; |
| 400 void Generate(MacroAssembler* masm); | 400 void Generate(MacroAssembler* masm); |
| 401 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 401 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
| 402 void CheckNeedsToInformIncrementalMarker( | 402 void CheckNeedsToInformIncrementalMarker( |
| 403 MacroAssembler* masm, | 403 MacroAssembler* masm, |
| 404 OnNoNeedToInformIncrementalMarker on_no_need, | 404 OnNoNeedToInformIncrementalMarker on_no_need, |
| 405 Mode mode); | 405 Mode mode); |
| 406 void InformIncrementalMarker(MacroAssembler* masm); | 406 void InformIncrementalMarker(MacroAssembler* masm); |
| 407 | 407 |
| 408 Major MajorKey() { return RecordWrite; } | 408 Major MajorKey() const { return RecordWrite; } |
| 409 | 409 |
| 410 int MinorKey() { | 410 int MinorKey() const { |
| 411 return ObjectBits::encode(object_.code()) | | 411 return ObjectBits::encode(object_.code()) | |
| 412 ValueBits::encode(value_.code()) | | 412 ValueBits::encode(value_.code()) | |
| 413 AddressBits::encode(address_.code()) | | 413 AddressBits::encode(address_.code()) | |
| 414 RememberedSetActionBits::encode(remembered_set_action_) | | 414 RememberedSetActionBits::encode(remembered_set_action_) | |
| 415 SaveFPRegsModeBits::encode(save_fp_regs_mode_); | 415 SaveFPRegsModeBits::encode(save_fp_regs_mode_); |
| 416 } | 416 } |
| 417 | 417 |
| 418 void Activate(Code* code) { | 418 void Activate(Code* code) { |
| 419 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); | 419 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); |
| 420 } | 420 } |
| 421 | 421 |
| 422 class ObjectBits: public BitField<int, 0, 3> {}; | 422 class ObjectBits: public BitField<int, 0, 3> {}; |
| 423 class ValueBits: public BitField<int, 3, 3> {}; | 423 class ValueBits: public BitField<int, 3, 3> {}; |
| 424 class AddressBits: public BitField<int, 6, 3> {}; | 424 class AddressBits: public BitField<int, 6, 3> {}; |
| 425 class RememberedSetActionBits: public BitField<RememberedSetAction, 9, 1> {}; | 425 class RememberedSetActionBits: public BitField<RememberedSetAction, 9, 1> {}; |
| 426 class SaveFPRegsModeBits: public BitField<SaveFPRegsMode, 10, 1> {}; | 426 class SaveFPRegsModeBits: public BitField<SaveFPRegsMode, 10, 1> {}; |
| 427 | 427 |
| 428 Register object_; | 428 Register object_; |
| 429 Register value_; | 429 Register value_; |
| 430 Register address_; | 430 Register address_; |
| 431 RememberedSetAction remembered_set_action_; | 431 RememberedSetAction remembered_set_action_; |
| 432 SaveFPRegsMode save_fp_regs_mode_; | 432 SaveFPRegsMode save_fp_regs_mode_; |
| 433 RegisterAllocation regs_; | 433 RegisterAllocation regs_; |
| 434 }; | 434 }; |
| 435 | 435 |
| 436 | 436 |
| 437 } } // namespace v8::internal | 437 } } // namespace v8::internal |
| 438 | 438 |
| 439 #endif // V8_IA32_CODE_STUBS_IA32_H_ | 439 #endif // V8_IA32_CODE_STUBS_IA32_H_ |
| OLD | NEW |