Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: src/api.h

Issue 1079713002: api: introduce SealHandleScope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix typo in a test Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/v8.h ('k') | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698