| 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/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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() const { return StoreBufferOverflow; } | 30 Major MajorKey() const { return StoreBufferOverflow; } |
| 31 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } | 31 uint32_t 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 14 matching lines...) Expand all Loading... |
| 56 | 56 |
| 57 class StoreRegistersStateStub: public PlatformCodeStub { | 57 class StoreRegistersStateStub: public PlatformCodeStub { |
| 58 public: | 58 public: |
| 59 explicit StoreRegistersStateStub(Isolate* isolate) | 59 explicit StoreRegistersStateStub(Isolate* isolate) |
| 60 : PlatformCodeStub(isolate) {} | 60 : PlatformCodeStub(isolate) {} |
| 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() const { return StoreRegistersState; } | 65 Major MajorKey() const { return StoreRegistersState; } |
| 66 int MinorKey() const { return 0; } | 66 uint32_t MinorKey() const { return 0; } |
| 67 | 67 |
| 68 void Generate(MacroAssembler* masm); | 68 void Generate(MacroAssembler* masm); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 | 71 |
| 72 class RestoreRegistersStateStub: public PlatformCodeStub { | 72 class RestoreRegistersStateStub: public PlatformCodeStub { |
| 73 public: | 73 public: |
| 74 explicit RestoreRegistersStateStub(Isolate* isolate) | 74 explicit RestoreRegistersStateStub(Isolate* isolate) |
| 75 : PlatformCodeStub(isolate) {} | 75 : PlatformCodeStub(isolate) {} |
| 76 | 76 |
| 77 static void GenerateAheadOfTime(Isolate* isolate); | 77 static void GenerateAheadOfTime(Isolate* isolate); |
| 78 private: | 78 private: |
| 79 Major MajorKey() const { return RestoreRegistersState; } | 79 Major MajorKey() const { return RestoreRegistersState; } |
| 80 int MinorKey() const { return 0; } | 80 uint32_t MinorKey() const { return 0; } |
| 81 | 81 |
| 82 void Generate(MacroAssembler* masm); | 82 void Generate(MacroAssembler* masm); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 | 85 |
| 86 class RecordWriteStub: public PlatformCodeStub { | 86 class RecordWriteStub: public PlatformCodeStub { |
| 87 public: | 87 public: |
| 88 // Stub to record the write of 'value' at 'address' in 'object'. | 88 // Stub to record the write of 'value' at 'address' in 'object'. |
| 89 // Typically 'address' = 'object' + <some offset>. | 89 // Typically 'address' = 'object' + <some offset>. |
| 90 // See MacroAssembler::RecordWriteField() for example. | 90 // See MacroAssembler::RecordWriteField() for example. |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 }; | 296 }; |
| 297 | 297 |
| 298 void CheckNeedsToInformIncrementalMarker( | 298 void CheckNeedsToInformIncrementalMarker( |
| 299 MacroAssembler* masm, | 299 MacroAssembler* masm, |
| 300 OnNoNeedToInformIncrementalMarker on_no_need, | 300 OnNoNeedToInformIncrementalMarker on_no_need, |
| 301 Mode mode); | 301 Mode mode); |
| 302 void InformIncrementalMarker(MacroAssembler* masm); | 302 void InformIncrementalMarker(MacroAssembler* masm); |
| 303 | 303 |
| 304 Major MajorKey() const { return RecordWrite; } | 304 Major MajorKey() const { return RecordWrite; } |
| 305 | 305 |
| 306 int MinorKey() const { | 306 uint32_t MinorKey() const { |
| 307 return MinorKeyFor(object_, value_, address_, remembered_set_action_, | 307 return MinorKeyFor(object_, value_, address_, remembered_set_action_, |
| 308 save_fp_regs_mode_); | 308 save_fp_regs_mode_); |
| 309 } | 309 } |
| 310 | 310 |
| 311 static int MinorKeyFor(Register object, | 311 static uint32_t MinorKeyFor(Register object, Register value, Register address, |
| 312 Register value, | 312 RememberedSetAction action, |
| 313 Register address, | 313 SaveFPRegsMode fp_mode) { |
| 314 RememberedSetAction action, | |
| 315 SaveFPRegsMode fp_mode) { | |
| 316 DCHECK(object.Is64Bits()); | 314 DCHECK(object.Is64Bits()); |
| 317 DCHECK(value.Is64Bits()); | 315 DCHECK(value.Is64Bits()); |
| 318 DCHECK(address.Is64Bits()); | 316 DCHECK(address.Is64Bits()); |
| 319 return ObjectBits::encode(object.code()) | | 317 return ObjectBits::encode(object.code()) | |
| 320 ValueBits::encode(value.code()) | | 318 ValueBits::encode(value.code()) | |
| 321 AddressBits::encode(address.code()) | | 319 AddressBits::encode(address.code()) | |
| 322 RememberedSetActionBits::encode(action) | | 320 RememberedSetActionBits::encode(action) | |
| 323 SaveFPRegsModeBits::encode(fp_mode); | 321 SaveFPRegsModeBits::encode(fp_mode); |
| 324 } | 322 } |
| 325 | 323 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 346 // Helper to call C++ functions from generated code. The caller must prepare | 344 // Helper to call C++ functions from generated code. The caller must prepare |
| 347 // the exit frame before doing the call with GenerateCall. | 345 // the exit frame before doing the call with GenerateCall. |
| 348 class DirectCEntryStub: public PlatformCodeStub { | 346 class DirectCEntryStub: public PlatformCodeStub { |
| 349 public: | 347 public: |
| 350 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 348 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 351 void Generate(MacroAssembler* masm); | 349 void Generate(MacroAssembler* masm); |
| 352 void GenerateCall(MacroAssembler* masm, Register target); | 350 void GenerateCall(MacroAssembler* masm, Register target); |
| 353 | 351 |
| 354 private: | 352 private: |
| 355 Major MajorKey() const { return DirectCEntry; } | 353 Major MajorKey() const { return DirectCEntry; } |
| 356 int MinorKey() const { return 0; } | 354 uint32_t MinorKey() const { return 0; } |
| 357 | 355 |
| 358 bool NeedsImmovableCode() { return true; } | 356 bool NeedsImmovableCode() { return true; } |
| 359 }; | 357 }; |
| 360 | 358 |
| 361 | 359 |
| 362 class NameDictionaryLookupStub: public PlatformCodeStub { | 360 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 363 public: | 361 public: |
| 364 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 362 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 365 | 363 |
| 366 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 364 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 393 static const int kCapacityOffset = | 391 static const int kCapacityOffset = |
| 394 NameDictionary::kHeaderSize + | 392 NameDictionary::kHeaderSize + |
| 395 NameDictionary::kCapacityIndex * kPointerSize; | 393 NameDictionary::kCapacityIndex * kPointerSize; |
| 396 | 394 |
| 397 static const int kElementsStartOffset = | 395 static const int kElementsStartOffset = |
| 398 NameDictionary::kHeaderSize + | 396 NameDictionary::kHeaderSize + |
| 399 NameDictionary::kElementsStartIndex * kPointerSize; | 397 NameDictionary::kElementsStartIndex * kPointerSize; |
| 400 | 398 |
| 401 Major MajorKey() const { return NameDictionaryLookup; } | 399 Major MajorKey() const { return NameDictionaryLookup; } |
| 402 | 400 |
| 403 int MinorKey() const { return LookupModeBits::encode(mode_); } | 401 uint32_t MinorKey() const { return LookupModeBits::encode(mode_); } |
| 404 | 402 |
| 405 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 403 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 406 | 404 |
| 407 LookupMode mode_; | 405 LookupMode mode_; |
| 408 }; | 406 }; |
| 409 | 407 |
| 410 | 408 |
| 411 class SubStringStub: public PlatformCodeStub { | 409 class SubStringStub: public PlatformCodeStub { |
| 412 public: | 410 public: |
| 413 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 411 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 414 | 412 |
| 415 private: | 413 private: |
| 416 Major MajorKey() const { return SubString; } | 414 Major MajorKey() const { return SubString; } |
| 417 int MinorKey() const { return 0; } | 415 uint32_t MinorKey() const { return 0; } |
| 418 | 416 |
| 419 void Generate(MacroAssembler* masm); | 417 void Generate(MacroAssembler* masm); |
| 420 }; | 418 }; |
| 421 | 419 |
| 422 | 420 |
| 423 class StringCompareStub: public PlatformCodeStub { | 421 class StringCompareStub: public PlatformCodeStub { |
| 424 public: | 422 public: |
| 425 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 423 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 426 | 424 |
| 427 // Compares two flat ASCII strings and returns result in x0. | 425 // Compares two flat ASCII strings and returns result in x0. |
| 428 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 426 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 429 Register left, | 427 Register left, |
| 430 Register right, | 428 Register right, |
| 431 Register scratch1, | 429 Register scratch1, |
| 432 Register scratch2, | 430 Register scratch2, |
| 433 Register scratch3, | 431 Register scratch3, |
| 434 Register scratch4); | 432 Register scratch4); |
| 435 | 433 |
| 436 // Compare two flat ASCII strings for equality and returns result | 434 // Compare two flat ASCII strings for equality and returns result |
| 437 // in x0. | 435 // in x0. |
| 438 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | 436 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
| 439 Register left, | 437 Register left, |
| 440 Register right, | 438 Register right, |
| 441 Register scratch1, | 439 Register scratch1, |
| 442 Register scratch2, | 440 Register scratch2, |
| 443 Register scratch3); | 441 Register scratch3); |
| 444 | 442 |
| 445 private: | 443 private: |
| 446 virtual Major MajorKey() const { return StringCompare; } | 444 virtual Major MajorKey() const { return StringCompare; } |
| 447 virtual int MinorKey() const { return 0; } | 445 virtual uint32_t MinorKey() const { return 0; } |
| 448 virtual void Generate(MacroAssembler* masm); | 446 virtual void Generate(MacroAssembler* masm); |
| 449 | 447 |
| 450 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, | 448 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, |
| 451 Register left, | 449 Register left, |
| 452 Register right, | 450 Register right, |
| 453 Register length, | 451 Register length, |
| 454 Register scratch1, | 452 Register scratch1, |
| 455 Register scratch2, | 453 Register scratch2, |
| 456 Label* chars_not_equal); | 454 Label* chars_not_equal); |
| 457 }; | 455 }; |
| 458 | 456 |
| 459 | 457 |
| 460 class PlatformInterfaceDescriptor { | 458 class PlatformInterfaceDescriptor { |
| 461 public: | 459 public: |
| 462 explicit PlatformInterfaceDescriptor( | 460 explicit PlatformInterfaceDescriptor( |
| 463 TargetAddressStorageMode storage_mode) | 461 TargetAddressStorageMode storage_mode) |
| 464 : storage_mode_(storage_mode) { } | 462 : storage_mode_(storage_mode) { } |
| 465 | 463 |
| 466 TargetAddressStorageMode storage_mode() { return storage_mode_; } | 464 TargetAddressStorageMode storage_mode() { return storage_mode_; } |
| 467 | 465 |
| 468 private: | 466 private: |
| 469 TargetAddressStorageMode storage_mode_; | 467 TargetAddressStorageMode storage_mode_; |
| 470 }; | 468 }; |
| 471 | 469 |
| 472 | 470 |
| 473 } } // namespace v8::internal | 471 } } // namespace v8::internal |
| 474 | 472 |
| 475 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ | 473 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ |
| OLD | NEW |