| 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_X87_CODE_STUBS_X87_H_ | 5 #ifndef V8_X87_CODE_STUBS_X87_H_ |
| 6 #define V8_X87_CODE_STUBS_X87_H_ | 6 #define V8_X87_CODE_STUBS_X87_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, | 12 void ArrayNativeCode(MacroAssembler* masm, |
| 15 bool construct_call, | 13 bool construct_call, |
| 16 Label* call_generic_code); | 14 Label* call_generic_code); |
| 17 | 15 |
| 18 | 16 |
| 19 class StringHelper : public AllStatic { | 17 class StringHelper : public AllStatic { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 static const int kTotalProbes = 20; | 90 static const int kTotalProbes = 20; |
| 93 | 91 |
| 94 static const int kCapacityOffset = | 92 static const int kCapacityOffset = |
| 95 NameDictionary::kHeaderSize + | 93 NameDictionary::kHeaderSize + |
| 96 NameDictionary::kCapacityIndex * kPointerSize; | 94 NameDictionary::kCapacityIndex * kPointerSize; |
| 97 | 95 |
| 98 static const int kElementsStartOffset = | 96 static const int kElementsStartOffset = |
| 99 NameDictionary::kHeaderSize + | 97 NameDictionary::kHeaderSize + |
| 100 NameDictionary::kElementsStartIndex * kPointerSize; | 98 NameDictionary::kElementsStartIndex * kPointerSize; |
| 101 | 99 |
| 102 virtual inline Major MajorKey() const FINAL OVERRIDE; | |
| 103 | |
| 104 Register dictionary() const { | 100 Register dictionary() const { |
| 105 return Register::from_code(DictionaryBits::decode(minor_key_)); | 101 return Register::from_code(DictionaryBits::decode(minor_key_)); |
| 106 } | 102 } |
| 107 | 103 |
| 108 Register result() const { | 104 Register result() const { |
| 109 return Register::from_code(ResultBits::decode(minor_key_)); | 105 return Register::from_code(ResultBits::decode(minor_key_)); |
| 110 } | 106 } |
| 111 | 107 |
| 112 Register index() const { | 108 Register index() const { |
| 113 return Register::from_code(IndexBits::decode(minor_key_)); | 109 return Register::from_code(IndexBits::decode(minor_key_)); |
| 114 } | 110 } |
| 115 | 111 |
| 116 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } | 112 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } |
| 117 | 113 |
| 118 class DictionaryBits: public BitField<int, 0, 3> {}; | 114 class DictionaryBits: public BitField<int, 0, 3> {}; |
| 119 class ResultBits: public BitField<int, 3, 3> {}; | 115 class ResultBits: public BitField<int, 3, 3> {}; |
| 120 class IndexBits: public BitField<int, 6, 3> {}; | 116 class IndexBits: public BitField<int, 6, 3> {}; |
| 121 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; | 117 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; |
| 122 | 118 |
| 123 DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub); | 119 DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); |
| 124 }; | 120 }; |
| 125 | 121 |
| 126 | 122 |
| 127 class RecordWriteStub: public PlatformCodeStub { | 123 class RecordWriteStub: public PlatformCodeStub { |
| 128 public: | 124 public: |
| 129 RecordWriteStub(Isolate* isolate, | 125 RecordWriteStub(Isolate* isolate, |
| 130 Register object, | 126 Register object, |
| 131 Register value, | 127 Register value, |
| 132 Register address, | 128 Register address, |
| 133 RememberedSetAction remembered_set_action) | 129 RememberedSetAction remembered_set_action) |
| 134 : PlatformCodeStub(isolate), | 130 : PlatformCodeStub(isolate), |
| 135 regs_(object, // An input reg. | 131 regs_(object, // An input reg. |
| 136 address, // An input reg. | 132 address, // An input reg. |
| 137 value) { // One scratch reg. | 133 value) { // One scratch reg. |
| 138 minor_key_ = ObjectBits::encode(object.code()) | | 134 minor_key_ = ObjectBits::encode(object.code()) | |
| 139 ValueBits::encode(value.code()) | | 135 ValueBits::encode(value.code()) | |
| 140 AddressBits::encode(address.code()) | | 136 AddressBits::encode(address.code()) | |
| 141 RememberedSetActionBits::encode(remembered_set_action); | 137 RememberedSetActionBits::encode(remembered_set_action); |
| 142 } | 138 } |
| 143 | 139 |
| 140 RecordWriteStub(uint32_t key, Isolate* isolate) |
| 141 : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {} |
| 142 |
| 144 enum Mode { | 143 enum Mode { |
| 145 STORE_BUFFER_ONLY, | 144 STORE_BUFFER_ONLY, |
| 146 INCREMENTAL, | 145 INCREMENTAL, |
| 147 INCREMENTAL_COMPACTION | 146 INCREMENTAL_COMPACTION |
| 148 }; | 147 }; |
| 149 | 148 |
| 150 virtual bool SometimesSetsUpAFrame() { return false; } | 149 virtual bool SometimesSetsUpAFrame() { return false; } |
| 151 | 150 |
| 152 static const byte kTwoByteNopInstruction = 0x3c; // Cmpb al, #imm8. | 151 static const byte kTwoByteNopInstruction = 0x3c; // Cmpb al, #imm8. |
| 153 static const byte kTwoByteJumpInstruction = 0xeb; // Jmp #imm8. | 152 static const byte kTwoByteJumpInstruction = 0xeb; // Jmp #imm8. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 return no_reg; | 315 return no_reg; |
| 317 } | 316 } |
| 318 friend class RecordWriteStub; | 317 friend class RecordWriteStub; |
| 319 }; | 318 }; |
| 320 | 319 |
| 321 enum OnNoNeedToInformIncrementalMarker { | 320 enum OnNoNeedToInformIncrementalMarker { |
| 322 kReturnOnNoNeedToInformIncrementalMarker, | 321 kReturnOnNoNeedToInformIncrementalMarker, |
| 323 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker | 322 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker |
| 324 }; | 323 }; |
| 325 | 324 |
| 326 virtual inline Major MajorKey() const FINAL OVERRIDE; | 325 virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; } |
| 327 | 326 |
| 328 void Generate(MacroAssembler* masm); | 327 void Generate(MacroAssembler* masm); |
| 329 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 328 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
| 330 void CheckNeedsToInformIncrementalMarker( | 329 void CheckNeedsToInformIncrementalMarker( |
| 331 MacroAssembler* masm, | 330 MacroAssembler* masm, |
| 332 OnNoNeedToInformIncrementalMarker on_no_need, | 331 OnNoNeedToInformIncrementalMarker on_no_need, |
| 333 Mode mode); | 332 Mode mode); |
| 334 void InformIncrementalMarker(MacroAssembler* masm); | 333 void InformIncrementalMarker(MacroAssembler* masm); |
| 335 | 334 |
| 336 void Activate(Code* code) { | 335 void Activate(Code* code) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 360 | 359 |
| 361 RegisterAllocation regs_; | 360 RegisterAllocation regs_; |
| 362 | 361 |
| 363 DISALLOW_COPY_AND_ASSIGN(RecordWriteStub); | 362 DISALLOW_COPY_AND_ASSIGN(RecordWriteStub); |
| 364 }; | 363 }; |
| 365 | 364 |
| 366 | 365 |
| 367 } } // namespace v8::internal | 366 } } // namespace v8::internal |
| 368 | 367 |
| 369 #endif // V8_X87_CODE_STUBS_X87_H_ | 368 #endif // V8_X87_CODE_STUBS_X87_H_ |
| OLD | NEW |