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

Side by Side Diff: src/lithium-allocator.h

Issue 14524008: Make UsePosition::hint immutable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Sven Panne. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/lithium-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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 LifetimePosition start_; 237 LifetimePosition start_;
238 LifetimePosition end_; 238 LifetimePosition end_;
239 UseInterval* next_; 239 UseInterval* next_;
240 240
241 friend class LiveRange; // Assigns to start_. 241 friend class LiveRange; // Assigns to start_.
242 }; 242 };
243 243
244 // Representation of a use position. 244 // Representation of a use position.
245 class UsePosition: public ZoneObject { 245 class UsePosition: public ZoneObject {
246 public: 246 public:
247 UsePosition(LifetimePosition pos, LOperand* operand); 247 UsePosition(LifetimePosition pos, LOperand* operand, LOperand* hint);
248 248
249 LOperand* operand() const { return operand_; } 249 LOperand* operand() const { return operand_; }
250 bool HasOperand() const { return operand_ != NULL; } 250 bool HasOperand() const { return operand_ != NULL; }
251 251
252 LOperand* hint() const { return hint_; } 252 LOperand* hint() const { return hint_; }
253 void set_hint(LOperand* hint) { hint_ = hint; }
254 bool HasHint() const; 253 bool HasHint() const;
255 bool RequiresRegister() const; 254 bool RequiresRegister() const;
256 bool RegisterIsBeneficial() const; 255 bool RegisterIsBeneficial() const;
257 256
258 LifetimePosition pos() const { return pos_; } 257 LifetimePosition pos() const { return pos_; }
259 UsePosition* next() const { return next_; } 258 UsePosition* next() const { return next_; }
260 259
261 private: 260 private:
262 void set_next(UsePosition* next) { next_ = next; } 261 void set_next(UsePosition* next) { next_ = next; }
263 262
264 LOperand* operand_; 263 LOperand* const operand_;
265 LOperand* hint_; 264 LOperand* const hint_;
266 LifetimePosition pos_; 265 LifetimePosition const pos_;
267 UsePosition* next_; 266 UsePosition* next_;
268 bool requires_reg_; 267 bool requires_reg_;
269 bool register_beneficial_; 268 bool register_beneficial_;
270 269
271 friend class LiveRange; 270 friend class LiveRange;
272 }; 271 };
273 272
274 // Representation of SSA values' live ranges as a collection of (continuous) 273 // Representation of SSA values' live ranges as a collection of (continuous)
275 // intervals over the instruction ordering. 274 // intervals over the instruction ordering.
276 class LiveRange: public ZoneObject { 275 class LiveRange: public ZoneObject {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 bool Covers(LifetimePosition position); 359 bool Covers(LifetimePosition position);
361 LifetimePosition FirstIntersection(LiveRange* other); 360 LifetimePosition FirstIntersection(LiveRange* other);
362 361
363 // Add a new interval or a new use position to this live range. 362 // Add a new interval or a new use position to this live range.
364 void EnsureInterval(LifetimePosition start, 363 void EnsureInterval(LifetimePosition start,
365 LifetimePosition end, 364 LifetimePosition end,
366 Zone* zone); 365 Zone* zone);
367 void AddUseInterval(LifetimePosition start, 366 void AddUseInterval(LifetimePosition start,
368 LifetimePosition end, 367 LifetimePosition end,
369 Zone* zone); 368 Zone* zone);
370 UsePosition* AddUsePosition(LifetimePosition pos, 369 void AddUsePosition(LifetimePosition pos,
371 LOperand* operand, 370 LOperand* operand,
372 Zone* zone); 371 LOperand* hint,
372 Zone* zone);
373 373
374 // Shorten the most recently added interval by setting a new start. 374 // Shorten the most recently added interval by setting a new start.
375 void ShortenTo(LifetimePosition start); 375 void ShortenTo(LifetimePosition start);
376 376
377 #ifdef DEBUG 377 #ifdef DEBUG
378 // True if target overlaps an existing interval. 378 // True if target overlaps an existing interval.
379 bool HasOverlap(UseInterval* target) const; 379 bool HasOverlap(UseInterval* target) const;
380 void Verify() const; 380 void Verify() const;
381 #endif 381 #endif
382 382
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 LifetimePosition allocation_finger_; 636 LifetimePosition allocation_finger_;
637 #endif 637 #endif
638 638
639 DISALLOW_COPY_AND_ASSIGN(LAllocator); 639 DISALLOW_COPY_AND_ASSIGN(LAllocator);
640 }; 640 };
641 641
642 642
643 } } // namespace v8::internal 643 } } // namespace v8::internal
644 644
645 #endif // V8_LITHIUM_ALLOCATOR_H_ 645 #endif // V8_LITHIUM_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « no previous file | src/lithium-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698