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

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

Issue 1119683002: Mark instruction blocks with spills (for frame elision). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Improved printing of blocks Created 5 years, 7 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 | « src/compiler/pipeline.cc ('k') | src/compiler/register-allocator.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 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/zone-containers.h" 9 #include "src/zone-containers.h"
10 10
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // Shorten the most recently added interval by setting a new start. 411 // Shorten the most recently added interval by setting a new start.
412 void ShortenTo(LifetimePosition start); 412 void ShortenTo(LifetimePosition start);
413 413
414 void Verify() const; 414 void Verify() const;
415 415
416 void ConvertUsesToOperand(const InstructionOperand& op, 416 void ConvertUsesToOperand(const InstructionOperand& op,
417 const InstructionOperand& spill_op); 417 const InstructionOperand& spill_op);
418 void SetUseHints(int register_index); 418 void SetUseHints(int register_index);
419 void UnsetUseHints() { SetUseHints(kUnassignedRegister); } 419 void UnsetUseHints() { SetUseHints(kUnassignedRegister); }
420 420
421 private:
422 struct SpillAtDefinitionList; 421 struct SpillAtDefinitionList;
423 422
423 SpillAtDefinitionList* spills_at_definition() const {
424 return spills_at_definition_;
425 }
426
427 private:
424 void set_spill_type(SpillType value) { 428 void set_spill_type(SpillType value) {
425 bits_ = SpillTypeField::update(bits_, value); 429 bits_ = SpillTypeField::update(bits_, value);
426 } 430 }
427 431
428 void set_spilled(bool value) { bits_ = SpilledField::update(bits_, value); } 432 void set_spilled(bool value) { bits_ = SpilledField::update(bits_, value); }
429 433
430 UseInterval* FirstSearchIntervalForPosition(LifetimePosition position) const; 434 UseInterval* FirstSearchIntervalForPosition(LifetimePosition position) const;
431 void AdvanceLastProcessedMarker(UseInterval* to_start_of, 435 void AdvanceLastProcessedMarker(UseInterval* to_start_of,
432 LifetimePosition but_not_past) const; 436 LifetimePosition but_not_past) const;
433 437
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 LiveRange* SpillBetweenUntil(LiveRange* range, LifetimePosition start, 852 LiveRange* SpillBetweenUntil(LiveRange* range, LifetimePosition start,
849 LifetimePosition until, LifetimePosition end); 853 LifetimePosition until, LifetimePosition end);
850 void AssignRangeToRegister(int reg_id, LiveRange* range); 854 void AssignRangeToRegister(int reg_id, LiveRange* range);
851 855
852 ZoneVector<CoallescedLiveRanges*> allocations_; 856 ZoneVector<CoallescedLiveRanges*> allocations_;
853 PQueue queue_; 857 PQueue queue_;
854 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator); 858 DISALLOW_COPY_AND_ASSIGN(GreedyAllocator);
855 }; 859 };
856 860
857 861
862 class SpillSlotLocator final : public ZoneObject {
863 public:
864 explicit SpillSlotLocator(RegisterAllocationData* data);
865
866 void LocateSpillSlots();
867
868 private:
869 RegisterAllocationData* data() const { return data_; }
870
871 RegisterAllocationData* const data_;
872
873 DISALLOW_COPY_AND_ASSIGN(SpillSlotLocator);
874 };
875
876
858 class OperandAssigner final : public ZoneObject { 877 class OperandAssigner final : public ZoneObject {
859 public: 878 public:
860 explicit OperandAssigner(RegisterAllocationData* data); 879 explicit OperandAssigner(RegisterAllocationData* data);
861 880
862 // Phase 5: assign spill splots. 881 // Phase 5: assign spill splots.
863 void AssignSpillSlots(); 882 void AssignSpillSlots();
864 883
865 // Phase 6: commit assignment. 884 // Phase 6: commit assignment.
866 void CommitAssignment(); 885 void CommitAssignment();
867 886
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 RegisterAllocationData* const data_; 935 RegisterAllocationData* const data_;
917 936
918 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector); 937 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector);
919 }; 938 };
920 939
921 } // namespace compiler 940 } // namespace compiler
922 } // namespace internal 941 } // namespace internal
923 } // namespace v8 942 } // namespace v8
924 943
925 #endif // V8_REGISTER_ALLOCATOR_H_ 944 #endif // V8_REGISTER_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698