Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: src/mips64/code-stubs-mips64.h

Issue 502713003: Encode CEntryStub properties in the minor key. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: encode Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 9
10 10
(...skipping 11 matching lines...) Expand all
22 22
23 void Generate(MacroAssembler* masm); 23 void Generate(MacroAssembler* masm);
24 24
25 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate); 25 static void GenerateFixedRegStubsAheadOfTime(Isolate* isolate);
26 virtual bool SometimesSetsUpAFrame() { return false; } 26 virtual bool SometimesSetsUpAFrame() { return false; }
27 27
28 private: 28 private:
29 SaveFPRegsMode save_doubles_; 29 SaveFPRegsMode save_doubles_;
30 30
31 Major MajorKey() const { return StoreBufferOverflow; } 31 Major MajorKey() const { return StoreBufferOverflow; }
32 int MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 0; } 32 uint32_t MinorKey() const { return (save_doubles_ == kSaveFPRegs) ? 1 : 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 a large number of characters. This function 38 // Generate code for copying a large number of characters. This function
39 // is allowed to spend extra time setting up conditions to make copying 39 // is allowed to spend extra time setting up conditions to make copying
40 // faster. Copying of overlapping regions is not supported. 40 // faster. Copying of overlapping regions is not supported.
41 // Dest register ends at the position after the last character written. 41 // Dest register ends at the position after the last character written.
42 static void GenerateCopyCharacters(MacroAssembler* masm, 42 static void GenerateCopyCharacters(MacroAssembler* masm,
(...skipping 19 matching lines...) Expand all
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() const { return SubString; } 71 Major MajorKey() const { return SubString; }
72 int MinorKey() const { return 0; } 72 uint32_t MinorKey() const { return 0; }
73 73
74 void Generate(MacroAssembler* masm); 74 void Generate(MacroAssembler* masm);
75 }; 75 };
76 76
77 77
78 class StoreRegistersStateStub: public PlatformCodeStub { 78 class StoreRegistersStateStub: public PlatformCodeStub {
79 public: 79 public:
80 explicit StoreRegistersStateStub(Isolate* isolate) 80 explicit StoreRegistersStateStub(Isolate* isolate)
81 : PlatformCodeStub(isolate) {} 81 : PlatformCodeStub(isolate) {}
82 82
83 static void GenerateAheadOfTime(Isolate* isolate); 83 static void GenerateAheadOfTime(Isolate* isolate);
84 private: 84 private:
85 Major MajorKey() const { return StoreRegistersState; } 85 Major MajorKey() const { return StoreRegistersState; }
86 int MinorKey() const { return 0; } 86 uint32_t MinorKey() const { return 0; }
87 87
88 void Generate(MacroAssembler* masm); 88 void Generate(MacroAssembler* masm);
89 }; 89 };
90 90
91 class RestoreRegistersStateStub: public PlatformCodeStub { 91 class RestoreRegistersStateStub: public PlatformCodeStub {
92 public: 92 public:
93 explicit RestoreRegistersStateStub(Isolate* isolate) 93 explicit RestoreRegistersStateStub(Isolate* isolate)
94 : PlatformCodeStub(isolate) {} 94 : PlatformCodeStub(isolate) {}
95 95
96 static void GenerateAheadOfTime(Isolate* isolate); 96 static void GenerateAheadOfTime(Isolate* isolate);
97 private: 97 private:
98 Major MajorKey() const { return RestoreRegistersState; } 98 Major MajorKey() const { return RestoreRegistersState; }
99 int MinorKey() const { return 0; } 99 uint32_t MinorKey() const { return 0; }
100 100
101 void Generate(MacroAssembler* masm); 101 void Generate(MacroAssembler* masm);
102 }; 102 };
103 103
104 class StringCompareStub: public PlatformCodeStub { 104 class StringCompareStub: public PlatformCodeStub {
105 public: 105 public:
106 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { } 106 explicit StringCompareStub(Isolate* isolate) : PlatformCodeStub(isolate) { }
107 107
108 // Compare two flat ASCII strings and returns result in v0. 108 // Compare two flat ASCII strings and returns result in v0.
109 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm, 109 static void GenerateCompareFlatAsciiStrings(MacroAssembler* masm,
110 Register left, 110 Register left,
111 Register right, 111 Register right,
112 Register scratch1, 112 Register scratch1,
113 Register scratch2, 113 Register scratch2,
114 Register scratch3, 114 Register scratch3,
115 Register scratch4); 115 Register scratch4);
116 116
117 // Compares two flat ASCII strings for equality and returns result 117 // Compares two flat ASCII strings for equality and returns result
118 // in v0. 118 // in v0.
119 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm, 119 static void GenerateFlatAsciiStringEquals(MacroAssembler* masm,
120 Register left, 120 Register left,
121 Register right, 121 Register right,
122 Register scratch1, 122 Register scratch1,
123 Register scratch2, 123 Register scratch2,
124 Register scratch3); 124 Register scratch3);
125 125
126 private: 126 private:
127 virtual Major MajorKey() const { return StringCompare; } 127 virtual Major MajorKey() const { return StringCompare; }
128 virtual int MinorKey() const { return 0; } 128 virtual uint32_t MinorKey() const { return 0; }
129 virtual void Generate(MacroAssembler* masm); 129 virtual void Generate(MacroAssembler* masm);
130 130
131 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm, 131 static void GenerateAsciiCharsCompareLoop(MacroAssembler* masm,
132 Register left, 132 Register left,
133 Register right, 133 Register right,
134 Register length, 134 Register length,
135 Register scratch1, 135 Register scratch1,
136 Register scratch2, 136 Register scratch2,
137 Register scratch3, 137 Register scratch3,
138 Label* chars_not_equal); 138 Label* chars_not_equal);
(...skipping 29 matching lines...) Expand all
168 Register scratch_; 168 Register scratch_;
169 Register sign_; 169 Register sign_;
170 170
171 // Minor key encoding in 16 bits. 171 // Minor key encoding in 16 bits.
172 class IntRegisterBits: public BitField<int, 0, 4> {}; 172 class IntRegisterBits: public BitField<int, 0, 4> {};
173 class HeapNumberRegisterBits: public BitField<int, 4, 4> {}; 173 class HeapNumberRegisterBits: public BitField<int, 4, 4> {};
174 class ScratchRegisterBits: public BitField<int, 8, 4> {}; 174 class ScratchRegisterBits: public BitField<int, 8, 4> {};
175 class SignRegisterBits: public BitField<int, 12, 4> {}; 175 class SignRegisterBits: public BitField<int, 12, 4> {};
176 176
177 Major MajorKey() const { return WriteInt32ToHeapNumber; } 177 Major MajorKey() const { return WriteInt32ToHeapNumber; }
178 int MinorKey() const { 178 uint32_t MinorKey() const {
179 // Encode the parameters in a unique 16 bit value. 179 // Encode the parameters in a unique 16 bit value.
180 return IntRegisterBits::encode(the_int_.code()) 180 return IntRegisterBits::encode(the_int_.code())
181 | HeapNumberRegisterBits::encode(the_heap_number_.code()) 181 | HeapNumberRegisterBits::encode(the_heap_number_.code())
182 | ScratchRegisterBits::encode(scratch_.code()) 182 | ScratchRegisterBits::encode(scratch_.code())
183 | SignRegisterBits::encode(sign_.code()); 183 | SignRegisterBits::encode(sign_.code());
184 } 184 }
185 185
186 void Generate(MacroAssembler* masm); 186 void Generate(MacroAssembler* masm);
187 }; 187 };
188 188
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 void Generate(MacroAssembler* masm); 340 void Generate(MacroAssembler* masm);
341 void GenerateIncremental(MacroAssembler* masm, Mode mode); 341 void GenerateIncremental(MacroAssembler* masm, Mode mode);
342 void CheckNeedsToInformIncrementalMarker( 342 void CheckNeedsToInformIncrementalMarker(
343 MacroAssembler* masm, 343 MacroAssembler* masm,
344 OnNoNeedToInformIncrementalMarker on_no_need, 344 OnNoNeedToInformIncrementalMarker on_no_need,
345 Mode mode); 345 Mode mode);
346 void InformIncrementalMarker(MacroAssembler* masm); 346 void InformIncrementalMarker(MacroAssembler* masm);
347 347
348 Major MajorKey() const { return RecordWrite; } 348 Major MajorKey() const { return RecordWrite; }
349 349
350 int MinorKey() const { 350 uint32_t MinorKey() const {
351 return ObjectBits::encode(object_.code()) | 351 return ObjectBits::encode(object_.code()) |
352 ValueBits::encode(value_.code()) | 352 ValueBits::encode(value_.code()) |
353 AddressBits::encode(address_.code()) | 353 AddressBits::encode(address_.code()) |
354 RememberedSetActionBits::encode(remembered_set_action_) | 354 RememberedSetActionBits::encode(remembered_set_action_) |
355 SaveFPRegsModeBits::encode(save_fp_regs_mode_); 355 SaveFPRegsModeBits::encode(save_fp_regs_mode_);
356 } 356 }
357 357
358 void Activate(Code* code) { 358 void Activate(Code* code) {
359 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); 359 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code);
360 } 360 }
(...skipping 20 matching lines...) Expand all
381 // simplest approach is to generate such stub early enough so it can never be 381 // simplest approach is to generate such stub early enough so it can never be
382 // moved by GC 382 // moved by GC
383 class DirectCEntryStub: public PlatformCodeStub { 383 class DirectCEntryStub: public PlatformCodeStub {
384 public: 384 public:
385 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {} 385 explicit DirectCEntryStub(Isolate* isolate) : PlatformCodeStub(isolate) {}
386 void Generate(MacroAssembler* masm); 386 void Generate(MacroAssembler* masm);
387 void GenerateCall(MacroAssembler* masm, Register target); 387 void GenerateCall(MacroAssembler* masm, Register target);
388 388
389 private: 389 private:
390 Major MajorKey() const { return DirectCEntry; } 390 Major MajorKey() const { return DirectCEntry; }
391 int MinorKey() const { return 0; } 391 uint32_t MinorKey() const { return 0; }
392 392
393 bool NeedsImmovableCode() { return true; } 393 bool NeedsImmovableCode() { return true; }
394 }; 394 };
395 395
396 396
397 class NameDictionaryLookupStub: public PlatformCodeStub { 397 class NameDictionaryLookupStub: public PlatformCodeStub {
398 public: 398 public:
399 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; 399 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP };
400 400
401 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode) 401 NameDictionaryLookupStub(Isolate* isolate, LookupMode mode)
(...skipping 26 matching lines...) Expand all
428 static const int kCapacityOffset = 428 static const int kCapacityOffset =
429 NameDictionary::kHeaderSize + 429 NameDictionary::kHeaderSize +
430 NameDictionary::kCapacityIndex * kPointerSize; 430 NameDictionary::kCapacityIndex * kPointerSize;
431 431
432 static const int kElementsStartOffset = 432 static const int kElementsStartOffset =
433 NameDictionary::kHeaderSize + 433 NameDictionary::kHeaderSize +
434 NameDictionary::kElementsStartIndex * kPointerSize; 434 NameDictionary::kElementsStartIndex * kPointerSize;
435 435
436 Major MajorKey() const { return NameDictionaryLookup; } 436 Major MajorKey() const { return NameDictionaryLookup; }
437 437
438 int MinorKey() const { return LookupModeBits::encode(mode_); } 438 uint32_t MinorKey() const { return LookupModeBits::encode(mode_); }
439 439
440 class LookupModeBits: public BitField<LookupMode, 0, 1> {}; 440 class LookupModeBits: public BitField<LookupMode, 0, 1> {};
441 441
442 LookupMode mode_; 442 LookupMode mode_;
443 }; 443 };
444 444
445 445
446 } } // namespace v8::internal 446 } } // namespace v8::internal
447 447
448 #endif // V8_MIPS_CODE_STUBS_ARM_H_ 448 #endif // V8_MIPS_CODE_STUBS_ARM_H_
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698