| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_MIPS_CODE_STUBS_ARM_H_ | 5 #ifndef V8_MIPS_CODE_STUBS_ARM_H_ |
| 6 #define V8_MIPS_CODE_STUBS_ARM_H_ | 6 #define V8_MIPS_CODE_STUBS_ARM_H_ |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 | 58 |
| 59 class StoreRegistersStateStub: public PlatformCodeStub { | 59 class StoreRegistersStateStub: public PlatformCodeStub { |
| 60 public: | 60 public: |
| 61 explicit StoreRegistersStateStub(Isolate* isolate) | 61 explicit StoreRegistersStateStub(Isolate* isolate) |
| 62 : PlatformCodeStub(isolate) {} | 62 : PlatformCodeStub(isolate) {} |
| 63 | 63 |
| 64 static void GenerateAheadOfTime(Isolate* isolate); | 64 static void GenerateAheadOfTime(Isolate* isolate); |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 void Generate(MacroAssembler* masm); | 67 DEFINE_PLATFORM_CODE_STUB(StoreRegistersState, PlatformCodeStub); |
| 68 | |
| 69 DEFINE_CODE_STUB(StoreRegistersState, PlatformCodeStub); | |
| 70 }; | 68 }; |
| 71 | 69 |
| 72 | 70 |
| 73 class RestoreRegistersStateStub: public PlatformCodeStub { | 71 class RestoreRegistersStateStub: public PlatformCodeStub { |
| 74 public: | 72 public: |
| 75 explicit RestoreRegistersStateStub(Isolate* isolate) | 73 explicit RestoreRegistersStateStub(Isolate* isolate) |
| 76 : PlatformCodeStub(isolate) {} | 74 : PlatformCodeStub(isolate) {} |
| 77 | 75 |
| 78 static void GenerateAheadOfTime(Isolate* isolate); | 76 static void GenerateAheadOfTime(Isolate* isolate); |
| 79 | 77 |
| 80 private: | 78 private: |
| 81 void Generate(MacroAssembler* masm); | 79 DEFINE_PLATFORM_CODE_STUB(RestoreRegistersState, PlatformCodeStub); |
| 82 | |
| 83 DEFINE_CODE_STUB(RestoreRegistersState, PlatformCodeStub); | |
| 84 }; | 80 }; |
| 85 | 81 |
| 86 | 82 |
| 87 // This stub can convert a signed int32 to a heap number (double). It does | 83 // This stub can convert a signed int32 to a heap number (double). It does |
| 88 // not work for int32s that are in Smi range! No GC occurs during this stub | 84 // not work for int32s that are in Smi range! No GC occurs during this stub |
| 89 // so you don't have to set up the frame. | 85 // so you don't have to set up the frame. |
| 90 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { | 86 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { |
| 91 public: | 87 public: |
| 92 WriteInt32ToHeapNumberStub(Isolate* isolate, Register the_int, | 88 WriteInt32ToHeapNumberStub(Isolate* isolate, Register the_int, |
| 93 Register the_heap_number, Register scratch, | 89 Register the_heap_number, Register scratch, |
| 94 Register scratch2) | 90 Register scratch2) |
| 95 : PlatformCodeStub(isolate) { | 91 : PlatformCodeStub(isolate) { |
| 96 minor_key_ = IntRegisterBits::encode(the_int.code()) | | 92 minor_key_ = IntRegisterBits::encode(the_int.code()) | |
| 97 HeapNumberRegisterBits::encode(the_heap_number.code()) | | 93 HeapNumberRegisterBits::encode(the_heap_number.code()) | |
| 98 ScratchRegisterBits::encode(scratch.code()) | | 94 ScratchRegisterBits::encode(scratch.code()) | |
| 99 SignRegisterBits::encode(scratch2.code()); | 95 SignRegisterBits::encode(scratch2.code()); |
| 100 DCHECK(IntRegisterBits::is_valid(the_int.code())); | 96 DCHECK(IntRegisterBits::is_valid(the_int.code())); |
| 101 DCHECK(HeapNumberRegisterBits::is_valid(the_heap_number.code())); | 97 DCHECK(HeapNumberRegisterBits::is_valid(the_heap_number.code())); |
| 102 DCHECK(ScratchRegisterBits::is_valid(scratch.code())); | 98 DCHECK(ScratchRegisterBits::is_valid(scratch.code())); |
| 103 DCHECK(SignRegisterBits::is_valid(scratch2.code())); | 99 DCHECK(SignRegisterBits::is_valid(scratch2.code())); |
| 104 } | 100 } |
| 105 | 101 |
| 106 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 102 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
| 107 | 103 |
| 108 private: | 104 private: |
| 109 void Generate(MacroAssembler* masm); | |
| 110 | |
| 111 Register the_int() const { | 105 Register the_int() const { |
| 112 return Register::from_code(IntRegisterBits::decode(minor_key_)); | 106 return Register::from_code(IntRegisterBits::decode(minor_key_)); |
| 113 } | 107 } |
| 114 | 108 |
| 115 Register the_heap_number() const { | 109 Register the_heap_number() const { |
| 116 return Register::from_code(HeapNumberRegisterBits::decode(minor_key_)); | 110 return Register::from_code(HeapNumberRegisterBits::decode(minor_key_)); |
| 117 } | 111 } |
| 118 | 112 |
| 119 Register scratch() const { | 113 Register scratch() const { |
| 120 return Register::from_code(ScratchRegisterBits::decode(minor_key_)); | 114 return Register::from_code(ScratchRegisterBits::decode(minor_key_)); |
| 121 } | 115 } |
| 122 | 116 |
| 123 Register sign() const { | 117 Register sign() const { |
| 124 return Register::from_code(SignRegisterBits::decode(minor_key_)); | 118 return Register::from_code(SignRegisterBits::decode(minor_key_)); |
| 125 } | 119 } |
| 126 | 120 |
| 127 // Minor key encoding in 16 bits. | 121 // Minor key encoding in 16 bits. |
| 128 class IntRegisterBits: public BitField<int, 0, 4> {}; | 122 class IntRegisterBits: public BitField<int, 0, 4> {}; |
| 129 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; | 123 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; |
| 130 class ScratchRegisterBits: public BitField<int, 8, 4> {}; | 124 class ScratchRegisterBits: public BitField<int, 8, 4> {}; |
| 131 class SignRegisterBits: public BitField<int, 12, 4> {}; | 125 class SignRegisterBits: public BitField<int, 12, 4> {}; |
| 132 | 126 |
| 133 DEFINE_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub); | 127 DEFINE_PLATFORM_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub); |
| 134 }; | 128 }; |
| 135 | 129 |
| 136 | 130 |
| 137 class RecordWriteStub: public PlatformCodeStub { | 131 class RecordWriteStub: public PlatformCodeStub { |
| 138 public: | 132 public: |
| 139 RecordWriteStub(Isolate* isolate, | 133 RecordWriteStub(Isolate* isolate, |
| 140 Register object, | 134 Register object, |
| 141 Register value, | 135 Register value, |
| 142 Register address, | 136 Register address, |
| 143 RememberedSetAction remembered_set_action, | 137 RememberedSetAction remembered_set_action, |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 friend class RecordWriteStub; | 276 friend class RecordWriteStub; |
| 283 }; | 277 }; |
| 284 | 278 |
| 285 enum OnNoNeedToInformIncrementalMarker { | 279 enum OnNoNeedToInformIncrementalMarker { |
| 286 kReturnOnNoNeedToInformIncrementalMarker, | 280 kReturnOnNoNeedToInformIncrementalMarker, |
| 287 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker | 281 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker |
| 288 }; | 282 }; |
| 289 | 283 |
| 290 virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; } | 284 virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; } |
| 291 | 285 |
| 292 void Generate(MacroAssembler* masm); | 286 virtual void Generate(MacroAssembler* masm) OVERRIDE; |
| 293 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 287 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
| 294 void CheckNeedsToInformIncrementalMarker( | 288 void CheckNeedsToInformIncrementalMarker( |
| 295 MacroAssembler* masm, | 289 MacroAssembler* masm, |
| 296 OnNoNeedToInformIncrementalMarker on_no_need, | 290 OnNoNeedToInformIncrementalMarker on_no_need, |
| 297 Mode mode); | 291 Mode mode); |
| 298 void InformIncrementalMarker(MacroAssembler* masm); | 292 void InformIncrementalMarker(MacroAssembler* masm); |
| 299 | 293 |
| 300 void Activate(Code* code) { | 294 void Activate(Code* code) { |
| 301 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); | 295 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); |
| 302 } | 296 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 329 |
| 336 | 330 |
| 337 // Trampoline stub to call into native code. To call safely into native code | 331 // Trampoline stub to call into native code. To call safely into native code |
| 338 // in the presence of compacting GC (which can move code objects) we need to | 332 // in the presence of compacting GC (which can move code objects) we need to |
| 339 // keep the code which called into native pinned in the memory. Currently the | 333 // keep the code which called into native pinned in the memory. Currently the |
| 340 // simplest approach is to generate such stub early enough so it can never be | 334 // simplest approach is to generate such stub early enough so it can never be |
| 341 // moved by GC | 335 // moved by GC |
| 342 class DirectCEntryStub: public PlatformCodeStub { | 336 class DirectCEntryStub: public PlatformCodeStub { |
| 343 public: | 337 public: |
| 344 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 338 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 345 void Generate(MacroAssembler* masm); | |
| 346 void GenerateCall(MacroAssembler* masm, Register target); | 339 void GenerateCall(MacroAssembler* masm, Register target); |
| 347 | 340 |
| 348 private: | 341 private: |
| 349 bool NeedsImmovableCode() { return true; } | 342 bool NeedsImmovableCode() { return true; } |
| 350 | 343 |
| 351 DEFINE_CODE_STUB(DirectCEntry, PlatformCodeStub); | 344 DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub); |
| 352 }; | 345 }; |
| 353 | 346 |
| 354 | 347 |
| 355 class NameDictionaryLookupStub: public PlatformCodeStub { | 348 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 356 public: | 349 public: |
| 357 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 350 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 358 | 351 |
| 359 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 352 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
| 360 : PlatformCodeStub(isolate) { | 353 : PlatformCodeStub(isolate) { |
| 361 minor_key_ = LookupModeBits::encode(mode); | 354 minor_key_ = LookupModeBits::encode(mode); |
| 362 } | 355 } |
| 363 | 356 |
| 364 void Generate(MacroAssembler* masm); | |
| 365 | |
| 366 static void GenerateNegativeLookup(MacroAssembler* masm, | 357 static void GenerateNegativeLookup(MacroAssembler* masm, |
| 367 Label* miss, | 358 Label* miss, |
| 368 Label* done, | 359 Label* done, |
| 369 Register receiver, | 360 Register receiver, |
| 370 Register properties, | 361 Register properties, |
| 371 Handle<Name> name, | 362 Handle<Name> name, |
| 372 Register scratch0); | 363 Register scratch0); |
| 373 | 364 |
| 374 static void GeneratePositiveLookup(MacroAssembler* masm, | 365 static void GeneratePositiveLookup(MacroAssembler* masm, |
| 375 Label* miss, | 366 Label* miss, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 390 NameDictionary::kCapacityIndex * kPointerSize; | 381 NameDictionary::kCapacityIndex * kPointerSize; |
| 391 | 382 |
| 392 static const int kElementsStartOffset = | 383 static const int kElementsStartOffset = |
| 393 NameDictionary::kHeaderSize + | 384 NameDictionary::kHeaderSize + |
| 394 NameDictionary::kElementsStartIndex * kPointerSize; | 385 NameDictionary::kElementsStartIndex * kPointerSize; |
| 395 | 386 |
| 396 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } | 387 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } |
| 397 | 388 |
| 398 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 389 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 399 | 390 |
| 400 DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); | 391 DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); |
| 401 }; | 392 }; |
| 402 | 393 |
| 403 | 394 |
| 404 } } // namespace v8::internal | 395 } } // namespace v8::internal |
| 405 | 396 |
| 406 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 397 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
| OLD | NEW |