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

Side by Side Diff: src/objects-debug.cc

Issue 10383186: Add zapping of Map contents in debug mode. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 7 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
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 if (e->IsMap()) { 985 if (e->IsMap()) {
986 Map::cast(e)->SharedMapVerify(); 986 Map::cast(e)->SharedMapVerify();
987 } else { 987 } else {
988 ASSERT(e->IsUndefined()); 988 ASSERT(e->IsUndefined());
989 } 989 }
990 } 990 }
991 } 991 }
992 } 992 }
993 993
994 994
995 void Map::ZapInstanceDescriptors() {
996 DescriptorArray* descriptors = instance_descriptors();
997 if (descriptors == GetHeap()->empty_descriptor_array()) return;
998 FixedArray* contents = FixedArray::cast(
999 descriptors->get(DescriptorArray::kContentArrayIndex));
1000 MemsetPointer(descriptors->data_start(),
1001 GetHeap()->the_hole_value(),
1002 descriptors->length());
1003 MemsetPointer(contents->data_start(),
1004 GetHeap()->the_hole_value(),
1005 contents->length());
1006 }
1007
1008
1009 void Map::ZapPrototypeTransitions() {
1010 FixedArray* proto_transitions = prototype_transitions();
1011 MemsetPointer(proto_transitions->data_start(),
1012 GetHeap()->the_hole_value(),
1013 proto_transitions->length());
1014 }
1015
1016
995 #endif // DEBUG 1017 #endif // DEBUG
996 1018
997 } } // namespace v8::internal 1019 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698