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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 | 676 |
677 | 677 |
678 HandleScope::~HandleScope() { | 678 HandleScope::~HandleScope() { |
679 if (!is_closed_) { | 679 if (!is_closed_) { |
680 Leave(); | 680 Leave(); |
681 } | 681 } |
682 } | 682 } |
683 | 683 |
684 | 684 |
685 void HandleScope::Leave() { | 685 void HandleScope::Leave() { |
686 v8::ImplementationUtilities::HandleScopeData* current = | 686 return i::HandleScope::CloseScope(isolate_, prev_next_, prev_limit_); |
687 isolate_->handle_scope_data(); | |
688 current->level--; | |
689 ASSERT(current->level >= 0); | |
690 current->next = prev_next_; | |
691 if (current->limit != prev_limit_) { | |
692 current->limit = prev_limit_; | |
693 i::HandleScope::DeleteExtensions(isolate_); | |
694 } | |
695 | |
696 #ifdef ENABLE_EXTRA_CHECKS | |
697 i::HandleScope::ZapRange(prev_next_, prev_limit_); | |
698 #endif | |
699 } | 687 } |
700 | 688 |
701 | 689 |
702 int HandleScope::NumberOfHandles() { | 690 int HandleScope::NumberOfHandles() { |
703 i::Isolate* isolate = i::Isolate::Current(); | 691 i::Isolate* isolate = i::Isolate::Current(); |
704 if (!EnsureInitializedForIsolate(isolate, "HandleScope::NumberOfHandles")) { | 692 if (!EnsureInitializedForIsolate(isolate, "HandleScope::NumberOfHandles")) { |
705 return 0; | 693 return 0; |
706 } | 694 } |
707 return i::HandleScope::NumberOfHandles(isolate); | 695 return i::HandleScope::NumberOfHandles(isolate); |
708 } | 696 } |
(...skipping 7194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7903 | 7891 |
7904 v->VisitPointers(blocks_.first(), first_block_limit_); | 7892 v->VisitPointers(blocks_.first(), first_block_limit_); |
7905 | 7893 |
7906 for (int i = 1; i < blocks_.length(); i++) { | 7894 for (int i = 1; i < blocks_.length(); i++) { |
7907 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7895 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
7908 } | 7896 } |
7909 } | 7897 } |
7910 | 7898 |
7911 | 7899 |
7912 } } // namespace v8::internal | 7900 } } // namespace v8::internal |
OLD | NEW |