| OLD | NEW |
| 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/object.h" | 5 #include "vm/object.h" |
| 6 #include "vm/object_store.h" | 6 #include "vm/object_store.h" |
| 7 #include "vm/snapshot.h" | 7 #include "vm/snapshot.h" |
| 8 #include "vm/stub_code.h" | 8 #include "vm/stub_code.h" |
| 9 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
| 10 #include "vm/visitor.h" | 10 #include "vm/visitor.h" |
| (...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 if (kind == Snapshot::kFull) { | 1358 if (kind == Snapshot::kFull) { |
| 1359 context = reader->NewContext(num_vars); | 1359 context = reader->NewContext(num_vars); |
| 1360 } else { | 1360 } else { |
| 1361 context = Context::New(num_vars, HEAP_SPACE(kind)); | 1361 context = Context::New(num_vars, HEAP_SPACE(kind)); |
| 1362 } | 1362 } |
| 1363 reader->AddBackRef(object_id, &context, kIsDeserialized); | 1363 reader->AddBackRef(object_id, &context, kIsDeserialized); |
| 1364 | 1364 |
| 1365 // Set the object tags. | 1365 // Set the object tags. |
| 1366 context.set_tags(tags); | 1366 context.set_tags(tags); |
| 1367 | 1367 |
| 1368 // Set the isolate implicitly. | |
| 1369 context.set_isolate(reader->isolate()); | |
| 1370 | |
| 1371 // Set all the object fields. | 1368 // Set all the object fields. |
| 1372 // TODO(5411462): Need to assert No GC can happen here, even though | 1369 // TODO(5411462): Need to assert No GC can happen here, even though |
| 1373 // allocations may happen. | 1370 // allocations may happen. |
| 1374 intptr_t num_flds = (context.raw()->to(num_vars) - context.raw()->from()); | 1371 intptr_t num_flds = (context.raw()->to(num_vars) - context.raw()->from()); |
| 1375 for (intptr_t i = 0; i <= num_flds; i++) { | 1372 for (intptr_t i = 0; i <= num_flds; i++) { |
| 1376 (*reader->PassiveObjectHandle()) = reader->ReadObjectRef(); | 1373 (*reader->PassiveObjectHandle()) = reader->ReadObjectRef(); |
| 1377 context.StorePointer((context.raw()->from() + i), | 1374 context.StorePointer((context.raw()->from() + i), |
| 1378 reader->PassiveObjectHandle()->raw()); | 1375 reader->PassiveObjectHandle()->raw()); |
| 1379 } | 1376 } |
| 1380 | 1377 |
| (...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2885 // We do not allow objects with native fields in an isolate message. | 2882 // We do not allow objects with native fields in an isolate message. |
| 2886 writer->SetWriteException(Exceptions::kArgument, | 2883 writer->SetWriteException(Exceptions::kArgument, |
| 2887 "Illegal argument in isolate message" | 2884 "Illegal argument in isolate message" |
| 2888 " : (object is a UserTag)"); | 2885 " : (object is a UserTag)"); |
| 2889 } else { | 2886 } else { |
| 2890 UNREACHABLE(); | 2887 UNREACHABLE(); |
| 2891 } | 2888 } |
| 2892 } | 2889 } |
| 2893 | 2890 |
| 2894 } // namespace dart | 2891 } // namespace dart |
| OLD | NEW |