| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_ARM_CODE_STUBS_ARM_H_ | 5 #ifndef V8_ARM_CODE_STUBS_ARM_H_ |
| 6 #define V8_ARM_CODE_STUBS_ARM_H_ | 6 #define V8_ARM_CODE_STUBS_ARM_H_ |
| 7 | 7 |
| 8 #include "src/ic-inl.h" | 8 #include "src/ic-inl.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| 11 namespace internal { | 11 namespace internal { |
| 12 | 12 |
| 13 | 13 |
| 14 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); | 14 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); |
| 15 | 15 |
| 16 | 16 |
| 17 class StoreBufferOverflowStub: public PlatformCodeStub { | 17 class StoreBufferOverflowStub: public PlatformCodeStub { |
| 18 public: | 18 public: |
| 19 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp) | 19 StoreBufferOverflowStub(Isolate* isolate, SaveFPRegsMode save_fp) |
| 20 : PlatformCodeStub(isolate), save_doubles_(save_fp) {} | 20 : PlatformCodeStub(isolate), save_doubles_(save_fp) {} |
| 21 | 21 |
| 22 void Generate(MacroAssembler* masm); | 22 void Generate(MacroAssembler* masm); |
| 23 | 23 |
| 24 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 24 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
| 25 virtual bool SometimesSetsUpAFrame() { return false; } | 25 virtual bool SometimesSetsUpAFrame() { return false; } |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 SaveFPRegsMode save_doubles_; | 28 SaveFPRegsMode save_doubles_; |
| 29 | 29 |
| 30 Major MajorKey() { return StoreBufferOverflow; } | 30 Major MajorKey() const { return StoreBufferOverflow; } |
| 31 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 31 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 | 34 |
| 35 class StringHelper : public AllStatic { | 35 class StringHelper : public AllStatic { |
| 36 public: | 36 public: |
| 37 // Generate code for copying a large number of characters. This function | 37 // Generate code for copying a large number of characters. This function |
| 38 // is allowed to spend extra time setting up conditions to make copying | 38 // is allowed to spend extra time setting up conditions to make copying |
| 39 // faster. Copying of overlapping regions is not supported. | 39 // faster. Copying of overlapping regions is not supported. |
| 40 // Dest register ends at the position after the last character written. | 40 // Dest register ends at the position after the last character written. |
| 41 static void GenerateCopyCharacters(MacroAssembler* masm, | 41 static void GenerateCopyCharacters(MacroAssembler* masm, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 61 private: | 61 private: |
| 62 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | 62 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 | 65 |
| 66 class SubStringStub: public PlatformCodeStub { | 66 class SubStringStub: public PlatformCodeStub { |
| 67 public: | 67 public: |
| 68 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 68 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 Major MajorKey() { return SubString; } | 71 Major MajorKey() const { return SubString; } |
| 72 int MinorKey() { return 0; } | 72 int MinorKey() const { return 0; } |
| 73 | 73 |
| 74 void Generate(MacroAssembler* masm); | 74 void Generate(MacroAssembler* masm); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 | 77 |
| 78 | 78 |
| 79 class StringCompareStub: public PlatformCodeStub { | 79 class StringCompareStub: public PlatformCodeStub { |
| 80 public: | 80 public: |
| 81 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 81 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 82 | 82 |
| 83 // Compares two flat ASCII strings and returns result in r0. | 83 // Compares two flat ASCII strings and returns result in r0. |
| 84 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 84 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 85 Register left, | 85 Register left, |
| 86 Register right, | 86 Register right, |
| 87 Register scratch1, | 87 Register scratch1, |
| 88 Register scratch2, | 88 Register scratch2, |
| 89 Register scratch3, | 89 Register scratch3, |
| 90 Register scratch4); | 90 Register scratch4); |
| 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 r0. | 93 // in r0. |
| 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 Register scratch3); | 99 Register scratch3); |
| 100 | 100 |
| 101 private: | 101 private: |
| 102 virtual Major MajorKey() { return StringCompare; } | 102 virtual Major MajorKey() const { return StringCompare; } |
| 103 virtual int MinorKey() { return 0; } | 103 virtual int MinorKey() const { return 0; } |
| 104 virtual void Generate(MacroAssembler* masm); | 104 virtual void Generate(MacroAssembler* masm); |
| 105 | 105 |
| 106 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, | 106 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, |
| 107 Register left, | 107 Register left, |
| 108 Register right, | 108 Register right, |
| 109 Register length, | 109 Register length, |
| 110 Register scratch1, | 110 Register scratch1, |
| 111 Register scratch2, | 111 Register scratch2, |
| 112 Label* chars_not_equal); | 112 Label* chars_not_equal); |
| 113 }; | 113 }; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 132 private: | 132 private: |
| 133 Register the_int_; | 133 Register the_int_; |
| 134 Register the_heap_number_; | 134 Register the_heap_number_; |
| 135 Register scratch_; | 135 Register scratch_; |
| 136 | 136 |
| 137 // Minor key encoding in 16 bits. | 137 // Minor key encoding in 16 bits. |
| 138 class IntRegisterBits: public BitField<int, 0, 4> {}; | 138 class IntRegisterBits: public BitField<int, 0, 4> {}; |
| 139 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; | 139 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; |
| 140 class ScratchRegisterBits: public BitField<int, 8, 4> {}; | 140 class ScratchRegisterBits: public BitField<int, 8, 4> {}; |
| 141 | 141 |
| 142 Major MajorKey() { return WriteInt32ToHeapNumber; } | 142 Major MajorKey() const { return WriteInt32ToHeapNumber; } |
| 143 int MinorKey() { | 143 int MinorKey() const { |
| 144 // Encode the parameters in a unique 16 bit value. | 144 // Encode the parameters in a unique 16 bit value. |
| 145 return IntRegisterBits::encode(the_int_.code()) | 145 return IntRegisterBits::encode(the_int_.code()) |
| 146 | HeapNumberRegisterBits::encode(the_heap_number_.code()) | 146 | HeapNumberRegisterBits::encode(the_heap_number_.code()) |
| 147 | ScratchRegisterBits::encode(scratch_.code()); | 147 | ScratchRegisterBits::encode(scratch_.code()); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void Generate(MacroAssembler* masm); | 150 void Generate(MacroAssembler* masm); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 | 153 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 }; | 298 }; |
| 299 | 299 |
| 300 void Generate(MacroAssembler* masm); | 300 void Generate(MacroAssembler* masm); |
| 301 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 301 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
| 302 void CheckNeedsToInformIncrementalMarker( | 302 void CheckNeedsToInformIncrementalMarker( |
| 303 MacroAssembler* masm, | 303 MacroAssembler* masm, |
| 304 OnNoNeedToInformIncrementalMarker on_no_need, | 304 OnNoNeedToInformIncrementalMarker on_no_need, |
| 305 Mode mode); | 305 Mode mode); |
| 306 void InformIncrementalMarker(MacroAssembler* masm); | 306 void InformIncrementalMarker(MacroAssembler* masm); |
| 307 | 307 |
| 308 Major MajorKey() { return RecordWrite; } | 308 Major MajorKey() const { return RecordWrite; } |
| 309 | 309 |
| 310 int MinorKey() { | 310 int MinorKey() const { |
| 311 return ObjectBits::encode(object_.code()) | | 311 return ObjectBits::encode(object_.code()) | |
| 312 ValueBits::encode(value_.code()) | | 312 ValueBits::encode(value_.code()) | |
| 313 AddressBits::encode(address_.code()) | | 313 AddressBits::encode(address_.code()) | |
| 314 RememberedSetActionBits::encode(remembered_set_action_) | | 314 RememberedSetActionBits::encode(remembered_set_action_) | |
| 315 SaveFPRegsModeBits::encode(save_fp_regs_mode_); | 315 SaveFPRegsModeBits::encode(save_fp_regs_mode_); |
| 316 } | 316 } |
| 317 | 317 |
| 318 void Activate(Code* code) { | 318 void Activate(Code* code) { |
| 319 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); | 319 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); |
| 320 } | 320 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 340 // keep the code which called into native pinned in the memory. Currently the | 340 // keep the code which called into native pinned in the memory. Currently the |
| 341 // simplest approach is to generate such stub early enough so it can never be | 341 // simplest approach is to generate such stub early enough so it can never be |
| 342 // moved by GC | 342 // moved by GC |
| 343 class DirectCEntryStub: public PlatformCodeStub { | 343 class DirectCEntryStub: public PlatformCodeStub { |
| 344 public: | 344 public: |
| 345 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 345 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 346 void Generate(MacroAssembler* masm); | 346 void Generate(MacroAssembler* masm); |
| 347 void GenerateCall(MacroAssembler* masm, Register target); | 347 void GenerateCall(MacroAssembler* masm, Register target); |
| 348 | 348 |
| 349 private: | 349 private: |
| 350 Major MajorKey() { return DirectCEntry; } | 350 Major MajorKey() const { return DirectCEntry; } |
| 351 int MinorKey() { return 0; } | 351 int MinorKey() const { return 0; } |
| 352 | 352 |
| 353 bool NeedsImmovableCode() { return true; } | 353 bool NeedsImmovableCode() { return true; } |
| 354 }; | 354 }; |
| 355 | 355 |
| 356 | 356 |
| 357 class NameDictionaryLookupStub: public PlatformCodeStub { | 357 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 358 public: | 358 public: |
| 359 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 359 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 360 | 360 |
| 361 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 361 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 386 static const int kTotalProbes = 20; | 386 static const int kTotalProbes = 20; |
| 387 | 387 |
| 388 static const int kCapacityOffset = | 388 static const int kCapacityOffset = |
| 389 NameDictionary::kHeaderSize + | 389 NameDictionary::kHeaderSize + |
| 390 NameDictionary::kCapacityIndex * kPointerSize; | 390 NameDictionary::kCapacityIndex * kPointerSize; |
| 391 | 391 |
| 392 static const int kElementsStartOffset = | 392 static const int kElementsStartOffset = |
| 393 NameDictionary::kHeaderSize + | 393 NameDictionary::kHeaderSize + |
| 394 NameDictionary::kElementsStartIndex * kPointerSize; | 394 NameDictionary::kElementsStartIndex * kPointerSize; |
| 395 | 395 |
| 396 Major MajorKey() { return NameDictionaryLookup; } | 396 Major MajorKey() const { return NameDictionaryLookup; } |
| 397 | 397 |
| 398 int MinorKey() { | 398 int MinorKey() const { return LookupModeBits::encode(mode_); } |
| 399 return LookupModeBits::encode(mode_); | |
| 400 } | |
| 401 | 399 |
| 402 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 400 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 403 | 401 |
| 404 LookupMode mode_; | 402 LookupMode mode_; |
| 405 }; | 403 }; |
| 406 | 404 |
| 407 | 405 |
| 408 class PlatformCallInterfaceDescriptor { | 406 class PlatformCallInterfaceDescriptor { |
| 409 public: | 407 public: |
| 410 explicit PlatformCallInterfaceDescriptor( | 408 explicit PlatformCallInterfaceDescriptor( |
| 411 TargetAddressStorageMode storage_mode) | 409 TargetAddressStorageMode storage_mode) |
| 412 : storage_mode_(storage_mode) { } | 410 : storage_mode_(storage_mode) { } |
| 413 | 411 |
| 414 TargetAddressStorageMode storage_mode() { return storage_mode_; } | 412 TargetAddressStorageMode storage_mode() { return storage_mode_; } |
| 415 | 413 |
| 416 private: | 414 private: |
| 417 TargetAddressStorageMode storage_mode_; | 415 TargetAddressStorageMode storage_mode_; |
| 418 }; | 416 }; |
| 419 | 417 |
| 420 | 418 |
| 421 } } // namespace v8::internal | 419 } } // namespace v8::internal |
| 422 | 420 |
| 423 #endif // V8_ARM_CODE_STUBS_ARM_H_ | 421 #endif // V8_ARM_CODE_STUBS_ARM_H_ |
| OLD | NEW |