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 { |
406 return LookupModeBits::encode(mode_); | 406 return LookupModeBits::encode(mode_); |
407 } | 407 } |
408 | 408 |
409 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 409 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
410 | 410 |
411 LookupMode mode_; | 411 LookupMode mode_; |
412 }; | 412 }; |
413 | 413 |
414 | 414 |
415 class SubStringStub: public PlatformCodeStub { | 415 class SubStringStub: public PlatformCodeStub { |
416 public: | 416 public: |
417 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 417 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
418 | 418 |
419 private: | 419 private: |
420 Major MajorKey() { return SubString; } | 420 Major MajorKey() const { return SubString; } |
421 int MinorKey() { return 0; } | 421 int MinorKey() const { return 0; } |
422 | 422 |
423 void Generate(MacroAssembler* masm); | 423 void Generate(MacroAssembler* masm); |
424 }; | 424 }; |
425 | 425 |
426 | 426 |
427 class StringCompareStub: public PlatformCodeStub { | 427 class StringCompareStub: public PlatformCodeStub { |
428 public: | 428 public: |
429 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 429 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
430 | 430 |
431 // Compares two flat ASCII strings and returns result in x0. | 431 // Compares two flat ASCII strings and returns result in x0. |
432 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 432 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
433 Register left, | 433 Register left, |
434 Register right, | 434 Register right, |
435 Register scratch1, | 435 Register scratch1, |
436 Register scratch2, | 436 Register scratch2, |
437 Register scratch3, | 437 Register scratch3, |
438 Register scratch4); | 438 Register scratch4); |
439 | 439 |
440 // Compare two flat ASCII strings for equality and returns result | 440 // Compare two flat ASCII strings for equality and returns result |
441 // in x0. | 441 // in x0. |
442 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | 442 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
443 Register left, | 443 Register left, |
444 Register right, | 444 Register right, |
445 Register scratch1, | 445 Register scratch1, |
446 Register scratch2, | 446 Register scratch2, |
447 Register scratch3); | 447 Register scratch3); |
448 | 448 |
449 private: | 449 private: |
450 virtual Major MajorKey() { return StringCompare; } | 450 virtual Major MajorKey() const { return StringCompare; } |
451 virtual int MinorKey() { return 0; } | 451 virtual int MinorKey() const { return 0; } |
452 virtual void Generate(MacroAssembler* masm); | 452 virtual void Generate(MacroAssembler* masm); |
453 | 453 |
454 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, | 454 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, |
455 Register left, | 455 Register left, |
456 Register right, | 456 Register right, |
457 Register length, | 457 Register length, |
458 Register scratch1, | 458 Register scratch1, |
459 Register scratch2, | 459 Register scratch2, |
460 Label* chars_not_equal); | 460 Label* chars_not_equal); |
461 }; | 461 }; |
462 | 462 |
463 | 463 |
464 class PlatformCallInterfaceDescriptor { | 464 class PlatformCallInterfaceDescriptor { |
465 public: | 465 public: |
466 explicit PlatformCallInterfaceDescriptor( | 466 explicit PlatformCallInterfaceDescriptor( |
467 TargetAddressStorageMode storage_mode) | 467 TargetAddressStorageMode storage_mode) |
468 : storage_mode_(storage_mode) { } | 468 : storage_mode_(storage_mode) { } |
469 | 469 |
470 TargetAddressStorageMode storage_mode() { return storage_mode_; } | 470 TargetAddressStorageMode storage_mode() { return storage_mode_; } |
471 | 471 |
472 private: | 472 private: |
473 TargetAddressStorageMode storage_mode_; | 473 TargetAddressStorageMode storage_mode_; |
474 }; | 474 }; |
475 | 475 |
476 | 476 |
477 } } // namespace v8::internal | 477 } } // namespace v8::internal |
478 | 478 |
479 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ | 479 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ |
OLD | NEW |