| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_CODE_STUBS_ARM64_H_ | 5 #ifndef V8_ARM64_CODE_STUBS_ARM64_H_ |
| 6 #define V8_ARM64_CODE_STUBS_ARM64_H_ | 6 #define V8_ARM64_CODE_STUBS_ARM64_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 // TODO(all): These don't seem to be used any more. Delete them. | 37 // TODO(all): These don't seem to be used any more. Delete them. |
| 38 | 38 |
| 39 // Generate string hash. | 39 // Generate string hash. |
| 40 static void GenerateHashInit(MacroAssembler* masm, | 40 static void GenerateHashInit(MacroAssembler* masm, |
| 41 Register hash, | 41 Register hash, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 55 | 55 |
| 56 | 56 |
| 57 class StoreRegistersStateStub: public PlatformCodeStub { | 57 class StoreRegistersStateStub: public PlatformCodeStub { |
| 58 public: | 58 public: |
| 59 StoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) | 59 StoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) |
| 60 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} | 60 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} |
| 61 | 61 |
| 62 static Register to_be_pushed_lr() { return ip0; } | 62 static Register to_be_pushed_lr() { return ip0; } |
| 63 static void GenerateAheadOfTime(Isolate* isolate); | 63 static void GenerateAheadOfTime(Isolate* isolate); |
| 64 private: | 64 private: |
| 65 Major MajorKey() { return StoreRegistersState; } | 65 Major MajorKey() const { return StoreRegistersState; } |
| 66 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 66 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
| 67 SaveFPRegsMode save_doubles_; | 67 SaveFPRegsMode save_doubles_; |
| 68 | 68 |
| 69 void Generate(MacroAssembler* masm); | 69 void Generate(MacroAssembler* masm); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 | 72 |
| 73 class RestoreRegistersStateStub: public PlatformCodeStub { | 73 class RestoreRegistersStateStub: public PlatformCodeStub { |
| 74 public: | 74 public: |
| 75 RestoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) | 75 RestoreRegistersStateStub(Isolate* isolate, SaveFPRegsMode with_fp) |
| 76 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} | 76 : PlatformCodeStub(isolate), save_doubles_(with_fp) {} |
| 77 | 77 |
| 78 static void GenerateAheadOfTime(Isolate* isolate); | 78 static void GenerateAheadOfTime(Isolate* isolate); |
| 79 private: | 79 private: |
| 80 Major MajorKey() { return RestoreRegistersState; } | 80 Major MajorKey() const { return RestoreRegistersState; } |
| 81 int MinorKey() { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 81 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } |
| 82 SaveFPRegsMode save_doubles_; | 82 SaveFPRegsMode save_doubles_; |
| 83 | 83 |
| 84 void Generate(MacroAssembler* masm); | 84 void Generate(MacroAssembler* masm); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 | 87 |
| 88 class RecordWriteStub: public PlatformCodeStub { | 88 class RecordWriteStub: public PlatformCodeStub { |
| 89 public: | 89 public: |
| 90 // Stub to record the write of 'value' at 'address' in 'object'. | 90 // Stub to record the write of 'value' at 'address' in 'object'. |
| 91 // Typically 'address' = 'object' + <some offset>. | 91 // Typically 'address' = 'object' + <some offset>. |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 kReturnOnNoNeedToInformIncrementalMarker, | 296 kReturnOnNoNeedToInformIncrementalMarker, |
| 297 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker | 297 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker |
| 298 }; | 298 }; |
| 299 | 299 |
| 300 void CheckNeedsToInformIncrementalMarker( | 300 void CheckNeedsToInformIncrementalMarker( |
| 301 MacroAssembler* masm, | 301 MacroAssembler* masm, |
| 302 OnNoNeedToInformIncrementalMarker on_no_need, | 302 OnNoNeedToInformIncrementalMarker on_no_need, |
| 303 Mode mode); | 303 Mode mode); |
| 304 void InformIncrementalMarker(MacroAssembler* masm); | 304 void InformIncrementalMarker(MacroAssembler* masm); |
| 305 | 305 |
| 306 Major MajorKey() { return RecordWrite; } | 306 Major MajorKey() const { return RecordWrite; } |
| 307 | 307 |
| 308 int MinorKey() { | 308 int MinorKey() const { |
| 309 return MinorKeyFor(object_, value_, address_, remembered_set_action_, | 309 return MinorKeyFor(object_, value_, address_, remembered_set_action_, |
| 310 save_fp_regs_mode_); | 310 save_fp_regs_mode_); |
| 311 } | 311 } |
| 312 | 312 |
| 313 static int MinorKeyFor(Register object, | 313 static int MinorKeyFor(Register object, |
| 314 Register value, | 314 Register value, |
| 315 Register address, | 315 Register address, |
| 316 RememberedSetAction action, | 316 RememberedSetAction action, |
| 317 SaveFPRegsMode fp_mode) { | 317 SaveFPRegsMode fp_mode) { |
| 318 ASSERT(object.Is64Bits()); | 318 ASSERT(object.Is64Bits()); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 347 | 347 |
| 348 // Helper to call C++ functions from generated code. The caller must prepare | 348 // Helper to call C++ functions from generated code. The caller must prepare |
| 349 // the exit frame before doing the call with GenerateCall. | 349 // the exit frame before doing the call with GenerateCall. |
| 350 class DirectCEntryStub: public PlatformCodeStub { | 350 class DirectCEntryStub: public PlatformCodeStub { |
| 351 public: | 351 public: |
| 352 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 352 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 353 void Generate(MacroAssembler* masm); | 353 void Generate(MacroAssembler* masm); |
| 354 void GenerateCall(MacroAssembler* masm, Register target); | 354 void GenerateCall(MacroAssembler* masm, Register target); |
| 355 | 355 |
| 356 private: | 356 private: |
| 357 Major MajorKey() { return DirectCEntry; } | 357 Major MajorKey() const { return DirectCEntry; } |
| 358 int MinorKey() { return 0; } | 358 int MinorKey() const { return 0; } |
| 359 | 359 |
| 360 bool NeedsImmovableCode() { return true; } | 360 bool NeedsImmovableCode() { return true; } |
| 361 }; | 361 }; |
| 362 | 362 |
| 363 | 363 |
| 364 class NameDictionaryLookupStub: public PlatformCodeStub { | 364 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 365 public: | 365 public: |
| 366 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 366 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 367 | 367 |
| 368 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 368 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 393 static const int kTotalProbes = 20; | 393 static const int kTotalProbes = 20; |
| 394 | 394 |
| 395 static const int kCapacityOffset = | 395 static const int kCapacityOffset = |
| 396 NameDictionary::kHeaderSize + | 396 NameDictionary::kHeaderSize + |
| 397 NameDictionary::kCapacityIndex * kPointerSize; | 397 NameDictionary::kCapacityIndex * kPointerSize; |
| 398 | 398 |
| 399 static const int kElementsStartOffset = | 399 static const int kElementsStartOffset = |
| 400 NameDictionary::kHeaderSize + | 400 NameDictionary::kHeaderSize + |
| 401 NameDictionary::kElementsStartIndex * kPointerSize; | 401 NameDictionary::kElementsStartIndex * kPointerSize; |
| 402 | 402 |
| 403 Major MajorKey() { return NameDictionaryLookup; } | 403 Major MajorKey() const { return NameDictionaryLookup; } |
| 404 | 404 |
| 405 int MinorKey() { | 405 int MinorKey() const { return LookupModeBits::encode(mode_); } |
| 406 return LookupModeBits::encode(mode_); | |
| 407 } | |
| 408 | 406 |
| 409 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 407 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 410 | 408 |
| 411 LookupMode mode_; | 409 LookupMode mode_; |
| 412 }; | 410 }; |
| 413 | 411 |
| 414 | 412 |
| 415 class SubStringStub: public PlatformCodeStub { | 413 class SubStringStub: public PlatformCodeStub { |
| 416 public: | 414 public: |
| 417 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 415 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 418 | 416 |
| 419 private: | 417 private: |
| 420 Major MajorKey() { return SubString; } | 418 Major MajorKey() const { return SubString; } |
| 421 int MinorKey() { return 0; } | 419 int MinorKey() const { return 0; } |
| 422 | 420 |
| 423 void Generate(MacroAssembler* masm); | 421 void Generate(MacroAssembler* masm); |
| 424 }; | 422 }; |
| 425 | 423 |
| 426 | 424 |
| 427 class StringCompareStub: public PlatformCodeStub { | 425 class StringCompareStub: public PlatformCodeStub { |
| 428 public: | 426 public: |
| 429 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 427 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 430 | 428 |
| 431 // Compares two flat ASCII strings and returns result in x0. | 429 // Compares two flat ASCII strings and returns result in x0. |
| 432 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 430 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 433 Register left, | 431 Register left, |
| 434 Register right, | 432 Register right, |
| 435 Register scratch1, | 433 Register scratch1, |
| 436 Register scratch2, | 434 Register scratch2, |
| 437 Register scratch3, | 435 Register scratch3, |
| 438 Register scratch4); | 436 Register scratch4); |
| 439 | 437 |
| 440 // Compare two flat ASCII strings for equality and returns result | 438 // Compare two flat ASCII strings for equality and returns result |
| 441 // in x0. | 439 // in x0. |
| 442 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | 440 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
| 443 Register left, | 441 Register left, |
| 444 Register right, | 442 Register right, |
| 445 Register scratch1, | 443 Register scratch1, |
| 446 Register scratch2, | 444 Register scratch2, |
| 447 Register scratch3); | 445 Register scratch3); |
| 448 | 446 |
| 449 private: | 447 private: |
| 450 virtual Major MajorKey() { return StringCompare; } | 448 virtual Major MajorKey() const { return StringCompare; } |
| 451 virtual int MinorKey() { return 0; } | 449 virtual int MinorKey() const { return 0; } |
| 452 virtual void Generate(MacroAssembler* masm); | 450 virtual void Generate(MacroAssembler* masm); |
| 453 | 451 |
| 454 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, | 452 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, |
| 455 Register left, | 453 Register left, |
| 456 Register right, | 454 Register right, |
| 457 Register length, | 455 Register length, |
| 458 Register scratch1, | 456 Register scratch1, |
| 459 Register scratch2, | 457 Register scratch2, |
| 460 Label* chars_not_equal); | 458 Label* chars_not_equal); |
| 461 }; | 459 }; |
| 462 | 460 |
| 463 | 461 |
| 464 class PlatformCallInterfaceDescriptor { | 462 class PlatformCallInterfaceDescriptor { |
| 465 public: | 463 public: |
| 466 explicit PlatformCallInterfaceDescriptor( | 464 explicit PlatformCallInterfaceDescriptor( |
| 467 TargetAddressStorageMode storage_mode) | 465 TargetAddressStorageMode storage_mode) |
| 468 : storage_mode_(storage_mode) { } | 466 : storage_mode_(storage_mode) { } |
| 469 | 467 |
| 470 TargetAddressStorageMode storage_mode() { return storage_mode_; } | 468 TargetAddressStorageMode storage_mode() { return storage_mode_; } |
| 471 | 469 |
| 472 private: | 470 private: |
| 473 TargetAddressStorageMode storage_mode_; | 471 TargetAddressStorageMode storage_mode_; |
| 474 }; | 472 }; |
| 475 | 473 |
| 476 | 474 |
| 477 } } // namespace v8::internal | 475 } } // namespace v8::internal |
| 478 | 476 |
| 479 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ | 477 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ |
| OLD | NEW |