| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_gc_verbose) { | 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_); | |
| 463 if (FLAG_gc_verbose) { | 462 if (FLAG_gc_verbose) { |
| 464 printf("UpdateLiveBytes:%p:%x%c=%x->%x\n", | 463 printf("UpdateLiveBytes:%p:%x%c=%x->%x\n", |
| 465 static_cast<void*>(this), live_byte_count_, | 464 static_cast<void*>(this), live_byte_count_, |
| 466 ((by < 0) ? '-' : '+'), ((by < 0) ? -by : by), | 465 ((by < 0) ? '-' : '+'), ((by < 0) ? -by : by), |
| 467 live_byte_count_ + by); | 466 live_byte_count_ + by); |
| 468 } | 467 } |
| 469 live_byte_count_ += by; | 468 live_byte_count_ += by; |
| 470 ASSERT_LE(static_cast<unsigned>(live_byte_count_), size_); | 469 ASSERT_LE(static_cast<unsigned>(live_byte_count_), size_); |
| 471 } | 470 } |
| 472 int LiveBytes() { | 471 int LiveBytes() { |
| (...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2615 } | 2614 } |
| 2616 // Must be small, since an iteration is used for lookup. | 2615 // Must be small, since an iteration is used for lookup. |
| 2617 static const int kMaxComments = 64; | 2616 static const int kMaxComments = 64; |
| 2618 }; | 2617 }; |
| 2619 #endif | 2618 #endif |
| 2620 | 2619 |
| 2621 | 2620 |
| 2622 } } // namespace v8::internal | 2621 } } // namespace v8::internal |
| 2623 | 2622 |
| 2624 #endif // V8_SPACES_H_ | 2623 #endif // V8_SPACES_H_ |
| OLD | NEW |