| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_API_H_ | 5 #ifndef V8_API_H_ |
| 6 #define V8_API_H_ | 6 #define V8_API_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "include/v8-testing.h" | 10 #include "include/v8-testing.h" |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 NewArray<internal::Object*>(kHandleBlockSize); | 654 NewArray<internal::Object*>(kHandleBlockSize); |
| 655 spare_ = NULL; | 655 spare_ = NULL; |
| 656 return block; | 656 return block; |
| 657 } | 657 } |
| 658 | 658 |
| 659 | 659 |
| 660 void HandleScopeImplementer::DeleteExtensions(internal::Object** prev_limit) { | 660 void HandleScopeImplementer::DeleteExtensions(internal::Object** prev_limit) { |
| 661 while (!blocks_.is_empty()) { | 661 while (!blocks_.is_empty()) { |
| 662 internal::Object** block_start = blocks_.last(); | 662 internal::Object** block_start = blocks_.last(); |
| 663 internal::Object** block_limit = block_start + kHandleBlockSize; | 663 internal::Object** block_limit = block_start + kHandleBlockSize; |
| 664 #ifdef DEBUG | 664 |
| 665 // SealHandleScope may make the prev_limit to point inside the block. | 665 // SealHandleScope may make the prev_limit to point inside the block. |
| 666 if (block_start <= prev_limit && prev_limit <= block_limit) { | 666 if (block_start <= prev_limit && prev_limit <= block_limit) { |
| 667 #ifdef ENABLE_HANDLE_ZAPPING | 667 #ifdef ENABLE_HANDLE_ZAPPING |
| 668 internal::HandleScope::ZapRange(prev_limit, block_limit); | 668 internal::HandleScope::ZapRange(prev_limit, block_limit); |
| 669 #endif | 669 #endif |
| 670 break; | 670 break; |
| 671 } | 671 } |
| 672 #else | |
| 673 if (prev_limit == block_limit) break; | |
| 674 #endif | |
| 675 | 672 |
| 676 blocks_.RemoveLast(); | 673 blocks_.RemoveLast(); |
| 677 #ifdef ENABLE_HANDLE_ZAPPING | 674 #ifdef ENABLE_HANDLE_ZAPPING |
| 678 internal::HandleScope::ZapRange(block_start, block_limit); | 675 internal::HandleScope::ZapRange(block_start, block_limit); |
| 679 #endif | 676 #endif |
| 680 if (spare_ != NULL) { | 677 if (spare_ != NULL) { |
| 681 DeleteArray(spare_); | 678 DeleteArray(spare_); |
| 682 } | 679 } |
| 683 spare_ = block_start; | 680 spare_ = block_start; |
| 684 } | 681 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 704 stress_type_ = stress_type; | 701 stress_type_ = stress_type; |
| 705 } | 702 } |
| 706 | 703 |
| 707 private: | 704 private: |
| 708 static v8::Testing::StressType stress_type_; | 705 static v8::Testing::StressType stress_type_; |
| 709 }; | 706 }; |
| 710 | 707 |
| 711 } } // namespace v8::internal | 708 } } // namespace v8::internal |
| 712 | 709 |
| 713 #endif // V8_API_H_ | 710 #endif // V8_API_H_ |
| OLD | NEW |