OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC_CODE_STUBS_PPC_H_ | 5 #ifndef V8_PPC_CODE_STUBS_PPC_H_ |
6 #define V8_PPC_CODE_STUBS_PPC_H_ | 6 #define V8_PPC_CODE_STUBS_PPC_H_ |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 | 10 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 AddressBits::encode(address.code()) | | 87 AddressBits::encode(address.code()) | |
88 RememberedSetActionBits::encode(remembered_set_action) | | 88 RememberedSetActionBits::encode(remembered_set_action) | |
89 SaveFPRegsModeBits::encode(fp_mode); | 89 SaveFPRegsModeBits::encode(fp_mode); |
90 } | 90 } |
91 | 91 |
92 RecordWriteStub(uint32_t key, Isolate* isolate) | 92 RecordWriteStub(uint32_t key, Isolate* isolate) |
93 : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {} | 93 : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {} |
94 | 94 |
95 enum Mode { STORE_BUFFER_ONLY, INCREMENTAL, INCREMENTAL_COMPACTION }; | 95 enum Mode { STORE_BUFFER_ONLY, INCREMENTAL, INCREMENTAL_COMPACTION }; |
96 | 96 |
97 virtual bool SometimesSetsUpAFrame() { return false; } | 97 bool SometimesSetsUpAFrame() OVERRIDE { return false; } |
98 | 98 |
99 static void PatchBranchIntoNop(MacroAssembler* masm, int pos) { | 99 static void PatchBranchIntoNop(MacroAssembler* masm, int pos) { |
100 // Consider adding DCHECK here to catch bad patching | 100 // Consider adding DCHECK here to catch bad patching |
101 masm->instr_at_put(pos, (masm->instr_at(pos) & ~kBOfieldMask) | BT); | 101 masm->instr_at_put(pos, (masm->instr_at(pos) & ~kBOfieldMask) | BT); |
102 } | 102 } |
103 | 103 |
104 static void PatchNopIntoBranch(MacroAssembler* masm, int pos) { | 104 static void PatchNopIntoBranch(MacroAssembler* masm, int pos) { |
105 // Consider adding DCHECK here to catch bad patching | 105 // Consider adding DCHECK here to catch bad patching |
106 masm->instr_at_put(pos, (masm->instr_at(pos) & ~kBOfieldMask) | BF); | 106 masm->instr_at_put(pos, (masm->instr_at(pos) & ~kBOfieldMask) | BF); |
107 } | 107 } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 | 217 |
218 inline Major MajorKey() const FINAL { return RecordWrite; } | 218 inline Major MajorKey() const FINAL { return RecordWrite; } |
219 | 219 |
220 void Generate(MacroAssembler* masm) OVERRIDE; | 220 void Generate(MacroAssembler* masm) OVERRIDE; |
221 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 221 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
222 void CheckNeedsToInformIncrementalMarker( | 222 void CheckNeedsToInformIncrementalMarker( |
223 MacroAssembler* masm, OnNoNeedToInformIncrementalMarker on_no_need, | 223 MacroAssembler* masm, OnNoNeedToInformIncrementalMarker on_no_need, |
224 Mode mode); | 224 Mode mode); |
225 void InformIncrementalMarker(MacroAssembler* masm); | 225 void InformIncrementalMarker(MacroAssembler* masm); |
226 | 226 |
227 void Activate(Code* code) { | 227 void Activate(Code* code) OVERRIDE { |
228 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); | 228 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); |
229 } | 229 } |
230 | 230 |
231 Register object() const { | 231 Register object() const { |
232 return Register::from_code(ObjectBits::decode(minor_key_)); | 232 return Register::from_code(ObjectBits::decode(minor_key_)); |
233 } | 233 } |
234 | 234 |
235 Register value() const { | 235 Register value() const { |
236 return Register::from_code(ValueBits::decode(minor_key_)); | 236 return Register::from_code(ValueBits::decode(minor_key_)); |
237 } | 237 } |
(...skipping 28 matching lines...) Expand all Loading... |
266 // in the presence of compacting GC (which can move code objects) we need to | 266 // in the presence of compacting GC (which can move code objects) we need to |
267 // keep the code which called into native pinned in the memory. Currently the | 267 // keep the code which called into native pinned in the memory. Currently the |
268 // simplest approach is to generate such stub early enough so it can never be | 268 // simplest approach is to generate such stub early enough so it can never be |
269 // moved by GC | 269 // moved by GC |
270 class DirectCEntryStub : public PlatformCodeStub { | 270 class DirectCEntryStub : public PlatformCodeStub { |
271 public: | 271 public: |
272 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 272 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
273 void GenerateCall(MacroAssembler* masm, Register target); | 273 void GenerateCall(MacroAssembler* masm, Register target); |
274 | 274 |
275 private: | 275 private: |
276 bool NeedsImmovableCode() { return true; } | 276 bool NeedsImmovableCode() OVERRIDE { return true; } |
277 | 277 |
278 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 278 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
279 DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub); | 279 DEFINE_PLATFORM_CODE_STUB(DirectCEntry, PlatformCodeStub); |
280 }; | 280 }; |
281 | 281 |
282 | 282 |
283 class NameDictionaryLookupStub : public PlatformCodeStub { | 283 class NameDictionaryLookupStub : public PlatformCodeStub { |
284 public: | 284 public: |
285 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; | 285 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; |
286 | 286 |
287 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) | 287 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) |
288 : PlatformCodeStub(isolate) { | 288 : PlatformCodeStub(isolate) { |
289 minor_key_ = LookupModeBits::encode(mode); | 289 minor_key_ = LookupModeBits::encode(mode); |
290 } | 290 } |
291 | 291 |
292 static void GenerateNegativeLookup(MacroAssembler* masm, Label* miss, | 292 static void GenerateNegativeLookup(MacroAssembler* masm, Label* miss, |
293 Label* done, Register receiver, | 293 Label* done, Register receiver, |
294 Register properties, Handle<Name> name, | 294 Register properties, Handle<Name> name, |
295 Register scratch0); | 295 Register scratch0); |
296 | 296 |
297 static void GeneratePositiveLookup(MacroAssembler* masm, Label* miss, | 297 static void GeneratePositiveLookup(MacroAssembler* masm, Label* miss, |
298 Label* done, Register elements, | 298 Label* done, Register elements, |
299 Register name, Register r0, Register r1); | 299 Register name, Register r0, Register r1); |
300 | 300 |
301 virtual bool SometimesSetsUpAFrame() { return false; } | 301 bool SometimesSetsUpAFrame() OVERRIDE { return false; } |
302 | 302 |
303 private: | 303 private: |
304 static const int kInlinedProbes = 4; | 304 static const int kInlinedProbes = 4; |
305 static const int kTotalProbes = 20; | 305 static const int kTotalProbes = 20; |
306 | 306 |
307 static const int kCapacityOffset = | 307 static const int kCapacityOffset = |
308 NameDictionary::kHeaderSize + | 308 NameDictionary::kHeaderSize + |
309 NameDictionary::kCapacityIndex * kPointerSize; | 309 NameDictionary::kCapacityIndex * kPointerSize; |
310 | 310 |
311 static const int kElementsStartOffset = | 311 static const int kElementsStartOffset = |
312 NameDictionary::kHeaderSize + | 312 NameDictionary::kHeaderSize + |
313 NameDictionary::kElementsStartIndex * kPointerSize; | 313 NameDictionary::kElementsStartIndex * kPointerSize; |
314 | 314 |
315 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } | 315 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } |
316 | 316 |
317 class LookupModeBits : public BitField<LookupMode, 0, 1> {}; | 317 class LookupModeBits : public BitField<LookupMode, 0, 1> {}; |
318 | 318 |
319 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); | 319 DEFINE_NULL_CALL_INTERFACE_DESCRIPTOR(); |
320 DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); | 320 DEFINE_PLATFORM_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); |
321 }; | 321 }; |
322 } | 322 } |
323 } // namespace v8::internal | 323 } // namespace v8::internal |
324 | 324 |
325 #endif // V8_PPC_CODE_STUBS_PPC_H_ | 325 #endif // V8_PPC_CODE_STUBS_PPC_H_ |
OLD | NEW |