| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 RecordWriteStub(uint32_t key, Isolate* isolate) | 95 RecordWriteStub(uint32_t key, Isolate* isolate) |
| 96 : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {} | 96 : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {} |
| 97 | 97 |
| 98 enum Mode { | 98 enum Mode { |
| 99 STORE_BUFFER_ONLY, | 99 STORE_BUFFER_ONLY, |
| 100 INCREMENTAL, | 100 INCREMENTAL, |
| 101 INCREMENTAL_COMPACTION | 101 INCREMENTAL_COMPACTION |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 bool SometimesSetsUpAFrame() OVERRIDE { return false; } | 104 bool SometimesSetsUpAFrame() override { return false; } |
| 105 | 105 |
| 106 static void PatchBranchIntoNop(MacroAssembler* masm, int pos) { | 106 static void PatchBranchIntoNop(MacroAssembler* masm, int pos) { |
| 107 const unsigned offset = masm->instr_at(pos) & kImm16Mask; | 107 const unsigned offset = masm->instr_at(pos) & kImm16Mask; |
| 108 masm->instr_at_put(pos, BNE | (zero_reg.code() << kRsShift) | | 108 masm->instr_at_put(pos, BNE | (zero_reg.code() << kRsShift) | |
| 109 (zero_reg.code() << kRtShift) | (offset & kImm16Mask)); | 109 (zero_reg.code() << kRtShift) | (offset & kImm16Mask)); |
| 110 DCHECK(Assembler::IsBne(masm->instr_at(pos))); | 110 DCHECK(Assembler::IsBne(masm->instr_at(pos))); |
| 111 } | 111 } |
| 112 | 112 |
| 113 static void PatchNopIntoBranch(MacroAssembler* masm, int pos) { | 113 static void PatchNopIntoBranch(MacroAssembler* masm, int pos) { |
| 114 const unsigned offset = masm->instr_at(pos) & kImm16Mask; | 114 const unsigned offset = masm->instr_at(pos) & kImm16Mask; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 Register scratch1_; | 221 Register scratch1_; |
| 222 | 222 |
| 223 friend class RecordWriteStub; | 223 friend class RecordWriteStub; |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 enum OnNoNeedToInformIncrementalMarker { | 226 enum OnNoNeedToInformIncrementalMarker { |
| 227 kReturnOnNoNeedToInformIncrementalMarker, | 227 kReturnOnNoNeedToInformIncrementalMarker, |
| 228 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker | 228 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker |
| 229 }; | 229 }; |
| 230 | 230 |
| 231 inline Major MajorKey() const FINAL { return RecordWrite; } | 231 inline Major MajorKey() const final { return RecordWrite; } |
| 232 | 232 |
| 233 void Generate(MacroAssembler* masm) OVERRIDE; | 233 void Generate(MacroAssembler* masm) override; |
| 234 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 234 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
| 235 void CheckNeedsToInformIncrementalMarker( | 235 void CheckNeedsToInformIncrementalMarker( |
| 236 MacroAssembler* masm, | 236 MacroAssembler* masm, |
| 237 OnNoNeedToInformIncrementalMarker on_no_need, | 237 OnNoNeedToInformIncrementalMarker on_no_need, |
| 238 Mode mode); | 238 Mode mode); |
| 239 void InformIncrementalMarker(MacroAssembler* masm); | 239 void InformIncrementalMarker(MacroAssembler* masm); |
| 240 | 240 |
| 241 void Activate(Code* code) OVERRIDE { | 241 void Activate(Code* code) override { |
| 242 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); | 242 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); |
| 243 } | 243 } |
| 244 | 244 |
| 245 Register object() const { | 245 Register object() const { |
| 246 return Register::from_code(ObjectBits::decode(minor_key_)); | 246 return Register::from_code(ObjectBits::decode(minor_key_)); |
| 247 } | 247 } |
| 248 | 248 |
| 249 Register value() const { | 249 Register value() const { |
| 250 return Register::from_code(ValueBits::decode(minor_key_)); | 250 return Register::from_code(ValueBits::decode(minor_key_)); |
| 251 } | 251 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 279 // in the presence of compacting GC (which can move code objects) we need to | 279 // in the presence of compacting GC (which can move code objects) we need to |
| 280 // keep the code which called into native pinned in the memory. Currently the | 280 // keep the code which called into native pinned in the memory. Currently the |
| 281 // simplest approach is to generate such stub early enough so it can never be | 281 // simplest approach is to generate such stub early enough so it can never be |
| 282 // moved by GC | 282 // moved by GC |
| 283 class DirectCEntryStub: public PlatformCodeStub { | 283 class DirectCEntryStub: public PlatformCodeStub { |
| 284 public: | 284 public: |
| 285 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 285 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
| 286 void GenerateCall(MacroAssembler* masm, Register target); | 286 void GenerateCall(MacroAssembler* masm, Register target); |
| 287 | 287 |
| 288 private: | 288 private: |
| 289 bool NeedsImmovableCode() OVERRIDE { return true; } | 289 bool NeedsImmovableCode() override { return true; } |
| 290 | 290 |
| 291 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 291 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 292 DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub); | 292 DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub); |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 | 295 |
| 296 class NameDictionaryLookupStub: public PlatformCodeStub { | 296 class NameDictionaryLookupStub: public PlatformCodeStub { |
| 297 public: | 297 public: |
| 298 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 298 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
| 299 | 299 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 311 Register scratch0); | 311 Register scratch0); |
| 312 | 312 |
| 313 static void GeneratePositiveLookup(MacroAssembler* masm, | 313 static void GeneratePositiveLookup(MacroAssembler* masm, |
| 314 Label* miss, | 314 Label* miss, |
| 315 Label* done, | 315 Label* done, |
| 316 Register elements, | 316 Register elements, |
| 317 Register name, | 317 Register name, |
| 318 Register r0, | 318 Register r0, |
| 319 Register r1); | 319 Register r1); |
| 320 | 320 |
| 321 bool SometimesSetsUpAFrame() OVERRIDE { return false; } | 321 bool SometimesSetsUpAFrame() override { return false; } |
| 322 | 322 |
| 323 private: | 323 private: |
| 324 static const int kInlinedProbes = 4; | 324 static const int kInlinedProbes = 4; |
| 325 static const int kTotalProbes = 20; | 325 static const int kTotalProbes = 20; |
| 326 | 326 |
| 327 static const int kCapacityOffset = | 327 static const int kCapacityOffset = |
| 328 NameDictionary::kHeaderSize + | 328 NameDictionary::kHeaderSize + |
| 329 NameDictionary::kCapacityIndex * kPointerSize; | 329 NameDictionary::kCapacityIndex * kPointerSize; |
| 330 | 330 |
| 331 static const int kElementsStartOffset = | 331 static const int kElementsStartOffset = |
| 332 NameDictionary::kHeaderSize + | 332 NameDictionary::kHeaderSize + |
| 333 NameDictionary::kElementsStartIndex * kPointerSize; | 333 NameDictionary::kElementsStartIndex * kPointerSize; |
| 334 | 334 |
| 335 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } | 335 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } |
| 336 | 336 |
| 337 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; | 337 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; |
| 338 | 338 |
| 339 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 339 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
| 340 DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); | 340 DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); |
| 341 }; | 341 }; |
| 342 | 342 |
| 343 | 343 |
| 344 } } // namespace v8::internal | 344 } } // namespace v8::internal |
| 345 | 345 |
| 346 #endif // V8_MIPS_CODE_STUBS_ARM_H_ | 346 #endif // V8_MIPS_CODE_STUBS_ARM_H_ |
| OLD | NEW |