| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 | 50 |
| 51 class StoreRegistersStateStub: public PlatformCodeStub { | 51 class StoreRegistersStateStub: public PlatformCodeStub { |
| 52 public: | 52 public: |
| 53 explicit StoreRegistersStateStub(Isolate* isolate) | 53 explicit StoreRegistersStateStub(Isolate* isolate) |
| 54 : PlatformCodeStub(isolate) {} | 54 : PlatformCodeStub(isolate) {} |
| 55 | 55 |
| 56 static void GenerateAheadOfTime(Isolate* isolate); | 56 static void GenerateAheadOfTime(Isolate* isolate); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 59 DEFINE_PLATFORM_CODE_STUB(StoreRegistersState, PlatformCodeStub); | 60 DEFINE_PLATFORM_CODE_STUB(StoreRegistersState, PlatformCodeStub); |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 | 63 |
| 63 class RestoreRegistersStateStub: public PlatformCodeStub { | 64 class RestoreRegistersStateStub: public PlatformCodeStub { |
| 64 public: | 65 public: |
| 65 explicit RestoreRegistersStateStub(Isolate* isolate) | 66 explicit RestoreRegistersStateStub(Isolate* isolate) |
| 66 : PlatformCodeStub(isolate) {} | 67 : PlatformCodeStub(isolate) {} |
| 67 | 68 |
| 68 static void GenerateAheadOfTime(Isolate* isolate); | 69 static void GenerateAheadOfTime(Isolate* isolate); |
| 69 | 70 |
| 70 private: | 71 private: |
| 72 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 71 DEFINE_PLATFORM_CODE_STUB(RestoreRegistersState, PlatformCodeStub); | 73 DEFINE_PLATFORM_CODE_STUB(RestoreRegistersState, PlatformCodeStub); |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 // This stub can convert a signed int32 to a heap number (double). It does | 76 // This stub can convert a signed int32 to a heap number (double). It does |
| 75 // not work for int32s that are in Smi range! No GC occurs during this stub | 77 // not work for int32s that are in Smi range! No GC occurs during this stub |
| 76 // so you don't have to set up the frame. | 78 // so you don't have to set up the frame. |
| 77 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { | 79 class WriteInt32ToHeapNumberStub : public PlatformCodeStub { |
| 78 public: | 80 public: |
| 79 WriteInt32ToHeapNumberStub(Isolate* isolate, Register the_int, | 81 WriteInt32ToHeapNumberStub(Isolate* isolate, Register the_int, |
| 80 Register the_heap_number, Register scratch, | 82 Register the_heap_number, Register scratch, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 110 Register sign() const { | 112 Register sign() const { |
| 111 return Register::from_code(SignRegisterBits::decode(minor_key_)); | 113 return Register::from_code(SignRegisterBits::decode(minor_key_)); |
| 112 } | 114 } |
| 113 | 115 |
| 114 // Minor key encoding in 16 bits. | 116 // Minor key encoding in 16 bits. |
| 115 class IntRegisterBits: public BitField<int, 0, 4> {}; | 117 class IntRegisterBits: public BitField<int, 0, 4> {}; |
| 116 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; | 118 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; |
| 117 class ScratchRegisterBits: public BitField<int, 8, 4> {}; | 119 class ScratchRegisterBits: public BitField<int, 8, 4> {}; |
| 118 class SignRegisterBits: public BitField<int, 12, 4> {}; | 120 class SignRegisterBits: public BitField<int, 12, 4> {}; |
| 119 | 121 |
| 122 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 120 DEFINE_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub); | 123 DEFINE_CODE_STUB(WriteInt32ToHeapNumber, PlatformCodeStub); |
| 121 }; | 124 }; |
| 122 | 125 |
| 123 | 126 |
| 124 class RecordWriteStub: public PlatformCodeStub { | 127 class RecordWriteStub: public PlatformCodeStub { |
| 125 public: | 128 public: |
| 126 RecordWriteStub(Isolate* isolate, | 129 RecordWriteStub(Isolate* isolate, |
| 127 Register object, | 130 Register object, |
| 128 Register value, | 131 Register value, |
| 129 Register address, | 132 Register address, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 case INCREMENTAL_COMPACTION: | 206 case INCREMENTAL_COMPACTION: |
| 204 DCHECK(GetMode(stub) == STORE_BUFFER_ONLY); | 207 DCHECK(GetMode(stub) == STORE_BUFFER_ONLY); |
| 205 PatchNopIntoBranch(&masm, 2 * Assembler::kInstrSize); | 208 PatchNopIntoBranch(&masm, 2 * Assembler::kInstrSize); |
| 206 break; | 209 break; |
| 207 } | 210 } |
| 208 DCHECK(GetMode(stub) == mode); | 211 DCHECK(GetMode(stub) == mode); |
| 209 CpuFeatures::FlushICache(stub->instruction_start(), | 212 CpuFeatures::FlushICache(stub->instruction_start(), |
| 210 4 * Assembler::kInstrSize); | 213 4 * Assembler::kInstrSize); |
| 211 } | 214 } |
| 212 | 215 |
| 216 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 217 |
| 213 private: | 218 private: |
| 214 // This is a helper class for freeing up 3 scratch registers. The input is | 219 // This is a helper class for freeing up 3 scratch registers. The input is |
| 215 // two registers that must be preserved and one scratch register provided by | 220 // two registers that must be preserved and one scratch register provided by |
| 216 // the caller. | 221 // the caller. |
| 217 class RegisterAllocation { | 222 class RegisterAllocation { |
| 218 public: | 223 public: |
| 219 RegisterAllocation(Register object, | 224 RegisterAllocation(Register object, |
| 220 Register address, | 225 Register address, |
| 221 Register scratch0) | 226 Register scratch0) |
| 222 : object_(object), | 227 : object_(object), |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // simplest approach is to generate such stub early enough so it can never be | 332 // simplest approach is to generate such stub early enough so it can never be |
| 328 // moved by GC | 333 // moved by GC |
| 329 class DirectCEntryStub: public PlatformCodeStub { | 334 class DirectCEntryStub: public PlatformCodeStub { |
| 330 public: | 335 public: |
| 331 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 336 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 332 void GenerateCall(MacroAssembler* masm, Register target); | 337 void GenerateCall(MacroAssembler* masm, Register target); |
| 333 | 338 |
| 334 private: | 339 private: |
| 335 bool NeedsImmovableCode() { return true; } | 340 bool NeedsImmovableCode() { return true; } |
| 336 | 341 |
| 342 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 337 DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub); | 343 DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub); |
| 338 }; | 344 }; |
| 339 | 345 |
| 340 | 346 |
| 341 class NameDictionaryLookupStub: public PlatformCodeStub { | 347 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 342 public: | 348 public: |
| 343 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 349 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 344 | 350 |
| 345 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 351 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
| 346 : PlatformCodeStub(isolate) { | 352 : PlatformCodeStub(isolate) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 374 NameDictionary::kCapacityIndex * kPointerSize; | 380 NameDictionary::kCapacityIndex * kPointerSize; |
| 375 | 381 |
| 376 static const int kElementsStartOffset = | 382 static const int kElementsStartOffset = |
| 377 NameDictionary::kHeaderSize + | 383 NameDictionary::kHeaderSize + |
| 378 NameDictionary::kElementsStartIndex * kPointerSize; | 384 NameDictionary::kElementsStartIndex * kPointerSize; |
| 379 | 385 |
| 380 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } | 386 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } |
| 381 | 387 |
| 382 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 388 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 383 | 389 |
| 390 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 384 DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); | 391 DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); |
| 385 }; | 392 }; |
| 386 | 393 |
| 387 | 394 |
| 388 } } // namespace v8::internal | 395 } } // namespace v8::internal |
| 389 | 396 |
| 390 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 397 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
| OLD | NEW |