Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
dart::ProgramReloadContext Class Reference

#include <isolate_reload.h>

Public Member Functions

 ProgramReloadContext (std::shared_ptr< IsolateGroupReloadContext > group_reload_context, IsolateGroup *isolate_group)
 
 ~ProgramReloadContext ()
 
Zonezone () const
 
IsolateGroupReloadContextgroup_reload_context ()
 

Static Public Member Functions

static bool IsSameLibrary (const Library &a_lib, const Library &b_lib)
 
static bool IsSameClass (const Class &a, const Class &b)
 

Friends

class Isolate
 
class IsolateGroup
 
class Class
 
class Library
 
class ObjectLocator
 
class ReasonForCancelling
 
class IsolateGroupReloadContext
 

Detailed Description

Definition at line 291 of file isolate_reload.h.

Constructor & Destructor Documentation

◆ ProgramReloadContext()

dart::ProgramReloadContext::ProgramReloadContext ( std::shared_ptr< IsolateGroupReloadContext group_reload_context,
IsolateGroup isolate_group 
)

Definition at line 564 of file isolate_reload.cc.

567 : zone_(Thread::Current()->zone()),
568 group_reload_context_(group_reload_context),
569 isolate_group_(isolate_group),
570 old_classes_set_storage_(Array::null()),
571 class_map_storage_(Array::null()),
572 removed_class_set_storage_(Array::null()),
573 old_libraries_set_storage_(Array::null()),
574 library_map_storage_(Array::null()),
575 saved_root_library_(Library::null()),
576 saved_libraries_(GrowableObjectArray::null()) {
577 // NOTE: DO NOT ALLOCATE ANY RAW OBJECTS HERE. The ProgramReloadContext is not
578 // associated with the isolate yet and if a GC is triggered here the raw
579 // objects will not be properly accounted for.
580 ASSERT(zone_ != nullptr);
581}
static ObjectPtr null()
Definition: object.h:433
IsolateGroupReloadContext * group_reload_context()
static Thread * Current()
Definition: thread.h:362
#define ASSERT(E)

◆ ~ProgramReloadContext()

dart::ProgramReloadContext::~ProgramReloadContext ( )

Definition at line 583 of file isolate_reload.cc.

583 {
584 ASSERT(zone_ == Thread::Current()->zone());
585 ASSERT(IG->class_table() == IG->heap_walk_class_table());
586}
#define IG

Member Function Documentation

◆ group_reload_context()

IsolateGroupReloadContext * dart::ProgramReloadContext::group_reload_context ( )
inline

Definition at line 301 of file isolate_reload.h.

301 {
302 return group_reload_context_.get();
303 }

◆ IsSameClass()

bool dart::ProgramReloadContext::IsSameClass ( const Class a,
const Class b 
)
static

Definition at line 517 of file isolate_reload.cc.

517 {
518 // TODO(turnidge): We need to look at generic type arguments for
519 // synthetic mixin classes. Their names are not necessarily unique
520 // currently.
521 const String& a_name = String::Handle(a.Name());
522 const String& b_name = String::Handle(b.Name());
523
524 if (!a_name.Equals(b_name)) {
525 return false;
526 }
527
528 const Library& a_lib = Library::Handle(a.library());
529 const Library& b_lib = Library::Handle(b.library());
530
531 if (a_lib.IsNull() || b_lib.IsNull()) {
532 return a_lib.ptr() == b_lib.ptr();
533 }
534 return (a_lib.private_key() == b_lib.private_key());
535}
static Object & Handle()
Definition: object.h:407
static bool b
struct MyStruct a[10]

◆ IsSameLibrary()

bool dart::ProgramReloadContext::IsSameLibrary ( const Library a_lib,
const Library b_lib 
)
static

Definition at line 537 of file isolate_reload.cc.

538 {
539 const String& a_lib_url =
540 String::Handle(a_lib.IsNull() ? String::null() : a_lib.url());
541 const String& b_lib_url =
542 String::Handle(b_lib.IsNull() ? String::null() : b_lib.url());
543 return a_lib_url.Equals(b_lib_url);
544}

◆ zone()

Zone * dart::ProgramReloadContext::zone ( ) const
inline

Definition at line 299 of file isolate_reload.h.

299{ return zone_; }

Friends And Related Function Documentation

◆ Class

friend class Class
friend

Definition at line 403 of file isolate_reload.h.

◆ Isolate

friend class Isolate
friend

Definition at line 401 of file isolate_reload.h.

◆ IsolateGroup

friend class IsolateGroup
friend

Definition at line 402 of file isolate_reload.h.

◆ IsolateGroupReloadContext

friend class IsolateGroupReloadContext
friend

Definition at line 407 of file isolate_reload.h.

◆ Library

friend class Library
friend

Definition at line 404 of file isolate_reload.h.

◆ ObjectLocator

friend class ObjectLocator
friend

Definition at line 405 of file isolate_reload.h.

◆ ReasonForCancelling

friend class ReasonForCancelling
friend

Definition at line 406 of file isolate_reload.h.


The documentation for this class was generated from the following files: