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

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

Issue 637553002: Fix for assertion failures appeared after StoreTransitionStub implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/code-stubs-hydrogen.cc ('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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 void JSObject::JSObjectVerify() { 249 void JSObject::JSObjectVerify() {
250 VerifyHeapPointer(properties()); 250 VerifyHeapPointer(properties());
251 VerifyHeapPointer(elements()); 251 VerifyHeapPointer(elements());
252 252
253 if (GetElementsKind() == SLOPPY_ARGUMENTS_ELEMENTS) { 253 if (GetElementsKind() == SLOPPY_ARGUMENTS_ELEMENTS) {
254 CHECK(this->elements()->IsFixedArray()); 254 CHECK(this->elements()->IsFixedArray());
255 CHECK_GE(this->elements()->length(), 2); 255 CHECK_GE(this->elements()->length(), 2);
256 } 256 }
257 257
258 if (HasFastProperties()) { 258 if (HasFastProperties()) {
259 CHECK_EQ(map()->unused_property_fields(), 259 int actual_unused_property_fields = map()->inobject_properties() +
260 (map()->inobject_properties() + properties()->length() - 260 properties()->length() -
261 map()->NextFreePropertyIndex())); 261 map()->NextFreePropertyIndex();
262 if (map()->unused_property_fields() != actual_unused_property_fields) {
263 // This could actually happen in the middle of StoreTransitionStub
264 // when the new extended backing store is already set into the object and
265 // the allocation of the MutableHeapNumber triggers GC (in this case map
266 // is not updated yet).
267 CHECK_EQ(map()->unused_property_fields(),
268 actual_unused_property_fields - JSObject::kFieldsAdded);
269 }
262 DescriptorArray* descriptors = map()->instance_descriptors(); 270 DescriptorArray* descriptors = map()->instance_descriptors();
263 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { 271 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
264 if (descriptors->GetDetails(i).type() == FIELD) { 272 if (descriptors->GetDetails(i).type() == FIELD) {
265 Representation r = descriptors->GetDetails(i).representation(); 273 Representation r = descriptors->GetDetails(i).representation();
266 FieldIndex index = FieldIndex::ForDescriptor(map(), i); 274 FieldIndex index = FieldIndex::ForDescriptor(map(), i);
267 Object* value = RawFastPropertyAt(index); 275 Object* value = RawFastPropertyAt(index);
268 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber()); 276 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber());
269 if (value->IsUninitialized()) continue; 277 if (value->IsUninitialized()) continue;
270 if (r.IsSmi()) DCHECK(value->IsSmi()); 278 if (r.IsSmi()) DCHECK(value->IsSmi());
271 if (r.IsHeapObject()) DCHECK(value->IsHeapObject()); 279 if (r.IsHeapObject()) DCHECK(value->IsHeapObject());
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 for (int i = 0; i < number_of_transitions(); ++i) { 1204 for (int i = 0; i < number_of_transitions(); ++i) {
1197 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1205 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1198 } 1206 }
1199 return true; 1207 return true;
1200 } 1208 }
1201 1209
1202 1210
1203 #endif // DEBUG 1211 #endif // DEBUG
1204 1212
1205 } } // namespace v8::internal 1213 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698