| 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 uint32_t MinorKey() const { 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 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 uint32_t MinorKey() const { return 0; } | 66 int 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 uint32_t MinorKey() const { return 0; } | 80 int 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 uint32_t MinorKey() const { | 306 int 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 uint32_t MinorKeyFor(Register object, Register value, Register address, | 311 static int MinorKeyFor(Register object, |
| 312 RememberedSetAction action, | 312 Register value, |
| 313 SaveFPRegsMode fp_mode) { | 313 Register address, |
| 314 RememberedSetAction action, |
| 315 SaveFPRegsMode fp_mode) { |
| 314 DCHECK(object.Is64Bits()); | 316 DCHECK(object.Is64Bits()); |
| 315 DCHECK(value.Is64Bits()); | 317 DCHECK(value.Is64Bits()); |
| 316 DCHECK(address.Is64Bits()); | 318 DCHECK(address.Is64Bits()); |
| 317 return ObjectBits::encode(object.code()) | | 319 return ObjectBits::encode(object.code()) | |
| 318 ValueBits::encode(value.code()) | | 320 ValueBits::encode(value.code()) | |
| 319 AddressBits::encode(address.code()) | | 321 AddressBits::encode(address.code()) | |
| 320 RememberedSetActionBits::encode(action) | | 322 RememberedSetActionBits::encode(action) | |
| 321 SaveFPRegsModeBits::encode(fp_mode); | 323 SaveFPRegsModeBits::encode(fp_mode); |
| 322 } | 324 } |
| 323 | 325 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 344 // Helper to call C++ functions from generated code. The caller must prepare | 346 // Helper to call C++ functions from generated code. The caller must prepare |
| 345 // the exit frame before doing the call with GenerateCall. | 347 // the exit frame before doing the call with GenerateCall. |
| 346 class DirectCEntryStub: public PlatformCodeStub { | 348 class DirectCEntryStub: public PlatformCodeStub { |
| 347 public: | 349 public: |
| 348 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 350 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 349 void Generate(MacroAssembler* masm); | 351 void Generate(MacroAssembler* masm); |
| 350 void GenerateCall(MacroAssembler* masm, Register target); | 352 void GenerateCall(MacroAssembler* masm, Register target); |
| 351 | 353 |
| 352 private: | 354 private: |
| 353 Major MajorKey() const { return DirectCEntry; } | 355 Major MajorKey() const { return DirectCEntry; } |
| 354 uint32_t MinorKey() const { return 0; } | 356 int MinorKey() const { return 0; } |
| 355 | 357 |
| 356 bool NeedsImmovableCode() { return true; } | 358 bool NeedsImmovableCode() { return true; } |
| 357 }; | 359 }; |
| 358 | 360 |
| 359 | 361 |
| 360 class NameDictionaryLookupStub: public PlatformCodeStub { | 362 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 361 public: | 363 public: |
| 362 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 364 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 363 | 365 |
| 364 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 366 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 391 static const int kCapacityOffset = | 393 static const int kCapacityOffset = |
| 392 NameDictionary::kHeaderSize + | 394 NameDictionary::kHeaderSize + |
| 393 NameDictionary::kCapacityIndex * kPointerSize; | 395 NameDictionary::kCapacityIndex * kPointerSize; |
| 394 | 396 |
| 395 static const int kElementsStartOffset = | 397 static const int kElementsStartOffset = |
| 396 NameDictionary::kHeaderSize + | 398 NameDictionary::kHeaderSize + |
| 397 NameDictionary::kElementsStartIndex * kPointerSize; | 399 NameDictionary::kElementsStartIndex * kPointerSize; |
| 398 | 400 |
| 399 Major MajorKey() const { return NameDictionaryLookup; } | 401 Major MajorKey() const { return NameDictionaryLookup; } |
| 400 | 402 |
| 401 uint32_t MinorKey() const { return LookupModeBits::encode(mode_); } | 403 int MinorKey() const { return LookupModeBits::encode(mode_); } |
| 402 | 404 |
| 403 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 405 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 404 | 406 |
| 405 LookupMode mode_; | 407 LookupMode mode_; |
| 406 }; | 408 }; |
| 407 | 409 |
| 408 | 410 |
| 409 class SubStringStub: public PlatformCodeStub { | 411 class SubStringStub: public PlatformCodeStub { |
| 410 public: | 412 public: |
| 411 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 413 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 412 | 414 |
| 413 private: | 415 private: |
| 414 Major MajorKey() const { return SubString; } | 416 Major MajorKey() const { return SubString; } |
| 415 uint32_t MinorKey() const { return 0; } | 417 int MinorKey() const { return 0; } |
| 416 | 418 |
| 417 void Generate(MacroAssembler* masm); | 419 void Generate(MacroAssembler* masm); |
| 418 }; | 420 }; |
| 419 | 421 |
| 420 | 422 |
| 421 class StringCompareStub: public PlatformCodeStub { | 423 class StringCompareStub: public PlatformCodeStub { |
| 422 public: | 424 public: |
| 423 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 425 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
| 424 | 426 |
| 425 // Compares two flat ASCII strings and returns result in x0. | 427 // Compares two flat ASCII strings and returns result in x0. |
| 426 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 428 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
| 427 Register left, | 429 Register left, |
| 428 Register right, | 430 Register right, |
| 429 Register scratch1, | 431 Register scratch1, |
| 430 Register scratch2, | 432 Register scratch2, |
| 431 Register scratch3, | 433 Register scratch3, |
| 432 Register scratch4); | 434 Register scratch4); |
| 433 | 435 |
| 434 // Compare two flat ASCII strings for equality and returns result | 436 // Compare two flat ASCII strings for equality and returns result |
| 435 // in x0. | 437 // in x0. |
| 436 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | 438 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
| 437 Register left, | 439 Register left, |
| 438 Register right, | 440 Register right, |
| 439 Register scratch1, | 441 Register scratch1, |
| 440 Register scratch2, | 442 Register scratch2, |
| 441 Register scratch3); | 443 Register scratch3); |
| 442 | 444 |
| 443 private: | 445 private: |
| 444 virtual Major MajorKey() const { return StringCompare; } | 446 virtual Major MajorKey() const { return StringCompare; } |
| 445 virtual uint32_t MinorKey() const { return 0; } | 447 virtual int MinorKey() const { return 0; } |
| 446 virtual void Generate(MacroAssembler* masm); | 448 virtual void Generate(MacroAssembler* masm); |
| 447 | 449 |
| 448 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, | 450 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, |
| 449 Register left, | 451 Register left, |
| 450 Register right, | 452 Register right, |
| 451 Register length, | 453 Register length, |
| 452 Register scratch1, | 454 Register scratch1, |
| 453 Register scratch2, | 455 Register scratch2, |
| 454 Label* chars_not_equal); | 456 Label* chars_not_equal); |
| 455 }; | 457 }; |
| 456 | 458 |
| 457 | 459 |
| 458 class PlatformInterfaceDescriptor { | 460 class PlatformInterfaceDescriptor { |
| 459 public: | 461 public: |
| 460 explicit PlatformInterfaceDescriptor( | 462 explicit PlatformInterfaceDescriptor( |
| 461 TargetAddressStorageMode storage_mode) | 463 TargetAddressStorageMode storage_mode) |
| 462 : storage_mode_(storage_mode) { } | 464 : storage_mode_(storage_mode) { } |
| 463 | 465 |
| 464 TargetAddressStorageMode storage_mode() { return storage_mode_; } | 466 TargetAddressStorageMode storage_mode() { return storage_mode_; } |
| 465 | 467 |
| 466 private: | 468 private: |
| 467 TargetAddressStorageMode storage_mode_; | 469 TargetAddressStorageMode storage_mode_; |
| 468 }; | 470 }; |
| 469 | 471 |
| 470 | 472 |
| 471 } } // namespace v8::internal | 473 } } // namespace v8::internal |
| 472 | 474 |
| 473 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ | 475 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ |
| OLD | NEW |