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

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

Issue 14771015: Cache first hint operand while building live ranges. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // All uses following the given position will be moved from this 322 // All uses following the given position will be moved from this
323 // live range to the result live range. 323 // live range to the result live range.
324 void SplitAt(LifetimePosition position, LiveRange* result, Zone* zone); 324 void SplitAt(LifetimePosition position, LiveRange* result, Zone* zone);
325 325
326 bool IsDouble() const { return is_double_; } 326 bool IsDouble() const { return is_double_; }
327 bool HasRegisterAssigned() const { 327 bool HasRegisterAssigned() const {
328 return assigned_register_ != kInvalidAssignment; 328 return assigned_register_ != kInvalidAssignment;
329 } 329 }
330 bool IsSpilled() const { return spilled_; } 330 bool IsSpilled() const { return spilled_; }
331 331
332 LOperand* current_hint_operand() const {
333 ASSERT(current_hint_operand_ == FirstHint());
334 return current_hint_operand_;
335 }
332 LOperand* FirstHint() const { 336 LOperand* FirstHint() const {
333 UsePosition* pos = first_pos_; 337 UsePosition* pos = first_pos_;
334 while (pos != NULL && !pos->HasHint()) pos = pos->next(); 338 while (pos != NULL && !pos->HasHint()) pos = pos->next();
335 if (pos != NULL) return pos->hint(); 339 if (pos != NULL) return pos->hint();
336 return NULL; 340 return NULL;
337 } 341 }
338 342
339 LifetimePosition Start() const { 343 LifetimePosition Start() const {
340 ASSERT(!IsEmpty()); 344 ASSERT(!IsEmpty());
341 return first_interval()->start(); 345 return first_interval()->start();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 bool is_double_; 395 bool is_double_;
392 int assigned_register_; 396 int assigned_register_;
393 UseInterval* last_interval_; 397 UseInterval* last_interval_;
394 UseInterval* first_interval_; 398 UseInterval* first_interval_;
395 UsePosition* first_pos_; 399 UsePosition* first_pos_;
396 LiveRange* parent_; 400 LiveRange* parent_;
397 LiveRange* next_; 401 LiveRange* next_;
398 // This is used as a cache, it doesn't affect correctness. 402 // This is used as a cache, it doesn't affect correctness.
399 mutable UseInterval* current_interval_; 403 mutable UseInterval* current_interval_;
400 UsePosition* last_processed_use_; 404 UsePosition* last_processed_use_;
405 // This is used as a cache, it's invalid outside of BuildLiveRanges.
406 LOperand* current_hint_operand_;
401 LOperand* spill_operand_; 407 LOperand* spill_operand_;
402 int spill_start_index_; 408 int spill_start_index_;
403 }; 409 };
404 410
405 411
406 class LAllocator BASE_EMBEDDED { 412 class LAllocator BASE_EMBEDDED {
407 public: 413 public:
408 LAllocator(int first_virtual_register, HGraph* graph); 414 LAllocator(int first_virtual_register, HGraph* graph);
409 415
410 static void TraceAlloc(const char* msg, ...); 416 static void TraceAlloc(const char* msg, ...);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 LifetimePosition allocation_finger_; 642 LifetimePosition allocation_finger_;
637 #endif 643 #endif
638 644
639 DISALLOW_COPY_AND_ASSIGN(LAllocator); 645 DISALLOW_COPY_AND_ASSIGN(LAllocator);
640 }; 646 };
641 647
642 648
643 } } // namespace v8::internal 649 } } // namespace v8::internal
644 650
645 #endif // V8_LITHIUM_ALLOCATOR_H_ 651 #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