OLD | NEW |
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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 } | 658 } |
659 | 659 |
660 | 660 |
661 void HandleScopeImplementer::DeleteExtensions(internal::Object** prev_limit) { | 661 void HandleScopeImplementer::DeleteExtensions(internal::Object** prev_limit) { |
662 while (!blocks_.is_empty()) { | 662 while (!blocks_.is_empty()) { |
663 internal::Object** block_start = blocks_.last(); | 663 internal::Object** block_start = blocks_.last(); |
664 internal::Object** block_limit = block_start + kHandleBlockSize; | 664 internal::Object** block_limit = block_start + kHandleBlockSize; |
665 #ifdef DEBUG | 665 #ifdef DEBUG |
666 // SealHandleScope may make the prev_limit to point inside the block. | 666 // SealHandleScope may make the prev_limit to point inside the block. |
667 if (block_start <= prev_limit && prev_limit <= block_limit) { | 667 if (block_start <= prev_limit && prev_limit <= block_limit) { |
668 #ifdef ENABLE_EXTRA_CHECKS | 668 #ifdef ENABLE_HANDLE_ZAPPING |
669 internal::HandleScope::ZapRange(prev_limit, block_limit); | 669 internal::HandleScope::ZapRange(prev_limit, block_limit); |
670 #endif | 670 #endif |
671 break; | 671 break; |
672 } | 672 } |
673 #else | 673 #else |
674 if (prev_limit == block_limit) break; | 674 if (prev_limit == block_limit) { |
| 675 #ifdef ENABLE_HANDLE_ZAPPING |
| 676 internal::HandleScope::ZapRange(prev_limit, block_limit); |
| 677 #endif |
| 678 break; |
| 679 } |
675 #endif | 680 #endif |
676 | 681 |
677 blocks_.RemoveLast(); | 682 blocks_.RemoveLast(); |
678 #ifdef ENABLE_EXTRA_CHECKS | 683 #ifdef ENABLE_HANDLE_ZAPPING |
679 internal::HandleScope::ZapRange(block_start, block_limit); | 684 internal::HandleScope::ZapRange(block_start, block_limit); |
680 #endif | 685 #endif |
681 if (spare_ != NULL) { | 686 if (spare_ != NULL) { |
682 DeleteArray(spare_); | 687 DeleteArray(spare_); |
683 } | 688 } |
684 spare_ = block_start; | 689 spare_ = block_start; |
685 } | 690 } |
686 ASSERT((blocks_.is_empty() && prev_limit == NULL) || | 691 ASSERT((blocks_.is_empty() && prev_limit == NULL) || |
687 (!blocks_.is_empty() && prev_limit != NULL)); | 692 (!blocks_.is_empty() && prev_limit != NULL)); |
688 } | 693 } |
(...skipping 24 matching lines...) Expand all Loading... |
713 stress_type_ = stress_type; | 718 stress_type_ = stress_type; |
714 } | 719 } |
715 | 720 |
716 private: | 721 private: |
717 static v8::Testing::StressType stress_type_; | 722 static v8::Testing::StressType stress_type_; |
718 }; | 723 }; |
719 | 724 |
720 } } // namespace v8::internal | 725 } } // namespace v8::internal |
721 | 726 |
722 #endif // V8_API_H_ | 727 #endif // V8_API_H_ |
OLD | NEW |