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/ic-inl.h" | 8 #include "src/ic-inl.h" |
9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 public: | 21 public: |
22 explicit StoreBufferOverflowStub(Isolate* isolate) | 22 explicit StoreBufferOverflowStub(Isolate* isolate) |
23 : PlatformCodeStub(isolate) { } | 23 : PlatformCodeStub(isolate) { } |
24 | 24 |
25 void Generate(MacroAssembler* masm); | 25 void Generate(MacroAssembler* masm); |
26 | 26 |
27 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); | 27 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); |
28 virtual bool SometimesSetsUpAFrame() { return false; } | 28 virtual bool SometimesSetsUpAFrame() { return false; } |
29 | 29 |
30 private: | 30 private: |
31 Major MajorKey() { return StoreBufferOverflow; } | 31 Major MajorKey() const { return StoreBufferOverflow; } |
32 int MinorKey() { return 0; } | 32 int MinorKey() const { return 0; } |
33 }; | 33 }; |
34 | 34 |
35 | 35 |
36 class StringHelper : public AllStatic { | 36 class StringHelper : public AllStatic { |
37 public: | 37 public: |
38 // Generate code for copying characters using the rep movs instruction. | 38 // Generate code for copying characters using the rep movs instruction. |
39 // Copies ecx characters from esi to edi. Copying of overlapping regions is | 39 // Copies ecx characters from esi to edi. Copying of overlapping regions is |
40 // not supported. | 40 // not supported. |
41 static void GenerateCopyCharacters(MacroAssembler* masm, | 41 static void GenerateCopyCharacters(MacroAssembler* masm, |
42 Register dest, | 42 Register dest, |
(...skipping 18 matching lines...) Expand all Loading... |
61 private: | 61 private: |
62 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | 62 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
63 }; | 63 }; |
64 | 64 |
65 | 65 |
66 class SubStringStub: public PlatformCodeStub { | 66 class SubStringStub: public PlatformCodeStub { |
67 public: | 67 public: |
68 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} | 68 explicit SubStringStub(Isolate* isolate) : PlatformCodeStub(isolate) {} |
69 | 69 |
70 private: | 70 private: |
71 Major MajorKey() { return SubString; } | 71 Major MajorKey() const { return SubString; } |
72 int MinorKey() { return 0; } | 72 int MinorKey() const { return 0; } |
73 | 73 |
74 void Generate(MacroAssembler* masm); | 74 void Generate(MacroAssembler* masm); |
75 }; | 75 }; |
76 | 76 |
77 | 77 |
78 class StringCompareStub: public PlatformCodeStub { | 78 class StringCompareStub: public PlatformCodeStub { |
79 public: | 79 public: |
80 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } | 80 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } |
81 | 81 |
82 // Compares two flat ASCII strings and returns result in eax. | 82 // Compares two flat ASCII strings and returns result in eax. |
83 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, | 83 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, |
84 Register left, | 84 Register left, |
85 Register right, | 85 Register right, |
86 Register scratch1, | 86 Register scratch1, |
87 Register scratch2, | 87 Register scratch2, |
88 Register scratch3); | 88 Register scratch3); |
89 | 89 |
90 // Compares two flat ASCII strings for equality and returns result | 90 // Compares two flat ASCII strings for equality and returns result |
91 // in eax. | 91 // in eax. |
92 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, | 92 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, |
93 Register left, | 93 Register left, |
94 Register right, | 94 Register right, |
95 Register scratch1, | 95 Register scratch1, |
96 Register scratch2); | 96 Register scratch2); |
97 | 97 |
98 private: | 98 private: |
99 virtual Major MajorKey() { return StringCompare; } | 99 virtual Major MajorKey() const { return StringCompare; } |
100 virtual int MinorKey() { return 0; } | 100 virtual int MinorKey() const { return 0; } |
101 virtual void Generate(MacroAssembler* masm); | 101 virtual void Generate(MacroAssembler* masm); |
102 | 102 |
103 static void GenerateAsciiCharsCompareLoop( | 103 static void GenerateAsciiCharsCompareLoop( |
104 MacroAssembler* masm, | 104 MacroAssembler* masm, |
105 Register left, | 105 Register left, |
106 Register right, | 106 Register right, |
107 Register length, | 107 Register length, |
108 Register scratch, | 108 Register scratch, |
109 Label* chars_not_equal, | 109 Label* chars_not_equal, |
110 Label::Distance chars_not_equal_near = Label::kFar); | 110 Label::Distance chars_not_equal_near = Label::kFar); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 static const int kTotalProbes = 20; | 147 static const int kTotalProbes = 20; |
148 | 148 |
149 static const int kCapacityOffset = | 149 static const int kCapacityOffset = |
150 NameDictionary::kHeaderSize + | 150 NameDictionary::kHeaderSize + |
151 NameDictionary::kCapacityIndex * kPointerSize; | 151 NameDictionary::kCapacityIndex * kPointerSize; |
152 | 152 |
153 static const int kElementsStartOffset = | 153 static const int kElementsStartOffset = |
154 NameDictionary::kHeaderSize + | 154 NameDictionary::kHeaderSize + |
155 NameDictionary::kElementsStartIndex * kPointerSize; | 155 NameDictionary::kElementsStartIndex * kPointerSize; |
156 | 156 |
157 Major MajorKey() { return NameDictionaryLookup; } | 157 Major MajorKey() const { return NameDictionaryLookup; } |
158 | 158 |
159 int MinorKey() { | 159 int MinorKey() const { |
160 return DictionaryBits::encode(dictionary_.code()) | | 160 return DictionaryBits::encode(dictionary_.code()) | |
161 ResultBits::encode(result_.code()) | | 161 ResultBits::encode(result_.code()) | |
162 IndexBits::encode(index_.code()) | | 162 IndexBits::encode(index_.code()) | |
163 LookupModeBits::encode(mode_); | 163 LookupModeBits::encode(mode_); |
164 } | 164 } |
165 | 165 |
166 class DictionaryBits: public BitField<int, 0, 3> {}; | 166 class DictionaryBits: public BitField<int, 0, 3> {}; |
167 class ResultBits: public BitField<int, 3, 3> {}; | 167 class ResultBits: public BitField<int, 3, 3> {}; |
168 class IndexBits: public BitField<int, 6, 3> {}; | 168 class IndexBits: public BitField<int, 6, 3> {}; |
169 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; | 169 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 } | 375 } |
376 ; | 376 ; |
377 void Generate(MacroAssembler* masm); | 377 void Generate(MacroAssembler* masm); |
378 void GenerateIncremental(MacroAssembler* masm, Mode mode); | 378 void GenerateIncremental(MacroAssembler* masm, Mode mode); |
379 void CheckNeedsToInformIncrementalMarker( | 379 void CheckNeedsToInformIncrementalMarker( |
380 MacroAssembler* masm, | 380 MacroAssembler* masm, |
381 OnNoNeedToInformIncrementalMarker on_no_need, | 381 OnNoNeedToInformIncrementalMarker on_no_need, |
382 Mode mode); | 382 Mode mode); |
383 void InformIncrementalMarker(MacroAssembler* masm); | 383 void InformIncrementalMarker(MacroAssembler* masm); |
384 | 384 |
385 Major MajorKey() { return RecordWrite; } | 385 Major MajorKey() const { return RecordWrite; } |
386 | 386 |
387 int MinorKey() { | 387 int MinorKey() const { |
388 return ObjectBits::encode(object_.code()) | | 388 return ObjectBits::encode(object_.code()) | |
389 ValueBits::encode(value_.code()) | | 389 ValueBits::encode(value_.code()) | |
390 AddressBits::encode(address_.code()) | | 390 AddressBits::encode(address_.code()) | |
391 RememberedSetActionBits::encode(remembered_set_action_); | 391 RememberedSetActionBits::encode(remembered_set_action_); |
392 } | 392 } |
393 | 393 |
394 void Activate(Code* code) { | 394 void Activate(Code* code) { |
395 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); | 395 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); |
396 } | 396 } |
397 | 397 |
398 class ObjectBits: public BitField<int, 0, 3> {}; | 398 class ObjectBits: public BitField<int, 0, 3> {}; |
399 class ValueBits: public BitField<int, 3, 3> {}; | 399 class ValueBits: public BitField<int, 3, 3> {}; |
400 class AddressBits: public BitField<int, 6, 3> {}; | 400 class AddressBits: public BitField<int, 6, 3> {}; |
401 class RememberedSetActionBits: public BitField<RememberedSetAction, 9, 1> {}; | 401 class RememberedSetActionBits: public BitField<RememberedSetAction, 9, 1> {}; |
402 | 402 |
403 Register object_; | 403 Register object_; |
404 Register value_; | 404 Register value_; |
405 Register address_; | 405 Register address_; |
406 RememberedSetAction remembered_set_action_; | 406 RememberedSetAction remembered_set_action_; |
407 RegisterAllocation regs_; | 407 RegisterAllocation regs_; |
408 }; | 408 }; |
409 | 409 |
410 | 410 |
411 } } // namespace v8::internal | 411 } } // namespace v8::internal |
412 | 412 |
413 #endif // V8_X87_CODE_STUBS_X87_H_ | 413 #endif // V8_X87_CODE_STUBS_X87_H_ |
OLD | NEW |