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" | |
9 | |
10 namespace v8 { | 8 namespace v8 { |
11 namespace internal { | 9 namespace internal { |
12 | 10 |
13 | 11 |
14 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); | 12 void ArrayNativeCode(MacroAssembler* masm, Label* call_generic_code); |
15 | 13 |
16 | 14 |
17 class StringHelper : public AllStatic { | 15 class StringHelper : public AllStatic { |
18 public: | 16 public: |
19 // TODO(all): These don't seem to be used any more. Delete them. | 17 // TODO(all): These don't seem to be used any more. Delete them. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class StoreRegistersStateStub: public PlatformCodeStub { | 54 class StoreRegistersStateStub: public PlatformCodeStub { |
57 public: | 55 public: |
58 explicit StoreRegistersStateStub(Isolate* isolate) | 56 explicit StoreRegistersStateStub(Isolate* isolate) |
59 : PlatformCodeStub(isolate) {} | 57 : PlatformCodeStub(isolate) {} |
60 | 58 |
61 static Register to_be_pushed_lr() { return ip0; } | 59 static Register to_be_pushed_lr() { return ip0; } |
62 | 60 |
63 static void GenerateAheadOfTime(Isolate* isolate); | 61 static void GenerateAheadOfTime(Isolate* isolate); |
64 | 62 |
65 private: | 63 private: |
66 virtual inline Major MajorKey() const FINAL OVERRIDE; | |
67 | |
68 void Generate(MacroAssembler* masm); | 64 void Generate(MacroAssembler* masm); |
69 | 65 |
70 DISALLOW_COPY_AND_ASSIGN(StoreRegistersStateStub); | 66 DEFINE_CODE_STUB(StoreRegistersState, PlatformCodeStub); |
71 }; | 67 }; |
72 | 68 |
73 | 69 |
74 class RestoreRegistersStateStub: public PlatformCodeStub { | 70 class RestoreRegistersStateStub: public PlatformCodeStub { |
75 public: | 71 public: |
76 explicit RestoreRegistersStateStub(Isolate* isolate) | 72 explicit RestoreRegistersStateStub(Isolate* isolate) |
77 : PlatformCodeStub(isolate) {} | 73 : PlatformCodeStub(isolate) {} |
78 | 74 |
79 static void GenerateAheadOfTime(Isolate* isolate); | 75 static void GenerateAheadOfTime(Isolate* isolate); |
80 | 76 |
81 private: | 77 private: |
82 virtual inline Major MajorKey() const FINAL OVERRIDE; | |
83 | |
84 void Generate(MacroAssembler* masm); | 78 void Generate(MacroAssembler* masm); |
85 | 79 |
86 DISALLOW_COPY_AND_ASSIGN(RestoreRegistersStateStub); | 80 DEFINE_CODE_STUB(RestoreRegistersState, PlatformCodeStub); |
87 }; | 81 }; |
88 | 82 |
89 | 83 |
90 class RecordWriteStub: public PlatformCodeStub { | 84 class RecordWriteStub: public PlatformCodeStub { |
91 public: | 85 public: |
92 // Stub to record the write of 'value' at 'address' in 'object'. | 86 // Stub to record the write of 'value' at 'address' in 'object'. |
93 // Typically 'address' = 'object' + <some offset>. | 87 // Typically 'address' = 'object' + <some offset>. |
94 // See MacroAssembler::RecordWriteField() for example. | 88 // See MacroAssembler::RecordWriteField() for example. |
95 RecordWriteStub(Isolate* isolate, | 89 RecordWriteStub(Isolate* isolate, |
96 Register object, | 90 Register object, |
97 Register value, | 91 Register value, |
98 Register address, | 92 Register address, |
99 RememberedSetAction remembered_set_action, | 93 RememberedSetAction remembered_set_action, |
100 SaveFPRegsMode fp_mode) | 94 SaveFPRegsMode fp_mode) |
101 : PlatformCodeStub(isolate), | 95 : PlatformCodeStub(isolate), |
102 regs_(object, // An input reg. | 96 regs_(object, // An input reg. |
103 address, // An input reg. | 97 address, // An input reg. |
104 value) { // One scratch reg. | 98 value) { // One scratch reg. |
105 DCHECK(object.Is64Bits()); | 99 DCHECK(object.Is64Bits()); |
106 DCHECK(value.Is64Bits()); | 100 DCHECK(value.Is64Bits()); |
107 DCHECK(address.Is64Bits()); | 101 DCHECK(address.Is64Bits()); |
108 minor_key_ = ObjectBits::encode(object.code()) | | 102 minor_key_ = ObjectBits::encode(object.code()) | |
109 ValueBits::encode(value.code()) | | 103 ValueBits::encode(value.code()) | |
110 AddressBits::encode(address.code()) | | 104 AddressBits::encode(address.code()) | |
111 RememberedSetActionBits::encode(remembered_set_action) | | 105 RememberedSetActionBits::encode(remembered_set_action) | |
112 SaveFPRegsModeBits::encode(fp_mode); | 106 SaveFPRegsModeBits::encode(fp_mode); |
113 } | 107 } |
114 | 108 |
| 109 RecordWriteStub(uint32_t key, Isolate* isolate) |
| 110 : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {} |
| 111 |
115 enum Mode { | 112 enum Mode { |
116 STORE_BUFFER_ONLY, | 113 STORE_BUFFER_ONLY, |
117 INCREMENTAL, | 114 INCREMENTAL, |
118 INCREMENTAL_COMPACTION | 115 INCREMENTAL_COMPACTION |
119 }; | 116 }; |
120 | 117 |
121 virtual bool SometimesSetsUpAFrame() { return false; } | 118 virtual bool SometimesSetsUpAFrame() { return false; } |
122 | 119 |
123 static Mode GetMode(Code* stub) { | 120 static Mode GetMode(Code* stub) { |
124 // Find the mode depending on the first two instructions. | 121 // Find the mode depending on the first two instructions. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 } | 284 } |
288 | 285 |
289 friend class RecordWriteStub; | 286 friend class RecordWriteStub; |
290 }; | 287 }; |
291 | 288 |
292 enum OnNoNeedToInformIncrementalMarker { | 289 enum OnNoNeedToInformIncrementalMarker { |
293 kReturnOnNoNeedToInformIncrementalMarker, | 290 kReturnOnNoNeedToInformIncrementalMarker, |
294 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker | 291 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker |
295 }; | 292 }; |
296 | 293 |
297 virtual inline Major MajorKey() const FINAL OVERRIDE; | 294 virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; } |
298 | 295 |
299 void Generate(MacroAssembler* masm); | 296 void Generate(MacroAssembler* masm); |
300 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 297 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
301 void CheckNeedsToInformIncrementalMarker( | 298 void CheckNeedsToInformIncrementalMarker( |
302 MacroAssembler* masm, | 299 MacroAssembler* masm, |
303 OnNoNeedToInformIncrementalMarker on_no_need, | 300 OnNoNeedToInformIncrementalMarker on_no_need, |
304 Mode mode); | 301 Mode mode); |
305 void InformIncrementalMarker(MacroAssembler* masm); | 302 void InformIncrementalMarker(MacroAssembler* masm); |
306 | 303 |
307 void Activate(Code* code) { | 304 void Activate(Code* code) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 338 |
342 // Helper to call C++ functions from generated code. The caller must prepare | 339 // Helper to call C++ functions from generated code. The caller must prepare |
343 // the exit frame before doing the call with GenerateCall. | 340 // the exit frame before doing the call with GenerateCall. |
344 class DirectCEntryStub: public PlatformCodeStub { | 341 class DirectCEntryStub: public PlatformCodeStub { |
345 public: | 342 public: |
346 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 343 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
347 void Generate(MacroAssembler* masm); | 344 void Generate(MacroAssembler* masm); |
348 void GenerateCall(MacroAssembler* masm, Register target); | 345 void GenerateCall(MacroAssembler* masm, Register target); |
349 | 346 |
350 private: | 347 private: |
351 virtual inline Major MajorKey() const FINAL OVERRIDE; | |
352 | |
353 bool NeedsImmovableCode() { return true; } | 348 bool NeedsImmovableCode() { return true; } |
354 | 349 |
355 DISALLOW_COPY_AND_ASSIGN(DirectCEntryStub); | 350 DEFINE_CODE_STUB(DirectCEntry, PlatformCodeStub); |
356 }; | 351 }; |
357 | 352 |
358 | 353 |
359 class NameDictionaryLookupStub: public PlatformCodeStub { | 354 class NameDictionaryLookupStub: public PlatformCodeStub { |
360 public: | 355 public: |
361 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 356 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
362 | 357 |
363 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 358 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
364 : PlatformCodeStub(isolate) { | 359 : PlatformCodeStub(isolate) { |
365 minor_key_ = LookupModeBits::encode(mode); | 360 minor_key_ = LookupModeBits::encode(mode); |
(...skipping 24 matching lines...) Expand all Loading... |
390 static const int kTotalProbes = 20; | 385 static const int kTotalProbes = 20; |
391 | 386 |
392 static const int kCapacityOffset = | 387 static const int kCapacityOffset = |
393 NameDictionary::kHeaderSize + | 388 NameDictionary::kHeaderSize + |
394 NameDictionary::kCapacityIndex * kPointerSize; | 389 NameDictionary::kCapacityIndex * kPointerSize; |
395 | 390 |
396 static const int kElementsStartOffset = | 391 static const int kElementsStartOffset = |
397 NameDictionary::kHeaderSize + | 392 NameDictionary::kHeaderSize + |
398 NameDictionary::kElementsStartIndex * kPointerSize; | 393 NameDictionary::kElementsStartIndex * kPointerSize; |
399 | 394 |
400 virtual inline Major MajorKey() const FINAL OVERRIDE; | |
401 | |
402 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } | 395 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } |
403 | 396 |
404 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 397 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
405 | 398 |
406 DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub); | 399 DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); |
407 }; | 400 }; |
408 | 401 |
409 } } // namespace v8::internal | 402 } } // namespace v8::internal |
410 | 403 |
411 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ | 404 #endif // V8_ARM64_CODE_STUBS_ARM64_H_ |
OLD | NEW |