Chromium Code Reviews| Index: runtime/vm/isolate_reload.cc |
| diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc |
| index 7a867d2d8e0b00ebf29c0429e6d56f49d846df0e..f18995c2ab00c2df2e23e4f9b411c93ce5bd6617 100644 |
| --- a/runtime/vm/isolate_reload.cc |
| +++ b/runtime/vm/isolate_reload.cc |
| @@ -190,17 +190,9 @@ IsolateReloadContext::IsolateReloadContext(Isolate* isolate, bool test_mode) |
| become_map_storage_(Array::null()), |
| saved_root_library_(Library::null()), |
| saved_libraries_(GrowableObjectArray::null()) { |
| - // Preallocate storage for maps. |
| - old_classes_set_storage_ = |
| - HashTables::New<UnorderedHashSet<ClassMapTraits> >(4); |
| - class_map_storage_ = |
| - HashTables::New<UnorderedHashMap<ClassMapTraits> >(4); |
| - old_libraries_set_storage_ = |
| - HashTables::New<UnorderedHashSet<LibraryMapTraits> >(4); |
| - library_map_storage_ = |
| - HashTables::New<UnorderedHashMap<LibraryMapTraits> >(4); |
| - become_map_storage_ = |
| - HashTables::New<UnorderedHashMap<BecomeMapTraits> >(4); |
| + // NOTE: DO NOT ALLOCATE ANY RAW OBJECTS HERE. The IsolateReloadContext is not |
| + // associated with the isolate yet and if a GC is triggered here the raw |
| + // objects will not be properly accounted for. |
| } |
| @@ -240,6 +232,18 @@ void IsolateReloadContext::StartReload() { |
| ASSERT(!root_lib.IsNull()); |
| const String& root_lib_url = String::Handle(root_lib.url()); |
|
siva
2016/07/12 16:23:15
Maybe add
ASSERT(isolate() == thread->isolate());
siva
2016/07/12 16:23:15
Maybe add ASSERT(isolate() == thread->isolate());
Cutch
2016/07/12 17:45:30
Done.
|
| + // Preallocate storage for maps. |
| + old_classes_set_storage_ = |
| + HashTables::New<UnorderedHashSet<ClassMapTraits> >(4); |
| + class_map_storage_ = |
| + HashTables::New<UnorderedHashMap<ClassMapTraits> >(4); |
| + old_libraries_set_storage_ = |
| + HashTables::New<UnorderedHashSet<LibraryMapTraits> >(4); |
| + library_map_storage_ = |
| + HashTables::New<UnorderedHashMap<LibraryMapTraits> >(4); |
| + become_map_storage_ = |
| + HashTables::New<UnorderedHashMap<BecomeMapTraits> >(4); |
| + |
| // Disable the background compiler while we are performing the reload. |
| BackgroundCompiler::Disable(); |