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/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 | 9 |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
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() const { return StoreBufferOverflow; } | 31 Major MajorKey() const { return StoreBufferOverflow; } |
32 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 32 uint32_t 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 20 matching lines...) Expand all Loading... |
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() const { return SubString; } | 72 Major MajorKey() const { return SubString; } |
73 int MinorKey() const { return 0; } | 73 uint32_t MinorKey() const { return 0; } |
74 | 74 |
75 void Generate(MacroAssembler* masm); | 75 void Generate(MacroAssembler* masm); |
76 }; | 76 }; |
77 | 77 |
78 | 78 |
79 class StoreRegistersStateStub: public PlatformCodeStub { | 79 class StoreRegistersStateStub: public PlatformCodeStub { |
80 public: | 80 public: |
81 explicit StoreRegistersStateStub(Isolate* isolate) | 81 explicit StoreRegistersStateStub(Isolate* isolate) |
82 : PlatformCodeStub(isolate) {} | 82 : PlatformCodeStub(isolate) {} |
83 | 83 |
84 static void GenerateAheadOfTime(Isolate* isolate); | 84 static void GenerateAheadOfTime(Isolate* isolate); |
85 private: | 85 private: |
86 Major MajorKey() const { return StoreRegistersState; } | 86 Major MajorKey() const { return StoreRegistersState; } |
87 int MinorKey() const { return 0; } | 87 uint32_t MinorKey() const { return 0; } |
88 | 88 |
89 void Generate(MacroAssembler* masm); | 89 void Generate(MacroAssembler* masm); |
90 }; | 90 }; |
91 | 91 |
92 class RestoreRegistersStateStub: public PlatformCodeStub { | 92 class RestoreRegistersStateStub: public PlatformCodeStub { |
93 public: | 93 public: |
94 explicit RestoreRegistersStateStub(Isolate* isolate) | 94 explicit RestoreRegistersStateStub(Isolate* isolate) |
95 : PlatformCodeStub(isolate) {} | 95 : PlatformCodeStub(isolate) {} |
96 | 96 |
97 static void GenerateAheadOfTime(Isolate* isolate); | 97 static void GenerateAheadOfTime(Isolate* isolate); |
98 private: | 98 private: |
99 Major MajorKey() const { return RestoreRegistersState; } | 99 Major MajorKey() const { return RestoreRegistersState; } |
100 int MinorKey() const { return 0; } | 100 uint32_t MinorKey() const { return 0; } |
101 | 101 |
102 void Generate(MacroAssembler* masm); | 102 void Generate(MacroAssembler* masm); |
103 }; | 103 }; |
104 | 104 |
105 class StringCompareStub: public PlatformCodeStub { | 105 class StringCompareStub: public PlatformCodeStub { |
106 public: | 106 public: |
107 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 107 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
108 | 108 |
109 // Compare two flat ASCII strings and returns result in v0. | 109 // Compare two flat ASCII strings and returns result in v0. |
110 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 110 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
111 Register left, | 111 Register left, |
112 Register right, | 112 Register right, |
113 Register scratch1, | 113 Register scratch1, |
114 Register scratch2, | 114 Register scratch2, |
115 Register scratch3, | 115 Register scratch3, |
116 Register scratch4); | 116 Register scratch4); |
117 | 117 |
118 // Compares two flat ASCII strings for equality and returns result | 118 // Compares two flat ASCII strings for equality and returns result |
119 // in v0. | 119 // in v0. |
120 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | 120 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
121 Register left, | 121 Register left, |
122 Register right, | 122 Register right, |
123 Register scratch1, | 123 Register scratch1, |
124 Register scratch2, | 124 Register scratch2, |
125 Register scratch3); | 125 Register scratch3); |
126 | 126 |
127 private: | 127 private: |
128 virtual Major MajorKey() const { return StringCompare; } | 128 virtual Major MajorKey() const { return StringCompare; } |
129 virtual int MinorKey() const { return 0; } | 129 virtual uint32_t MinorKey() const { return 0; } |
130 virtual void Generate(MacroAssembler* masm); | 130 virtual void Generate(MacroAssembler* masm); |
131 | 131 |
132 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, | 132 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, |
133 Register left, | 133 Register left, |
134 Register right, | 134 Register right, |
135 Register length, | 135 Register length, |
136 Register scratch1, | 136 Register scratch1, |
137 Register scratch2, | 137 Register scratch2, |
138 Register scratch3, | 138 Register scratch3, |
139 Label* chars_not_equal); | 139 Label* chars_not_equal); |
(...skipping 29 matching lines...) Expand all Loading... |
169 Register scratch_; | 169 Register scratch_; |
170 Register sign_; | 170 Register sign_; |
171 | 171 |
172 // Minor key encoding in 16 bits. | 172 // Minor key encoding in 16 bits. |
173 class IntRegisterBits: public BitField<int, 0, 4> {}; | 173 class IntRegisterBits: public BitField<int, 0, 4> {}; |
174 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; | 174 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; |
175 class ScratchRegisterBits: public BitField<int, 8, 4> {}; | 175 class ScratchRegisterBits: public BitField<int, 8, 4> {}; |
176 class SignRegisterBits: public BitField<int, 12, 4> {}; | 176 class SignRegisterBits: public BitField<int, 12, 4> {}; |
177 | 177 |
178 Major MajorKey() const { return WriteInt32ToHeapNumber; } | 178 Major MajorKey() const { return WriteInt32ToHeapNumber; } |
179 int MinorKey() const { | 179 uint32_t MinorKey() const { |
180 // Encode the parameters in a unique 16 bit value. | 180 // Encode the parameters in a unique 16 bit value. |
181 return IntRegisterBits::encode(the_int_.code()) | 181 return IntRegisterBits::encode(the_int_.code()) |
182 | HeapNumberRegisterBits::encode(the_heap_number_.code()) | 182 | HeapNumberRegisterBits::encode(the_heap_number_.code()) |
183 | ScratchRegisterBits::encode(scratch_.code()) | 183 | ScratchRegisterBits::encode(scratch_.code()) |
184 | SignRegisterBits::encode(sign_.code()); | 184 | SignRegisterBits::encode(sign_.code()); |
185 } | 185 } |
186 | 186 |
187 void Generate(MacroAssembler* masm); | 187 void Generate(MacroAssembler* masm); |
188 }; | 188 }; |
189 | 189 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 void Generate(MacroAssembler* masm); | 341 void Generate(MacroAssembler* masm); |
342 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 342 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
343 void CheckNeedsToInformIncrementalMarker( | 343 void CheckNeedsToInformIncrementalMarker( |
344 MacroAssembler* masm, | 344 MacroAssembler* masm, |
345 OnNoNeedToInformIncrementalMarker on_no_need, | 345 OnNoNeedToInformIncrementalMarker on_no_need, |
346 Mode mode); | 346 Mode mode); |
347 void InformIncrementalMarker(MacroAssembler* masm); | 347 void InformIncrementalMarker(MacroAssembler* masm); |
348 | 348 |
349 Major MajorKey() const { return RecordWrite; } | 349 Major MajorKey() const { return RecordWrite; } |
350 | 350 |
351 int MinorKey() const { | 351 uint32_t MinorKey() const { |
352 return ObjectBits::encode(object_.code()) | | 352 return ObjectBits::encode(object_.code()) | |
353 ValueBits::encode(value_.code()) | | 353 ValueBits::encode(value_.code()) | |
354 AddressBits::encode(address_.code()) | | 354 AddressBits::encode(address_.code()) | |
355 RememberedSetActionBits::encode(remembered_set_action_) | | 355 RememberedSetActionBits::encode(remembered_set_action_) | |
356 SaveFPRegsModeBits::encode(save_fp_regs_mode_); | 356 SaveFPRegsModeBits::encode(save_fp_regs_mode_); |
357 } | 357 } |
358 | 358 |
359 void Activate(Code* code) { | 359 void Activate(Code* code) { |
360 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); | 360 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); |
361 } | 361 } |
(...skipping 20 matching lines...) Expand all Loading... |
382 // simplest approach is to generate such stub early enough so it can never be | 382 // simplest approach is to generate such stub early enough so it can never be |
383 // moved by GC | 383 // moved by GC |
384 class DirectCEntryStub: public PlatformCodeStub { | 384 class DirectCEntryStub: public PlatformCodeStub { |
385 public: | 385 public: |
386 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 386 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
387 void Generate(MacroAssembler* masm); | 387 void Generate(MacroAssembler* masm); |
388 void GenerateCall(MacroAssembler* masm, Register target); | 388 void GenerateCall(MacroAssembler* masm, Register target); |
389 | 389 |
390 private: | 390 private: |
391 Major MajorKey() const { return DirectCEntry; } | 391 Major MajorKey() const { return DirectCEntry; } |
392 int MinorKey() const { return 0; } | 392 uint32_t MinorKey() const { return 0; } |
393 | 393 |
394 bool NeedsImmovableCode() { return true; } | 394 bool NeedsImmovableCode() { return true; } |
395 }; | 395 }; |
396 | 396 |
397 | 397 |
398 class NameDictionaryLookupStub: public PlatformCodeStub { | 398 class NameDictionaryLookupStub: public PlatformCodeStub { |
399 public: | 399 public: |
400 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 400 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
401 | 401 |
402 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 402 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
(...skipping 26 matching lines...) Expand all Loading... |
429 static const int kCapacityOffset = | 429 static const int kCapacityOffset = |
430 NameDictionary::kHeaderSize + | 430 NameDictionary::kHeaderSize + |
431 NameDictionary::kCapacityIndex * kPointerSize; | 431 NameDictionary::kCapacityIndex * kPointerSize; |
432 | 432 |
433 static const int kElementsStartOffset = | 433 static const int kElementsStartOffset = |
434 NameDictionary::kHeaderSize + | 434 NameDictionary::kHeaderSize + |
435 NameDictionary::kElementsStartIndex * kPointerSize; | 435 NameDictionary::kElementsStartIndex * kPointerSize; |
436 | 436 |
437 Major MajorKey() const { return NameDictionaryLookup; } | 437 Major MajorKey() const { return NameDictionaryLookup; } |
438 | 438 |
439 int MinorKey() const { return LookupModeBits::encode(mode_); } | 439 uint32_t MinorKey() const { return LookupModeBits::encode(mode_); } |
440 | 440 |
441 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 441 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
442 | 442 |
443 LookupMode mode_; | 443 LookupMode mode_; |
444 }; | 444 }; |
445 | 445 |
446 | 446 |
447 } } // namespace v8::internal | 447 } } // namespace v8::internal |
448 | 448 |
449 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 449 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
OLD | NEW |