| 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_IA32_CODE_STUBS_IA32_H_ | 5 #ifndef V8_IA32_CODE_STUBS_IA32_H_ |
| 6 #define V8_IA32_CODE_STUBS_IA32_H_ | 6 #define V8_IA32_CODE_STUBS_IA32_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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 static const int kTotalProbes = 20; | 105 static const int kTotalProbes = 20; |
| 108 | 106 |
| 109 static const int kCapacityOffset = | 107 static const int kCapacityOffset = |
| 110 NameDictionary::kHeaderSize + | 108 NameDictionary::kHeaderSize + |
| 111 NameDictionary::kCapacityIndex * kPointerSize; | 109 NameDictionary::kCapacityIndex * kPointerSize; |
| 112 | 110 |
| 113 static const int kElementsStartOffset = | 111 static const int kElementsStartOffset = |
| 114 NameDictionary::kHeaderSize + | 112 NameDictionary::kHeaderSize + |
| 115 NameDictionary::kElementsStartIndex * kPointerSize; | 113 NameDictionary::kElementsStartIndex * kPointerSize; |
| 116 | 114 |
| 117 virtual inline Major MajorKey() const FINAL OVERRIDE; | |
| 118 | |
| 119 Register dictionary() const { | 115 Register dictionary() const { |
| 120 return Register::from_code(DictionaryBits::decode(minor_key_)); | 116 return Register::from_code(DictionaryBits::decode(minor_key_)); |
| 121 } | 117 } |
| 122 | 118 |
| 123 Register result() const { | 119 Register result() const { |
| 124 return Register::from_code(ResultBits::decode(minor_key_)); | 120 return Register::from_code(ResultBits::decode(minor_key_)); |
| 125 } | 121 } |
| 126 | 122 |
| 127 Register index() const { | 123 Register index() const { |
| 128 return Register::from_code(IndexBits::decode(minor_key_)); | 124 return Register::from_code(IndexBits::decode(minor_key_)); |
| 129 } | 125 } |
| 130 | 126 |
| 131 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } | 127 LookupMode mode() const { return LookupModeBits::decode(minor_key_); } |
| 132 | 128 |
| 133 class DictionaryBits: public BitField<int, 0, 3> {}; | 129 class DictionaryBits: public BitField<int, 0, 3> {}; |
| 134 class ResultBits: public BitField<int, 3, 3> {}; | 130 class ResultBits: public BitField<int, 3, 3> {}; |
| 135 class IndexBits: public BitField<int, 6, 3> {}; | 131 class IndexBits: public BitField<int, 6, 3> {}; |
| 136 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; | 132 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; |
| 137 | 133 |
| 138 DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub); | 134 DEFINE_CODE_STUB(NameDictionaryLookup, PlatformCodeStub); |
| 139 }; | 135 }; |
| 140 | 136 |
| 141 | 137 |
| 142 class RecordWriteStub: public PlatformCodeStub { | 138 class RecordWriteStub: public PlatformCodeStub { |
| 143 public: | 139 public: |
| 144 RecordWriteStub(Isolate* isolate, | 140 RecordWriteStub(Isolate* isolate, |
| 145 Register object, | 141 Register object, |
| 146 Register value, | 142 Register value, |
| 147 Register address, | 143 Register address, |
| 148 RememberedSetAction remembered_set_action, | 144 RememberedSetAction remembered_set_action, |
| 149 SaveFPRegsMode fp_mode) | 145 SaveFPRegsMode fp_mode) |
| 150 : PlatformCodeStub(isolate), | 146 : PlatformCodeStub(isolate), |
| 151 regs_(object, // An input reg. | 147 regs_(object, // An input reg. |
| 152 address, // An input reg. | 148 address, // An input reg. |
| 153 value) { // One scratch reg. | 149 value) { // One scratch reg. |
| 154 minor_key_ = ObjectBits::encode(object.code()) | | 150 minor_key_ = ObjectBits::encode(object.code()) | |
| 155 ValueBits::encode(value.code()) | | 151 ValueBits::encode(value.code()) | |
| 156 AddressBits::encode(address.code()) | | 152 AddressBits::encode(address.code()) | |
| 157 RememberedSetActionBits::encode(remembered_set_action) | | 153 RememberedSetActionBits::encode(remembered_set_action) | |
| 158 SaveFPRegsModeBits::encode(fp_mode); | 154 SaveFPRegsModeBits::encode(fp_mode); |
| 159 } | 155 } |
| 160 | 156 |
| 157 RecordWriteStub(uint32_t key, Isolate* isolate) |
| 158 : PlatformCodeStub(key, isolate), regs_(object(), address(), value()) {} |
| 159 |
| 161 enum Mode { | 160 enum Mode { |
| 162 STORE_BUFFER_ONLY, | 161 STORE_BUFFER_ONLY, |
| 163 INCREMENTAL, | 162 INCREMENTAL, |
| 164 INCREMENTAL_COMPACTION | 163 INCREMENTAL_COMPACTION |
| 165 }; | 164 }; |
| 166 | 165 |
| 167 virtual bool SometimesSetsUpAFrame() { return false; } | 166 virtual bool SometimesSetsUpAFrame() { return false; } |
| 168 | 167 |
| 169 static const byte kTwoByteNopInstruction = 0x3c; // Cmpb al, #imm8. | 168 static const byte kTwoByteNopInstruction = 0x3c; // Cmpb al, #imm8. |
| 170 static const byte kTwoByteJumpInstruction = 0xeb; // Jmp #imm8. | 169 static const byte kTwoByteJumpInstruction = 0xeb; // Jmp #imm8. |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 return no_reg; | 351 return no_reg; |
| 353 } | 352 } |
| 354 friend class RecordWriteStub; | 353 friend class RecordWriteStub; |
| 355 }; | 354 }; |
| 356 | 355 |
| 357 enum OnNoNeedToInformIncrementalMarker { | 356 enum OnNoNeedToInformIncrementalMarker { |
| 358 kReturnOnNoNeedToInformIncrementalMarker, | 357 kReturnOnNoNeedToInformIncrementalMarker, |
| 359 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker | 358 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker |
| 360 }; | 359 }; |
| 361 | 360 |
| 362 virtual inline Major MajorKey() const FINAL OVERRIDE; | 361 virtual inline Major MajorKey() const FINAL OVERRIDE { return RecordWrite; } |
| 363 | 362 |
| 364 void Generate(MacroAssembler* masm); | 363 void Generate(MacroAssembler* masm); |
| 365 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 364 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
| 366 void CheckNeedsToInformIncrementalMarker( | 365 void CheckNeedsToInformIncrementalMarker( |
| 367 MacroAssembler* masm, | 366 MacroAssembler* masm, |
| 368 OnNoNeedToInformIncrementalMarker on_no_need, | 367 OnNoNeedToInformIncrementalMarker on_no_need, |
| 369 Mode mode); | 368 Mode mode); |
| 370 void InformIncrementalMarker(MacroAssembler* masm); | 369 void InformIncrementalMarker(MacroAssembler* masm); |
| 371 | 370 |
| 372 void Activate(Code* code) { | 371 void Activate(Code* code) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 401 | 400 |
| 402 RegisterAllocation regs_; | 401 RegisterAllocation regs_; |
| 403 | 402 |
| 404 DISALLOW_COPY_AND_ASSIGN(RecordWriteStub); | 403 DISALLOW_COPY_AND_ASSIGN(RecordWriteStub); |
| 405 }; | 404 }; |
| 406 | 405 |
| 407 | 406 |
| 408 } } // namespace v8::internal | 407 } } // namespace v8::internal |
| 409 | 408 |
| 410 #endif // V8_IA32_CODE_STUBS_IA32_H_ | 409 #endif // V8_IA32_CODE_STUBS_IA32_H_ |
| OLD | NEW |