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

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

Issue 1310463005: - Ensure that HandleScope is initialized with a thread. (Remove (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review comments Created 5 years, 3 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/debugger_api_impl.cc ('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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // { 294 // {
295 // HANDLESCOPE(thread); 295 // HANDLESCOPE(thread);
296 // .... 296 // ....
297 // ..... 297 // .....
298 // code that creates some scoped handles. 298 // code that creates some scoped handles.
299 // .... 299 // ....
300 // } 300 // }
301 class HandleScope : public StackResource { 301 class HandleScope : public StackResource {
302 public: 302 public:
303 explicit HandleScope(Thread* thread); 303 explicit HandleScope(Thread* thread);
304 // DEPRECATED: Use Thread version.
305 explicit HandleScope(Isolate* isolate);
306 ~HandleScope(); 304 ~HandleScope();
307 305
308 private: 306 private:
309 void Initialize(); 307 void Initialize();
310 308
311 VMHandles::HandlesBlock* saved_handle_block_; // Handle block at prev scope. 309 VMHandles::HandlesBlock* saved_handle_block_; // Handle block at prev scope.
312 uword saved_handle_slot_; // Next available handle slot at previous scope. 310 uword saved_handle_slot_; // Next available handle slot at previous scope.
313 #if defined(DEBUG) 311 #if defined(DEBUG)
314 HandleScope* link_; // Link to previous scope. 312 HandleScope* link_; // Link to previous scope.
315 #endif 313 #endif
(...skipping 14 matching lines...) Expand all
330 // NOHANDLESCOPE(thread); 328 // NOHANDLESCOPE(thread);
331 // .... 329 // ....
332 // ..... 330 // .....
333 // critical code that manipulates dart objects directly. 331 // critical code that manipulates dart objects directly.
334 // .... 332 // ....
335 // } 333 // }
336 #if defined(DEBUG) 334 #if defined(DEBUG)
337 class NoHandleScope : public StackResource { 335 class NoHandleScope : public StackResource {
338 public: 336 public:
339 explicit NoHandleScope(Thread* thread); 337 explicit NoHandleScope(Thread* thread);
340 // DEPRECATED: Use Thread version.
341 explicit NoHandleScope(Isolate* isolate);
342 NoHandleScope();
343 ~NoHandleScope(); 338 ~NoHandleScope();
344 339
345 private: 340 private:
346 DISALLOW_COPY_AND_ASSIGN(NoHandleScope); 341 DISALLOW_COPY_AND_ASSIGN(NoHandleScope);
347 }; 342 };
348 #else // defined(DEBUG) 343 #else // defined(DEBUG)
349 class NoHandleScope : public ValueObject { 344 class NoHandleScope : public ValueObject {
350 public: 345 public:
351 explicit NoHandleScope(Thread* thread) { } 346 explicit NoHandleScope(Thread* thread) { }
352 explicit NoHandleScope(Isolate* isolate) { } 347 explicit NoHandleScope(Isolate* isolate) { }
353 NoHandleScope() { } 348 NoHandleScope() { }
354 ~NoHandleScope() { } 349 ~NoHandleScope() { }
355 350
356 private: 351 private:
357 DISALLOW_COPY_AND_ASSIGN(NoHandleScope); 352 DISALLOW_COPY_AND_ASSIGN(NoHandleScope);
358 }; 353 };
359 #endif // defined(DEBUG) 354 #endif // defined(DEBUG)
360 355
361 // Macro to start a no handles scope in the code. 356 // Macro to start a no handles scope in the code.
362 #define NOHANDLESCOPE(isolate_or_thread) \ 357 #define NOHANDLESCOPE(isolate_or_thread) \
363 dart::NoHandleScope no_vm_internal_handles_scope_(isolate_or_thread); 358 dart::NoHandleScope no_vm_internal_handles_scope_(isolate_or_thread);
364 359
365 } // namespace dart 360 } // namespace dart
366 361
367 #endif // VM_HANDLES_H_ 362 #endif // VM_HANDLES_H_
OLDNEW
« no previous file with comments | « runtime/vm/debugger_api_impl.cc ('k') | runtime/vm/handles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698