OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
Jakob Kummerow
2012/02/22 11:36:06
nit: 2012
| |
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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 static const int kInitialLength = 1024; | 417 static const int kInitialLength = 1024; |
418 | 418 |
419 bool InBitsRange(int value) const { | 419 bool InBitsRange(int value) const { |
420 return bits_ != NULL && bits_->length() > value; | 420 return bits_ != NULL && bits_->length() > value; |
421 } | 421 } |
422 | 422 |
423 void EnsureCapacity(int value, Zone* zone) { | 423 void EnsureCapacity(int value, Zone* zone) { |
424 if (InBitsRange(value)) return; | 424 if (InBitsRange(value)) return; |
425 int new_length = bits_ == NULL ? kInitialLength : bits_->length(); | 425 int new_length = bits_ == NULL ? kInitialLength : bits_->length(); |
426 while (new_length <= value) new_length *= 2; | 426 while (new_length <= value) new_length *= 2; |
427 BitVector* new_bits = new(zone) BitVector(new_length); | 427 BitVector* new_bits = new(zone) BitVector(new_length, zone); |
428 if (bits_ != NULL) new_bits->CopyFrom(*bits_); | 428 if (bits_ != NULL) new_bits->CopyFrom(*bits_); |
429 bits_ = new_bits; | 429 bits_ = new_bits; |
430 } | 430 } |
431 | 431 |
432 BitVector* bits_; | 432 BitVector* bits_; |
433 }; | 433 }; |
434 | 434 |
435 | 435 |
436 class LAllocator BASE_EMBEDDED { | 436 class LAllocator BASE_EMBEDDED { |
437 public: | 437 public: |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
631 // Indicates success or failure during register allocation. | 631 // Indicates success or failure during register allocation. |
632 bool allocation_ok_; | 632 bool allocation_ok_; |
633 | 633 |
634 DISALLOW_COPY_AND_ASSIGN(LAllocator); | 634 DISALLOW_COPY_AND_ASSIGN(LAllocator); |
635 }; | 635 }; |
636 | 636 |
637 | 637 |
638 } } // namespace v8::internal | 638 } } // namespace v8::internal |
639 | 639 |
640 #endif // V8_LITHIUM_ALLOCATOR_H_ | 640 #endif // V8_LITHIUM_ALLOCATOR_H_ |
OLD | NEW |