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

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

Issue 157053007: - Zap the allocated object when allocating uninitialized memory in debug. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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/bigint_operations.h" 5 #include "vm/bigint_operations.h"
6 #include "vm/object.h" 6 #include "vm/object.h"
7 #include "vm/object_store.h" 7 #include "vm/object_store.h"
8 #include "vm/snapshot.h" 8 #include "vm/snapshot.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 446
447 TypeArguments& type_arguments = TypeArguments::ZoneHandle( 447 TypeArguments& type_arguments = TypeArguments::ZoneHandle(
448 reader->isolate(), NEW_OBJECT_WITH_LEN_SPACE(TypeArguments, len, kind)); 448 reader->isolate(), NEW_OBJECT_WITH_LEN_SPACE(TypeArguments, len, kind));
449 reader->AddBackRef(object_id, &type_arguments, kIsDeserialized); 449 reader->AddBackRef(object_id, &type_arguments, kIsDeserialized);
450 450
451 // Now set all the object fields. 451 // Now set all the object fields.
452 *reader->ArrayHandle() ^= reader->ReadObjectImpl(); 452 *reader->ArrayHandle() ^= reader->ReadObjectImpl();
453 type_arguments.set_instantiations(*reader->ArrayHandle()); 453 type_arguments.set_instantiations(*reader->ArrayHandle());
454 for (intptr_t i = 0; i < len; i++) { 454 for (intptr_t i = 0; i < len; i++) {
455 *reader->TypeHandle() ^= reader->ReadObjectImpl(); 455 *reader->TypeHandle() ^= reader->ReadObjectImpl();
456 type_arguments.SetTypeAt(i, *reader->TypeHandle()); 456 type_arguments.set_type_at(i, *reader->TypeHandle());
457 } 457 }
458 458
459 // If object needs to be a canonical object, Canonicalize it. 459 // If object needs to be a canonical object, Canonicalize it.
460 // When reading a full snapshot we don't need to canonicalize the object 460 // When reading a full snapshot we don't need to canonicalize the object
461 // as it would already be a canonical object. 461 // as it would already be a canonical object.
462 // When reading a script snapshot we need to canonicalize only those object 462 // When reading a script snapshot we need to canonicalize only those object
463 // references that are objects from the core library (loaded from a 463 // references that are objects from the core library (loaded from a
464 // full snapshot). Objects that are only in the script need not be 464 // full snapshot). Objects that are only in the script need not be
465 // canonicalized as they are already canonical. 465 // canonicalized as they are already canonical.
466 // When reading a message snapshot we always have to canonicalize the object. 466 // When reading a message snapshot we always have to canonicalize the object.
(...skipping 2200 matching lines...) Expand 10 before | Expand all | Expand 10 after
2667 // We do not allow objects with native fields in an isolate message. 2667 // We do not allow objects with native fields in an isolate message.
2668 writer->SetWriteException(Exceptions::kArgument, 2668 writer->SetWriteException(Exceptions::kArgument,
2669 "Illegal argument in isolate message" 2669 "Illegal argument in isolate message"
2670 " : (object is a MirrorReference)"); 2670 " : (object is a MirrorReference)");
2671 } else { 2671 } else {
2672 UNREACHABLE(); 2672 UNREACHABLE();
2673 } 2673 }
2674 } 2674 }
2675 2675
2676 } // namespace dart 2676 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/snapshot.cc » ('j') | runtime/vm/snapshot.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698