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

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

Issue 690713003: Assert that unoptimized code does not embed context-specific objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: do not allow objects from builtins context Created 6 years, 1 month 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') | no next file » | 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/disasm.h" 7 #include "src/disasm.h"
8 #include "src/disassembler.h" 8 #include "src/disassembler.h"
9 #include "src/heap/objects-visiting.h" 9 #include "src/heap/objects-visiting.h"
10 #include "src/jsregexp.h" 10 #include "src/jsregexp.h"
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 1211
1212 1212
1213 bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) { 1213 bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) {
1214 for (int i = 0; i < number_of_transitions(); ++i) { 1214 for (int i = 0; i < number_of_transitions(); ++i) {
1215 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1215 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1216 } 1216 }
1217 return true; 1217 return true;
1218 } 1218 }
1219 1219
1220 1220
1221 void Code::VerifyEmbeddedObjectsInFullCode() {
1222 // Check that no context-specific object has been embedded.
1223 Heap* heap = GetIsolate()->heap();
1224 int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
1225 for (RelocIterator it(this, mask); !it.done(); it.next()) {
1226 Object* obj = it.rinfo()->target_object();
1227 if (obj->IsCell()) obj = Cell::cast(obj)->value();
1228 if (obj->IsPropertyCell()) obj = PropertyCell::cast(obj)->value();
1229 if (!obj->IsHeapObject()) continue;
1230 Map* map = obj->IsMap() ? Map::cast(obj) : HeapObject::cast(obj)->map();
1231 int i = 0;
1232 while (map != heap->roots_array_start()[i++]) {
1233 CHECK_LT(i, Heap::kStrongRootListLength);
1234 }
1235 }
1236 }
1237
1238
1221 #endif // DEBUG 1239 #endif // DEBUG
1222 1240
1223 } } // namespace v8::internal 1241 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698