OLD | NEW |
1 // Copyright 2006-2010 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 int amount = amount_of_external_allocated_memory_ + change_in_bytes; | 430 int amount = amount_of_external_allocated_memory_ + change_in_bytes; |
431 if (change_in_bytes >= 0) { | 431 if (change_in_bytes >= 0) { |
432 // Avoid overflow. | 432 // Avoid overflow. |
433 if (amount > amount_of_external_allocated_memory_) { | 433 if (amount > amount_of_external_allocated_memory_) { |
434 amount_of_external_allocated_memory_ = amount; | 434 amount_of_external_allocated_memory_ = amount; |
435 } | 435 } |
436 int amount_since_last_global_gc = | 436 int amount_since_last_global_gc = |
437 amount_of_external_allocated_memory_ - | 437 amount_of_external_allocated_memory_ - |
438 amount_of_external_allocated_memory_at_last_global_gc_; | 438 amount_of_external_allocated_memory_at_last_global_gc_; |
439 if (amount_since_last_global_gc > external_allocation_limit_) { | 439 if (amount_since_last_global_gc > external_allocation_limit_) { |
440 CollectAllGarbage(false); | 440 CollectAllGarbage(kNoGCFlags); |
441 } | 441 } |
442 } else { | 442 } else { |
443 // Avoid underflow. | 443 // Avoid underflow. |
444 if (amount >= 0) { | 444 if (amount >= 0) { |
445 amount_of_external_allocated_memory_ = amount; | 445 amount_of_external_allocated_memory_ = amount; |
446 } | 446 } |
447 } | 447 } |
448 ASSERT(amount_of_external_allocated_memory_ >= 0); | 448 ASSERT(amount_of_external_allocated_memory_ >= 0); |
449 return amount_of_external_allocated_memory_; | 449 return amount_of_external_allocated_memory_; |
450 } | 450 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 571 |
572 | 572 |
573 void ExternalStringTable::ShrinkNewStrings(int position) { | 573 void ExternalStringTable::ShrinkNewStrings(int position) { |
574 new_space_strings_.Rewind(position); | 574 new_space_strings_.Rewind(position); |
575 Verify(); | 575 Verify(); |
576 } | 576 } |
577 | 577 |
578 } } // namespace v8::internal | 578 } } // namespace v8::internal |
579 | 579 |
580 #endif // V8_HEAP_INL_H_ | 580 #endif // V8_HEAP_INL_H_ |
OLD | NEW |