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

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

Issue 1522413002: [field type tracking] Fix handling of cleared WeakCells. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years 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
« no previous file with comments | « src/objects.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/objects.h" 5 #include "src/objects.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/disasm.h" 8 #include "src/disasm.h"
9 #include "src/disassembler.h" 9 #include "src/disassembler.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber()); 294 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber());
295 if (value->IsUninitialized()) continue; 295 if (value->IsUninitialized()) continue;
296 if (r.IsSmi()) DCHECK(value->IsSmi()); 296 if (r.IsSmi()) DCHECK(value->IsSmi());
297 if (r.IsHeapObject()) DCHECK(value->IsHeapObject()); 297 if (r.IsHeapObject()) DCHECK(value->IsHeapObject());
298 HeapType* field_type = descriptors->GetFieldType(i); 298 HeapType* field_type = descriptors->GetFieldType(i);
299 bool type_is_none = field_type->Is(HeapType::None()); 299 bool type_is_none = field_type->Is(HeapType::None());
300 bool type_is_any = HeapType::Any()->Is(field_type); 300 bool type_is_any = HeapType::Any()->Is(field_type);
301 if (r.IsNone()) { 301 if (r.IsNone()) {
302 CHECK(type_is_none); 302 CHECK(type_is_none);
303 } else if (!type_is_any && !(type_is_none && r.IsHeapObject())) { 303 } else if (!type_is_any && !(type_is_none && r.IsHeapObject())) {
304 CHECK(!field_type->NowStable() || field_type->NowContains(value)); 304 // If allocation folding is off then GC could happen during inner
305 // object literal creation and we will end up having and undefined
306 // value that does not match the field type.
307 CHECK(!field_type->NowStable() || field_type->NowContains(value) ||
308 (!FLAG_use_allocation_folding && value->IsUndefined()));
305 } 309 }
306 } 310 }
307 } 311 }
308 } 312 }
309 313
310 // If a GC was caused while constructing this object, the elements 314 // If a GC was caused while constructing this object, the elements
311 // pointer may point to a one pointer filler map. 315 // pointer may point to a one pointer filler map.
312 if (ElementsAreSafeToExamine()) { 316 if (ElementsAreSafeToExamine()) {
313 CHECK_EQ((map()->has_fast_smi_or_object_elements() || 317 CHECK_EQ((map()->has_fast_smi_or_object_elements() ||
314 (elements() == GetHeap()->empty_fixed_array())), 318 (elements() == GetHeap()->empty_fixed_array())),
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 1308
1305 // Both are done at the same time. 1309 // Both are done at the same time.
1306 CHECK_EQ(new_it.done(), old_it.done()); 1310 CHECK_EQ(new_it.done(), old_it.done());
1307 } 1311 }
1308 1312
1309 1313
1310 #endif // DEBUG 1314 #endif // DEBUG
1311 1315
1312 } // namespace internal 1316 } // namespace internal
1313 } // namespace v8 1317 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698