| 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_MIPS_CODE_STUBS_ARM_H_ | 5 #ifndef V8_MIPS_CODE_STUBS_ARM_H_ |
| 6 #define V8_MIPS_CODE_STUBS_ARM_H_ | 6 #define V8_MIPS_CODE_STUBS_ARM_H_ |
| 7 | 7 |
| 8 #include "src/ic-inl.h" | 8 #include "src/ic-inl.h" |
| 9 | 9 |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 : PlatformCodeStub(isolate), save_doubles_(save_fp) {} | 21 : PlatformCodeStub(isolate), save_doubles_(save_fp) {} |
| 22 | 22 |
| 23 void Generate(MacroAssembler* masm); | 23 void Generate(MacroAssembler* masm); |
| 24 | 24 |
| 25 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 25 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
| 26 virtual bool SometimesSetsUpAFrame() { return false; } | 26 virtual bool SometimesSetsUpAFrame() { return false; } |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 SaveFPRegsMode save_doubles_; | 29 SaveFPRegsMode save_doubles_; |
| 30 | 30 |
| 31 Major MajorKey() { return StoreBufferOverflow; } | 31 Major MajorKey() const { return StoreBufferOverflow; } |
| 32 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 32 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 | 35 |
| 36 class StringHelper : public AllStatic { | 36 class StringHelper : public AllStatic { |
| 37 public: | 37 public: |
| 38 // Generate code for copying a large number of characters. This function | 38 // Generate code for copying a large number of characters. This function |
| 39 // is allowed to spend extra time setting up conditions to make copying | 39 // is allowed to spend extra time setting up conditions to make copying |
| 40 // faster. Copying of overlapping regions is not supported. | 40 // faster. Copying of overlapping regions is not supported. |
| 41 // Dest register ends at the position after the last character written. | 41 // Dest register ends at the position after the last character written. |
| 42 static void GenerateCopyCharacters(MacroAssembler* masm, | 42 static void GenerateCopyCharacters(MacroAssembler* masm, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 private: | 62 private: |
| 63 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | 63 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 | 66 |
| 67 class SubStringStub: public PlatformCodeStub { | 67 class SubStringStub: public PlatformCodeStub { |
| 68 public: | 68 public: |
| 69 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 69 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 Major MajorKey() { return SubString; } | 72 Major MajorKey() const { return SubString; } |
| 73 int MinorKey() { return 0; } | 73 int MinorKey() const { return 0; } |
| 74 | 74 |
| 75 void Generate(MacroAssembler* masm); | 75 void Generate(MacroAssembler* masm); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 |
| 78 class StoreRegistersStateStub: public PlatformCodeStub { | 79 class StoreRegistersStateStub: public PlatformCodeStub { |
| 79 public: | 80 public: |
| 80 explicit StoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) | 81 explicit StoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) |
| 81 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} | 82 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} |
| 82 | 83 |
| 83 static void GenerateAheadOfTime(Isolate* isolate); | 84 static void GenerateAheadOfTime(Isolate* isolate); |
| 84 private: | 85 private: |
| 85 Major MajorKey() { return StoreRegistersState; } | 86 Major MajorKey() const { return StoreRegistersState; } |
| 86 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 87 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
| 87 SaveFPRegsMode save_doubles_; | 88 SaveFPRegsMode save_doubles_; |
| 88 | 89 |
| 89 void Generate(MacroAssembler* masm); | 90 void Generate(MacroAssembler* masm); |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 class RestoreRegistersStateStub: public PlatformCodeStub { | 93 class RestoreRegistersStateStub: public PlatformCodeStub { |
| 93 public: | 94 public: |
| 94 explicit RestoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) | 95 explicit RestoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) |
| 95 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} | 96 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} |
| 96 | 97 |
| 97 static void GenerateAheadOfTime(Isolate* isolate); | 98 static void GenerateAheadOfTime(Isolate* isolate); |
| 98 private: | 99 private: |
| 99 Major MajorKey() { return RestoreRegistersState; } | 100 Major MajorKey() const { return RestoreRegistersState; } |
| 100 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 101 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
| 101 SaveFPRegsMode save_doubles_; | 102 SaveFPRegsMode save_doubles_; |
| 102 | 103 |
| 103 void Generate(MacroAssembler* masm); | 104 void Generate(MacroAssembler* masm); |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 class StringCompareStub: public PlatformCodeStub { | 107 class StringCompareStub: public PlatformCodeStub { |
| 107 public: | 108 public: |
| 108 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 109 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 109 | 110 |
| 110 // Compare two flat ASCII strings and returns result in v0. | 111 // Compare two flat ASCII strings and returns result in v0. |
| 111 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 112 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 112 Register left, | 113 Register left, |
| 113 Register right, | 114 Register right, |
| 114 Register scratch1, | 115 Register scratch1, |
| 115 Register scratch2, | 116 Register scratch2, |
| 116 Register scratch3, | 117 Register scratch3, |
| 117 Register scratch4); | 118 Register scratch4); |
| 118 | 119 |
| 119 // Compares two flat ASCII strings for equality and returns result | 120 // Compares two flat ASCII strings for equality and returns result |
| 120 // in v0. | 121 // in v0. |
| 121 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | 122 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
| 122 Register left, | 123 Register left, |
| 123 Register right, | 124 Register right, |
| 124 Register scratch1, | 125 Register scratch1, |
| 125 Register scratch2, | 126 Register scratch2, |
| 126 Register scratch3); | 127 Register scratch3); |
| 127 | 128 |
| 128 private: | 129 private: |
| 129 virtual Major MajorKey() { return StringCompare; } | 130 virtual Major MajorKey() const { return StringCompare; } |
| 130 virtual int MinorKey() { return 0; } | 131 virtual int MinorKey() const { return 0; } |
| 131 virtual void Generate(MacroAssembler* masm); | 132 virtual void Generate(MacroAssembler* masm); |
| 132 | 133 |
| 133 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, | 134 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, |
| 134 Register left, | 135 Register left, |
| 135 Register right, | 136 Register right, |
| 136 Register length, | 137 Register length, |
| 137 Register scratch1, | 138 Register scratch1, |
| 138 Register scratch2, | 139 Register scratch2, |
| 139 Register scratch3, | 140 Register scratch3, |
| 140 Label* chars_not_equal); | 141 Label* chars_not_equal); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 169 Register the_heap_number_; | 170 Register the_heap_number_; |
| 170 Register scratch_; | 171 Register scratch_; |
| 171 Register sign_; | 172 Register sign_; |
| 172 | 173 |
| 173 // Minor key encoding in 16 bits. | 174 // Minor key encoding in 16 bits. |
| 174 class IntRegisterBits: public BitField<int, 0, 4> {}; | 175 class IntRegisterBits: public BitField<int, 0, 4> {}; |
| 175 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; | 176 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; |
| 176 class ScratchRegisterBits: public BitField<int, 8, 4> {}; | 177 class ScratchRegisterBits: public BitField<int, 8, 4> {}; |
| 177 class SignRegisterBits: public BitField<int, 12, 4> {}; | 178 class SignRegisterBits: public BitField<int, 12, 4> {}; |
| 178 | 179 |
| 179 Major MajorKey() { return WriteInt32ToHeapNumber; } | 180 Major MajorKey() const { return WriteInt32ToHeapNumber; } |
| 180 int MinorKey() { | 181 int MinorKey() const { |
| 181 // Encode the parameters in a unique 16 bit value. | 182 // Encode the parameters in a unique 16 bit value. |
| 182 return IntRegisterBits::encode(the_int_.code()) | 183 return IntRegisterBits::encode(the_int_.code()) |
| 183 | HeapNumberRegisterBits::encode(the_heap_number_.code()) | 184 | HeapNumberRegisterBits::encode(the_heap_number_.code()) |
| 184 | ScratchRegisterBits::encode(scratch_.code()) | 185 | ScratchRegisterBits::encode(scratch_.code()) |
| 185 | SignRegisterBits::encode(sign_.code()); | 186 | SignRegisterBits::encode(sign_.code()); |
| 186 } | 187 } |
| 187 | 188 |
| 188 void Generate(MacroAssembler* masm); | 189 void Generate(MacroAssembler* masm); |
| 189 }; | 190 }; |
| 190 | 191 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 }; | 341 }; |
| 341 | 342 |
| 342 void Generate(MacroAssembler* masm); | 343 void Generate(MacroAssembler* masm); |
| 343 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 344 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
| 344 void CheckNeedsToInformIncrementalMarker( | 345 void CheckNeedsToInformIncrementalMarker( |
| 345 MacroAssembler* masm, | 346 MacroAssembler* masm, |
| 346 OnNoNeedToInformIncrementalMarker on_no_need, | 347 OnNoNeedToInformIncrementalMarker on_no_need, |
| 347 Mode mode); | 348 Mode mode); |
| 348 void InformIncrementalMarker(MacroAssembler* masm); | 349 void InformIncrementalMarker(MacroAssembler* masm); |
| 349 | 350 |
| 350 Major MajorKey() { return RecordWrite; } | 351 Major MajorKey() const { return RecordWrite; } |
| 351 | 352 |
| 352 int MinorKey() { | 353 int MinorKey() const { |
| 353 return ObjectBits::encode(object_.code()) | | 354 return ObjectBits::encode(object_.code()) | |
| 354 ValueBits::encode(value_.code()) | | 355 ValueBits::encode(value_.code()) | |
| 355 AddressBits::encode(address_.code()) | | 356 AddressBits::encode(address_.code()) | |
| 356 RememberedSetActionBits::encode(remembered_set_action_) | | 357 RememberedSetActionBits::encode(remembered_set_action_) | |
| 357 SaveFPRegsModeBits::encode(save_fp_regs_mode_); | 358 SaveFPRegsModeBits::encode(save_fp_regs_mode_); |
| 358 } | 359 } |
| 359 | 360 |
| 360 void Activate(Code* code) { | 361 void Activate(Code* code) { |
| 361 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); | 362 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); |
| 362 } | 363 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 382 // keep the code which called into native pinned in the memory. Currently the | 383 // keep the code which called into native pinned in the memory. Currently the |
| 383 // simplest approach is to generate such stub early enough so it can never be | 384 // simplest approach is to generate such stub early enough so it can never be |
| 384 // moved by GC | 385 // moved by GC |
| 385 class DirectCEntryStub: public PlatformCodeStub { | 386 class DirectCEntryStub: public PlatformCodeStub { |
| 386 public: | 387 public: |
| 387 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 388 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 388 void Generate(MacroAssembler* masm); | 389 void Generate(MacroAssembler* masm); |
| 389 void GenerateCall(MacroAssembler* masm, Register target); | 390 void GenerateCall(MacroAssembler* masm, Register target); |
| 390 | 391 |
| 391 private: | 392 private: |
| 392 Major MajorKey() { return DirectCEntry; } | 393 Major MajorKey() const { return DirectCEntry; } |
| 393 int MinorKey() { return 0; } | 394 int MinorKey() const { return 0; } |
| 394 | 395 |
| 395 bool NeedsImmovableCode() { return true; } | 396 bool NeedsImmovableCode() { return true; } |
| 396 }; | 397 }; |
| 397 | 398 |
| 398 | 399 |
| 399 class NameDictionaryLookupStub: public PlatformCodeStub { | 400 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 400 public: | 401 public: |
| 401 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 402 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 402 | 403 |
| 403 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 404 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 428 static const int kTotalProbes = 20; | 429 static const int kTotalProbes = 20; |
| 429 | 430 |
| 430 static const int kCapacityOffset = | 431 static const int kCapacityOffset = |
| 431 NameDictionary::kHeaderSize + | 432 NameDictionary::kHeaderSize + |
| 432 NameDictionary::kCapacityIndex * kPointerSize; | 433 NameDictionary::kCapacityIndex * kPointerSize; |
| 433 | 434 |
| 434 static const int kElementsStartOffset = | 435 static const int kElementsStartOffset = |
| 435 NameDictionary::kHeaderSize + | 436 NameDictionary::kHeaderSize + |
| 436 NameDictionary::kElementsStartIndex * kPointerSize; | 437 NameDictionary::kElementsStartIndex * kPointerSize; |
| 437 | 438 |
| 438 Major MajorKey() { return NameDictionaryLookup; } | 439 Major MajorKey() const { return NameDictionaryLookup; } |
| 439 | 440 |
| 440 int MinorKey() { | 441 int MinorKey() const { return LookupModeBits::encode(mode_); } |
| 441 return LookupModeBits::encode(mode_); | |
| 442 } | |
| 443 | 442 |
| 444 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 443 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 445 | 444 |
| 446 LookupMode mode_; | 445 LookupMode mode_; |
| 447 }; | 446 }; |
| 448 | 447 |
| 449 | 448 |
| 450 } } // namespace v8::internal | 449 } } // namespace v8::internal |
| 451 | 450 |
| 452 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 451 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
| OLD | NEW |