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

Side by Side Diff: runtime/vm/handles.h

Issue 1191443008: Assert no VM handles are created in the zone that belongs to a ApiNativeScopes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Descrease scopes, ASSERT on handle allocation Created 5 years, 6 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 | « runtime/vm/dart_api_state.h ('k') | runtime/vm/handles.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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_HANDLES_H_ 5 #ifndef VM_HANDLES_H_
6 #define VM_HANDLES_H_ 6 #define VM_HANDLES_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/os.h" 10 #include "vm/os.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // Allocates a handle in 'zone', which must be the current zone. This handle 276 // Allocates a handle in 'zone', which must be the current zone. This handle
277 // will be destroyed when the current zone is destroyed. 277 // will be destroyed when the current zone is destroyed.
278 static uword AllocateZoneHandle(Zone* zone); 278 static uword AllocateZoneHandle(Zone* zone);
279 279
280 // Returns true if specified handle is a zone handle. 280 // Returns true if specified handle is a zone handle.
281 static bool IsZoneHandle(uword handle); 281 static bool IsZoneHandle(uword handle);
282 282
283 // Returns number of handles, these functions are used for testing purposes. 283 // Returns number of handles, these functions are used for testing purposes.
284 static int ScopedHandleCount(); 284 static int ScopedHandleCount();
285 static int ZoneHandleCount(); 285 static int ZoneHandleCount();
286
287 friend class ApiZone;
288 friend class ApiNativeScope;
286 }; 289 };
287 290
288 291
289 // The class HandleScope is used to start a new handles scope in the code. 292 // The class HandleScope is used to start a new handles scope in the code.
290 // It is used as follows: 293 // It is used as follows:
291 // { 294 // {
292 // HANDLESCOPE(isolate); 295 // HANDLESCOPE(isolate);
293 // .... 296 // ....
294 // ..... 297 // .....
295 // code that creates some scoped handles. 298 // code that creates some scoped handles.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 }; 351 };
349 #endif // defined(DEBUG) 352 #endif // defined(DEBUG)
350 353
351 // Macro to start a no handles scope in the code. 354 // Macro to start a no handles scope in the code.
352 #define NOHANDLESCOPE(isolate) \ 355 #define NOHANDLESCOPE(isolate) \
353 dart::NoHandleScope no_vm_internal_handles_scope_(isolate); 356 dart::NoHandleScope no_vm_internal_handles_scope_(isolate);
354 357
355 } // namespace dart 358 } // namespace dart
356 359
357 #endif // VM_HANDLES_H_ 360 #endif // VM_HANDLES_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | runtime/vm/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698