| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 void SetFlags(intptr_t flags, intptr_t mask) { | 445 void SetFlags(intptr_t flags, intptr_t mask) { |
| 446 flags_ = (flags_ & ~mask) | (flags & mask); | 446 flags_ = (flags_ & ~mask) | (flags & mask); |
| 447 } | 447 } |
| 448 | 448 |
| 449 // Return all current flags. | 449 // Return all current flags. |
| 450 intptr_t GetFlags() { return flags_; } | 450 intptr_t GetFlags() { return flags_; } |
| 451 | 451 |
| 452 // Manage live byte count (count of bytes known to be live, | 452 // Manage live byte count (count of bytes known to be live, |
| 453 // because they are marked black). | 453 // because they are marked black). |
| 454 void ResetLiveBytes() { | 454 void ResetLiveBytes() { |
| 455 if (FLAG_trace_live_byte_count) { | 455 if (FLAG_gc_verbose) { |
| 456 PrintF("ResetLiveBytes:%p:%x->0\n", | 456 PrintF("ResetLiveBytes:%p:%x->0\n", |
| 457 static_cast<void*>(this), live_byte_count_); | 457 static_cast<void*>(this), live_byte_count_); |
| 458 } | 458 } |
| 459 live_byte_count_ = 0; | 459 live_byte_count_ = 0; |
| 460 } | 460 } |
| 461 void IncrementLiveBytes(int by) { | 461 void IncrementLiveBytes(int by) { |
| 462 ASSERT_LE(static_cast<unsigned>(live_byte_count_), size_); | 462 ASSERT_LE(static_cast<unsigned>(live_byte_count_), size_); |
| 463 if (FLAG_trace_live_byte_count) { | 463 if (FLAG_gc_verbose) { |
| 464 printf("UpdateLiveBytes:%p:%x%c=%x->%x\n", | 464 printf("UpdateLiveBytes:%p:%x%c=%x->%x\n", |
| 465 static_cast<void*>(this), live_byte_count_, | 465 static_cast<void*>(this), live_byte_count_, |
| 466 ((by < 0) ? '-' : '+'), ((by < 0) ? -by : by), | 466 ((by < 0) ? '-' : '+'), ((by < 0) ? -by : by), |
| 467 live_byte_count_ + by); | 467 live_byte_count_ + by); |
| 468 } | 468 } |
| 469 live_byte_count_ += by; | 469 live_byte_count_ += by; |
| 470 ASSERT_LE(static_cast<unsigned>(live_byte_count_), size_); | 470 ASSERT_LE(static_cast<unsigned>(live_byte_count_), size_); |
| 471 } | 471 } |
| 472 int LiveBytes() { | 472 int LiveBytes() { |
| 473 ASSERT(static_cast<unsigned>(live_byte_count_) <= size_); | 473 ASSERT(static_cast<unsigned>(live_byte_count_) <= size_); |
| (...skipping 2145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2619 } | 2619 } |
| 2620 // Must be small, since an iteration is used for lookup. | 2620 // Must be small, since an iteration is used for lookup. |
| 2621 static const int kMaxComments = 64; | 2621 static const int kMaxComments = 64; |
| 2622 }; | 2622 }; |
| 2623 #endif | 2623 #endif |
| 2624 | 2624 |
| 2625 | 2625 |
| 2626 } } // namespace v8::internal | 2626 } } // namespace v8::internal |
| 2627 | 2627 |
| 2628 #endif // V8_SPACES_H_ | 2628 #endif // V8_SPACES_H_ |
| OLD | NEW |