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

Side by Side Diff: runtime/vm/snapshot.cc

Issue 2509413002: An isolate created with spawn function doesn't necessarily agree with its parent on the library pri… (Closed)
Patch Set: . Created 4 years 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 | « no previous file | tests/isolate/isolate.status » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "vm/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 !IsObjectStoreClassId(SerializedHeaderData::decode(class_header))); 261 !IsObjectStoreClassId(SerializedHeaderData::decode(class_header)));
262 Class& cls = Class::ZoneHandle(zone(), Class::null()); 262 Class& cls = Class::ZoneHandle(zone(), Class::null());
263 AddBackRef(object_id, &cls, kIsDeserialized); 263 AddBackRef(object_id, &cls, kIsDeserialized);
264 // Read the library/class information and lookup the class. 264 // Read the library/class information and lookup the class.
265 str_ ^= ReadObjectImpl(class_header, kAsInlinedObject, kInvalidPatchIndex, 0); 265 str_ ^= ReadObjectImpl(class_header, kAsInlinedObject, kInvalidPatchIndex, 0);
266 library_ = Library::LookupLibrary(thread(), str_); 266 library_ = Library::LookupLibrary(thread(), str_);
267 if (library_.IsNull() || !library_.Loaded()) { 267 if (library_.IsNull() || !library_.Loaded()) {
268 SetReadException("Invalid object found in message."); 268 SetReadException("Invalid object found in message.");
269 } 269 }
270 str_ ^= ReadObjectImpl(kAsInlinedObject); 270 str_ ^= ReadObjectImpl(kAsInlinedObject);
271 cls = library_.LookupClass(str_); 271 cls = library_.LookupClassAllowPrivate(str_);
272 if (cls.IsNull()) { 272 if (cls.IsNull()) {
273 SetReadException("Invalid object found in message."); 273 SetReadException("Invalid object found in message.");
274 } 274 }
275 cls.EnsureIsFinalized(thread()); 275 cls.EnsureIsFinalized(thread());
276 return cls.raw(); 276 return cls.raw();
277 } 277 }
278 278
279 279
280 RawFunction* SnapshotReader::ReadFunctionId(intptr_t object_id) { 280 RawFunction* SnapshotReader::ReadFunctionId(intptr_t object_id) {
281 ASSERT(kind_ == Snapshot::kScript); 281 ASSERT(kind_ == Snapshot::kScript);
(...skipping 10 matching lines...) Expand all
292 str_ ^= ReadObjectImpl(func_header, kAsInlinedObject, kInvalidPatchIndex, 0); 292 str_ ^= ReadObjectImpl(func_header, kAsInlinedObject, kInvalidPatchIndex, 0);
293 library_ = Library::LookupLibrary(thread(), str_); 293 library_ = Library::LookupLibrary(thread(), str_);
294 if (library_.IsNull() || !library_.Loaded()) { 294 if (library_.IsNull() || !library_.Loaded()) {
295 SetReadException("Expected a library name, but found an invalid name."); 295 SetReadException("Expected a library name, but found an invalid name.");
296 } 296 }
297 str_ ^= ReadObjectImpl(kAsInlinedObject); 297 str_ ^= ReadObjectImpl(kAsInlinedObject);
298 if (str_.Equals(Symbols::TopLevel(), 0, Symbols::TopLevel().Length())) { 298 if (str_.Equals(Symbols::TopLevel(), 0, Symbols::TopLevel().Length())) {
299 str_ ^= ReadObjectImpl(kAsInlinedObject); 299 str_ ^= ReadObjectImpl(kAsInlinedObject);
300 func ^= library_.LookupLocalFunction(str_); 300 func ^= library_.LookupLocalFunction(str_);
301 } else { 301 } else {
302 cls_ = library_.LookupClass(str_); 302 cls_ = library_.LookupClassAllowPrivate(str_);
303 if (cls_.IsNull()) { 303 if (cls_.IsNull()) {
304 SetReadException("Expected a class name, but found an invalid name."); 304 SetReadException("Expected a class name, but found an invalid name.");
305 } 305 }
306 cls_.EnsureIsFinalized(thread()); 306 cls_.EnsureIsFinalized(thread());
307 str_ ^= ReadObjectImpl(kAsInlinedObject); 307 str_ ^= ReadObjectImpl(kAsInlinedObject);
308 func ^= cls_.LookupFunctionAllowPrivate(str_); 308 func ^= cls_.LookupFunctionAllowPrivate(str_);
309 } 309 }
310 if (func.IsNull()) { 310 if (func.IsNull()) {
311 SetReadException("Expected a function name, but found an invalid name."); 311 SetReadException("Expected a function name, but found an invalid name.");
312 } 312 }
(...skipping 1643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 if (setjmp(*jump.Set()) == 0) { 1956 if (setjmp(*jump.Set()) == 0) {
1957 NoSafepointScope no_safepoint; 1957 NoSafepointScope no_safepoint;
1958 WriteObject(obj.raw()); 1958 WriteObject(obj.raw());
1959 } else { 1959 } else {
1960 ThrowException(exception_type(), exception_msg()); 1960 ThrowException(exception_type(), exception_msg());
1961 } 1961 }
1962 } 1962 }
1963 1963
1964 1964
1965 } // namespace dart 1965 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/isolate/isolate.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698