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

Side by Side Diff: src/compiler/register-allocator.h

Issue 2347563004: [turbofan] Avoid large deopt blocks (Closed)
Patch Set: A few more adjustments Created 4 years, 2 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
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_REGISTER_ALLOCATOR_H_ 5 #ifndef V8_REGISTER_ALLOCATOR_H_
6 #define V8_REGISTER_ALLOCATOR_H_ 6 #define V8_REGISTER_ALLOCATOR_H_
7 7
8 #include "src/compiler/instruction.h" 8 #include "src/compiler/instruction.h"
9 #include "src/ostreams.h" 9 #include "src/ostreams.h"
10 #include "src/register-configuration.h" 10 #include "src/register-configuration.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // For hinting only. 268 // For hinting only.
269 void set_assigned_register(int register_code) { 269 void set_assigned_register(int register_code) {
270 flags_ = AssignedRegisterField::update(flags_, register_code); 270 flags_ = AssignedRegisterField::update(flags_, register_code);
271 } 271 }
272 272
273 UsePositionHintType hint_type() const { 273 UsePositionHintType hint_type() const {
274 return HintTypeField::decode(flags_); 274 return HintTypeField::decode(flags_);
275 } 275 }
276 bool HasHint() const; 276 bool HasHint() const;
277 bool HintRegister(int* register_code) const; 277 bool HintRegister(int* register_code) const;
278 void SetHint(UsePosition* use_pos);
278 void ResolveHint(UsePosition* use_pos); 279 void ResolveHint(UsePosition* use_pos);
279 bool IsResolved() const { 280 bool IsResolved() const {
280 return hint_type() != UsePositionHintType::kUnresolved; 281 return hint_type() != UsePositionHintType::kUnresolved;
281 } 282 }
282 static UsePositionHintType HintTypeForOperand(const InstructionOperand& op); 283 static UsePositionHintType HintTypeForOperand(const InstructionOperand& op);
283 284
284 private: 285 private:
285 typedef BitField<UsePositionType, 0, 2> TypeField; 286 typedef BitField<UsePositionType, 0, 2> TypeField;
286 typedef BitField<UsePositionHintType, 2, 3> HintTypeField; 287 typedef BitField<UsePositionHintType, 2, 3> HintTypeField;
287 typedef BitField<bool, 5, 1> RegisterBeneficialField; 288 typedef BitField<bool, 5, 1> RegisterBeneficialField;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 bool CanBeSpilled(LifetimePosition pos) const; 363 bool CanBeSpilled(LifetimePosition pos) const;
363 364
364 // Splitting primitive used by both splitting and splintering members. 365 // Splitting primitive used by both splitting and splintering members.
365 // Performs the split, but does not link the resulting ranges. 366 // Performs the split, but does not link the resulting ranges.
366 // The given position must follow the start of the range. 367 // The given position must follow the start of the range.
367 // All uses following the given position will be moved from this 368 // All uses following the given position will be moved from this
368 // live range to the result live range. 369 // live range to the result live range.
369 // The current range will terminate at position, while result will start from 370 // The current range will terminate at position, while result will start from
370 // position. 371 // position.
371 UsePosition* DetachAt(LifetimePosition position, LiveRange* result, 372 UsePosition* DetachAt(LifetimePosition position, LiveRange* result,
372 Zone* zone); 373 Zone* zone, bool connect_hints);
373 374
374 // Detaches at position, and then links the resulting ranges. Returns the 375 // Detaches at position, and then links the resulting ranges. Returns the
375 // child, which starts at position. 376 // child, which starts at position.
376 LiveRange* SplitAt(LifetimePosition position, Zone* zone); 377 LiveRange* SplitAt(LifetimePosition position, Zone* zone);
377 378
378 // Returns nullptr when no register is hinted, otherwise sets register_index. 379 // Returns nullptr when no register is hinted, otherwise sets register_index.
379 UsePosition* FirstHintPosition(int* register_index) const; 380 UsePosition* FirstHintPosition(int* register_index) const;
380 UsePosition* FirstHintPosition() const { 381 UsePosition* FirstHintPosition() const {
381 int register_index; 382 int register_index;
382 return FirstHintPosition(&register_index); 383 return FirstHintPosition(&register_index);
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 RegisterAllocationData* const data_; 1169 RegisterAllocationData* const data_;
1169 1170
1170 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector); 1171 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector);
1171 }; 1172 };
1172 1173
1173 } // namespace compiler 1174 } // namespace compiler
1174 } // namespace internal 1175 } // namespace internal
1175 } // namespace v8 1176 } // namespace v8
1176 1177
1177 #endif // V8_REGISTER_ALLOCATOR_H_ 1178 #endif // V8_REGISTER_ALLOCATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698