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_HANDLE_ZAPPING | 668 #ifdef ENABLE_EXTRA_CHECKS |
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) { | 674 if (prev_limit == block_limit) break; |
675 #ifdef ENABLE_HANDLE_ZAPPING | |
676 internal::HandleScope::ZapRange(prev_limit, block_limit); | |
677 #endif | |
678 break; | |
679 } | |
680 #endif | 675 #endif |
681 | 676 |
682 blocks_.RemoveLast(); | 677 blocks_.RemoveLast(); |
683 #ifdef ENABLE_HANDLE_ZAPPING | 678 #ifdef ENABLE_EXTRA_CHECKS |
684 internal::HandleScope::ZapRange(block_start, block_limit); | 679 internal::HandleScope::ZapRange(block_start, block_limit); |
685 #endif | 680 #endif |
686 if (spare_ != NULL) { | 681 if (spare_ != NULL) { |
687 DeleteArray(spare_); | 682 DeleteArray(spare_); |
688 } | 683 } |
689 spare_ = block_start; | 684 spare_ = block_start; |
690 } | 685 } |
691 ASSERT((blocks_.is_empty() && prev_limit == NULL) || | 686 ASSERT((blocks_.is_empty() && prev_limit == NULL) || |
692 (!blocks_.is_empty() && prev_limit != NULL)); | 687 (!blocks_.is_empty() && prev_limit != NULL)); |
693 } | 688 } |
(...skipping 24 matching lines...) Expand all Loading... |
718 stress_type_ = stress_type; | 713 stress_type_ = stress_type; |
719 } | 714 } |
720 | 715 |
721 private: | 716 private: |
722 static v8::Testing::StressType stress_type_; | 717 static v8::Testing::StressType stress_type_; |
723 }; | 718 }; |
724 | 719 |
725 } } // namespace v8::internal | 720 } } // namespace v8::internal |
726 | 721 |
727 #endif // V8_API_H_ | 722 #endif // V8_API_H_ |
OLD | NEW |