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

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

Issue 542043002: X87: Minor-key-ify remaining code stubs (Closed) Base URL: https://github.com/v8/v8.git@bleeding_edge
Patch Set: 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
« no previous file with comments | « no previous file | src/x87/code-stubs-x87.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_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" 8 #include "src/code-stubs.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 Label::Distance chars_not_equal_near = Label::kFar); 68 Label::Distance chars_not_equal_near = Label::kFar);
69 69
70 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); 70 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper);
71 }; 71 };
72 72
73 73
74 class NameDictionaryLookupStub: public PlatformCodeStub { 74 class NameDictionaryLookupStub: public PlatformCodeStub {
75 public: 75 public:
76 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP }; 76 enum LookupMode { POSITIVE_LOOKUP, NEGATIVE_LOOKUP };
77 77
78 NameDictionaryLookupStub(Isolate* isolate, 78 NameDictionaryLookupStub(Isolate* isolate, Register dictionary,
79 Register dictionary, 79 Register result, Register index, LookupMode mode)
80 Register result, 80 : PlatformCodeStub(isolate) {
81 Register index, 81 minor_key_ = DictionaryBits::encode(dictionary.code()) |
82 LookupMode mode) 82 ResultBits::encode(result.code()) |
83 : PlatformCodeStub(isolate), 83 IndexBits::encode(index.code()) | LookupModeBits::encode(mode);
84 dictionary_(dictionary), result_(result), index_(index), mode_(mode) { } 84 }
85 85
86 void Generate(MacroAssembler* masm); 86 void Generate(MacroAssembler* masm);
87 87
88 static void GenerateNegativeLookup(MacroAssembler* masm, 88 static void GenerateNegativeLookup(MacroAssembler* masm,
89 Label* miss, 89 Label* miss,
90 Label* done, 90 Label* done,
91 Register properties, 91 Register properties,
92 Handle<Name> name, 92 Handle<Name> name,
93 Register r0); 93 Register r0);
94 94
(...skipping 14 matching lines...) Expand all
109 static const int kCapacityOffset = 109 static const int kCapacityOffset =
110 NameDictionary::kHeaderSize + 110 NameDictionary::kHeaderSize +
111 NameDictionary::kCapacityIndex * kPointerSize; 111 NameDictionary::kCapacityIndex * kPointerSize;
112 112
113 static const int kElementsStartOffset = 113 static const int kElementsStartOffset =
114 NameDictionary::kHeaderSize + 114 NameDictionary::kHeaderSize +
115 NameDictionary::kElementsStartIndex * kPointerSize; 115 NameDictionary::kElementsStartIndex * kPointerSize;
116 116
117 Major MajorKey() const { return NameDictionaryLookup; } 117 Major MajorKey() const { return NameDictionaryLookup; }
118 118
119 uint32_t MinorKey() const { 119 Register dictionary() const {
120 return DictionaryBits::encode(dictionary_.code()) | 120 return Register::from_code(DictionaryBits::decode(minor_key_));
121 ResultBits::encode(result_.code()) |
122 IndexBits::encode(index_.code()) |
123 LookupModeBits::encode(mode_);
124 } 121 }
125 122
123 Register result() const {
124 return Register::from_code(ResultBits::decode(minor_key_));
125 }
126
127 Register index() const {
128 return Register::from_code(IndexBits::decode(minor_key_));
129 }
130
131 LookupMode mode() const { return LookupModeBits::decode(minor_key_); }
132
126 class DictionaryBits: public BitField<int, 0, 3> {}; 133 class DictionaryBits: public BitField<int, 0, 3> {};
127 class ResultBits: public BitField<int, 3, 3> {}; 134 class ResultBits: public BitField<int, 3, 3> {};
128 class IndexBits: public BitField<int, 6, 3> {}; 135 class IndexBits: public BitField<int, 6, 3> {};
129 class LookupModeBits: public BitField<LookupMode, 9, 1> {}; 136 class LookupModeBits: public BitField<LookupMode, 9, 1> {};
130 137
131 Register dictionary_; 138 DISALLOW_COPY_AND_ASSIGN(NameDictionaryLookupStub);
132 Register result_;
133 Register index_;
134 LookupMode mode_;
135 }; 139 };
136 140
137 141
138 class RecordWriteStub: public PlatformCodeStub { 142 class RecordWriteStub: public PlatformCodeStub {
139 public: 143 public:
140 RecordWriteStub(Isolate* isolate, 144 RecordWriteStub(Isolate* isolate,
141 Register object, 145 Register object,
142 Register value, 146 Register value,
143 Register address, 147 Register address,
144 RememberedSetAction remembered_set_action) 148 RememberedSetAction remembered_set_action)
145 : PlatformCodeStub(isolate), 149 : PlatformCodeStub(isolate),
146 object_(object),
147 value_(value),
148 address_(address),
149 remembered_set_action_(remembered_set_action),
150 regs_(object, // An input reg. 150 regs_(object, // An input reg.
151 address, // An input reg. 151 address, // An input reg.
152 value) { // One scratch reg. 152 value) { // One scratch reg.
153 minor_key_ = ObjectBits::encode(object.code()) |
154 ValueBits::encode(value.code()) |
155 AddressBits::encode(address.code()) |
156 RememberedSetActionBits::encode(remembered_set_action);
153 } 157 }
154 158
155 enum Mode { 159 enum Mode {
156 STORE_BUFFER_ONLY, 160 STORE_BUFFER_ONLY,
157 INCREMENTAL, 161 INCREMENTAL,
158 INCREMENTAL_COMPACTION 162 INCREMENTAL_COMPACTION
159 }; 163 };
160 164
161 virtual bool SometimesSetsUpAFrame() { return false; } 165 virtual bool SometimesSetsUpAFrame() { return false; }
162 166
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 329 }
326 UNREACHABLE(); 330 UNREACHABLE();
327 return no_reg; 331 return no_reg;
328 } 332 }
329 friend class RecordWriteStub; 333 friend class RecordWriteStub;
330 }; 334 };
331 335
332 enum OnNoNeedToInformIncrementalMarker { 336 enum OnNoNeedToInformIncrementalMarker {
333 kReturnOnNoNeedToInformIncrementalMarker, 337 kReturnOnNoNeedToInformIncrementalMarker,
334 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker 338 kUpdateRememberedSetOnNoNeedToInformIncrementalMarker
335 } 339 };
336 ; 340
341 Major MajorKey() const { return RecordWrite; }
342
337 void Generate(MacroAssembler* masm); 343 void Generate(MacroAssembler* masm);
338 void GenerateIncremental(MacroAssembler* masm, Mode mode); 344 void GenerateIncremental(MacroAssembler* masm, Mode mode);
339 void CheckNeedsToInformIncrementalMarker( 345 void CheckNeedsToInformIncrementalMarker(
340 MacroAssembler* masm, 346 MacroAssembler* masm,
341 OnNoNeedToInformIncrementalMarker on_no_need, 347 OnNoNeedToInformIncrementalMarker on_no_need,
342 Mode mode); 348 Mode mode);
343 void InformIncrementalMarker(MacroAssembler* masm); 349 void InformIncrementalMarker(MacroAssembler* masm);
344 350
345 Major MajorKey() const { return RecordWrite; }
346
347 uint32_t MinorKey() const {
348 return ObjectBits::encode(object_.code()) |
349 ValueBits::encode(value_.code()) |
350 AddressBits::encode(address_.code()) |
351 RememberedSetActionBits::encode(remembered_set_action_);
352 }
353
354 void Activate(Code* code) { 351 void Activate(Code* code) {
355 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code); 352 code->GetHeap()->incremental_marking()->ActivateGeneratedStub(code);
356 } 353 }
357 354
355 Register object() const {
356 return Register::from_code(ObjectBits::decode(minor_key_));
357 }
358
359 Register value() const {
360 return Register::from_code(ValueBits::decode(minor_key_));
361 }
362
363 Register address() const {
364 return Register::from_code(AddressBits::decode(minor_key_));
365 }
366
367 RememberedSetAction remembered_set_action() const {
368 return RememberedSetActionBits::decode(minor_key_);
369 }
370
358 class ObjectBits: public BitField<int, 0, 3> {}; 371 class ObjectBits: public BitField<int, 0, 3> {};
359 class ValueBits: public BitField<int, 3, 3> {}; 372 class ValueBits: public BitField<int, 3, 3> {};
360 class AddressBits: public BitField<int, 6, 3> {}; 373 class AddressBits: public BitField<int, 6, 3> {};
361 class RememberedSetActionBits: public BitField<RememberedSetAction, 9, 1> {}; 374 class RememberedSetActionBits: public BitField<RememberedSetAction, 9, 1> {};
362 375
363 Register object_;
364 Register value_;
365 Register address_;
366 RememberedSetAction remembered_set_action_;
367 RegisterAllocation regs_; 376 RegisterAllocation regs_;
377
378 DISALLOW_COPY_AND_ASSIGN(RecordWriteStub);
368 }; 379 };
369 380
370 381
371 } } // namespace v8::internal 382 } } // namespace v8::internal
372 383
373 #endif // V8_X87_CODE_STUBS_X87_H_ 384 #endif // V8_X87_CODE_STUBS_X87_H_
OLDNEW
« no previous file with comments | « no previous file | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698