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

Side by Side Diff: src/handles.cc

Issue 769263002: Add support for enabling DCHECKs in release mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years 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 | « src/handles.h ('k') | src/handles-inl.h » ('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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/handles.h" 7 #include "src/handles.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 DeferredHandleScope::DeferredHandleScope(Isolate* isolate) 92 DeferredHandleScope::DeferredHandleScope(Isolate* isolate)
93 : impl_(isolate->handle_scope_implementer()) { 93 : impl_(isolate->handle_scope_implementer()) {
94 impl_->BeginDeferredScope(); 94 impl_->BeginDeferredScope();
95 HandleScopeData* data = impl_->isolate()->handle_scope_data(); 95 HandleScopeData* data = impl_->isolate()->handle_scope_data();
96 Object** new_next = impl_->GetSpareOrNewBlock(); 96 Object** new_next = impl_->GetSpareOrNewBlock();
97 Object** new_limit = &new_next[kHandleBlockSize]; 97 Object** new_limit = &new_next[kHandleBlockSize];
98 DCHECK(data->limit == &impl_->blocks()->last()[kHandleBlockSize]); 98 DCHECK(data->limit == &impl_->blocks()->last()[kHandleBlockSize]);
99 impl_->blocks()->Add(new_next); 99 impl_->blocks()->Add(new_next);
100 100
101 #ifdef DEBUG 101 #if DCHECK_IS_ON
102 prev_level_ = data->level; 102 prev_level_ = data->level;
103 #endif 103 #endif
104 data->level++; 104 data->level++;
105 prev_limit_ = data->limit; 105 prev_limit_ = data->limit;
106 prev_next_ = data->next; 106 prev_next_ = data->next;
107 data->next = new_next; 107 data->next = new_next;
108 data->limit = new_limit; 108 data->limit = new_limit;
109 } 109 }
110 110
111 111
112 DeferredHandleScope::~DeferredHandleScope() { 112 DeferredHandleScope::~DeferredHandleScope() {
113 impl_->isolate()->handle_scope_data()->level--; 113 impl_->isolate()->handle_scope_data()->level--;
114 DCHECK(handles_detached_); 114 DCHECK(handles_detached_);
115 DCHECK(impl_->isolate()->handle_scope_data()->level == prev_level_); 115 DCHECK(impl_->isolate()->handle_scope_data()->level == prev_level_);
116 } 116 }
117 117
118 118
119 DeferredHandles* DeferredHandleScope::Detach() { 119 DeferredHandles* DeferredHandleScope::Detach() {
120 DeferredHandles* deferred = impl_->Detach(prev_limit_); 120 DeferredHandles* deferred = impl_->Detach(prev_limit_);
121 HandleScopeData* data = impl_->isolate()->handle_scope_data(); 121 HandleScopeData* data = impl_->isolate()->handle_scope_data();
122 data->next = prev_next_; 122 data->next = prev_next_;
123 data->limit = prev_limit_; 123 data->limit = prev_limit_;
124 #ifdef DEBUG 124 #if DCHECK_IS_ON
125 handles_detached_ = true; 125 handles_detached_ = true;
126 #endif 126 #endif
127 return deferred; 127 return deferred;
128 } 128 }
129 129
130 } } // namespace v8::internal 130 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/handles.h ('k') | src/handles-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698