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

Side by Side Diff: src/handles-inl.h

Issue 985873002: api: introduce SealHandleScope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
« src/api.cc ('K') | « src/api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 5
6 #ifndef V8_HANDLES_INL_H_ 6 #ifndef V8_HANDLES_INL_H_
7 #define V8_HANDLES_INL_H_ 7 #define V8_HANDLES_INL_H_
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/handles.h" 10 #include "src/handles.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 prev_limit_ = current->limit; 131 prev_limit_ = current->limit;
132 current->level++; 132 current->level++;
133 return result; 133 return result;
134 } 134 }
135 135
136 136
137 template <typename T> 137 template <typename T>
138 T** HandleScope::CreateHandle(Isolate* isolate, T* value) { 138 T** HandleScope::CreateHandle(Isolate* isolate, T* value) {
139 DCHECK(AllowHandleAllocation::IsAllowed()); 139 DCHECK(AllowHandleAllocation::IsAllowed());
140 HandleScopeData* current = isolate->handle_scope_data(); 140 HandleScopeData* current = isolate->handle_scope_data();
141 DCHECK(current->level > 0);
141 142
142 internal::Object** cur = current->next; 143 internal::Object** cur = current->next;
143 if (cur == current->limit) cur = Extend(isolate); 144 if (cur == current->limit) cur = Extend(isolate);
144 // Update the current next field, set the value in the created 145 // Update the current next field, set the value in the created
145 // handle, and return the result. 146 // handle, and return the result.
146 DCHECK(cur < current->limit); 147 DCHECK(cur < current->limit);
147 current->next = cur + 1; 148 current->next = cur + 1;
148 149
149 T** result = reinterpret_cast<T**>(cur); 150 T** result = reinterpret_cast<T**>(cur);
150 *result = value; 151 *result = value;
(...skipping 23 matching lines...) Expand all
174 current->level = level_; 175 current->level = level_;
175 DCHECK_EQ(current->next, current->limit); 176 DCHECK_EQ(current->next, current->limit);
176 current->limit = limit_; 177 current->limit = limit_;
177 } 178 }
178 179
179 #endif 180 #endif
180 181
181 } } // namespace v8::internal 182 } } // namespace v8::internal
182 183
183 #endif // V8_HANDLES_INL_H_ 184 #endif // V8_HANDLES_INL_H_
OLDNEW
« src/api.cc ('K') | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698