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

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

Issue 1018283002: Reland "Fix memory leak caused by field type in descriptor array." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 9 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
« no previous file with comments | « src/objects.cc ('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 // 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 if (IsUnboxedDoubleField(index)) { 282 if (IsUnboxedDoubleField(index)) {
283 DCHECK(r.IsDouble()); 283 DCHECK(r.IsDouble());
284 continue; 284 continue;
285 } 285 }
286 Object* value = RawFastPropertyAt(index); 286 Object* value = RawFastPropertyAt(index);
287 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber()); 287 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber());
288 if (value->IsUninitialized()) continue; 288 if (value->IsUninitialized()) continue;
289 if (r.IsSmi()) DCHECK(value->IsSmi()); 289 if (r.IsSmi()) DCHECK(value->IsSmi());
290 if (r.IsHeapObject()) DCHECK(value->IsHeapObject()); 290 if (r.IsHeapObject()) DCHECK(value->IsHeapObject());
291 HeapType* field_type = descriptors->GetFieldType(i); 291 HeapType* field_type = descriptors->GetFieldType(i);
292 bool type_is_none = field_type->Is(HeapType::None());
293 bool type_is_any = field_type->Is(HeapType::Any());
Jakob Kummerow 2015/04/11 12:00:58 Shouldn't this be the other way round, i.e. HeapTy
292 if (r.IsNone()) { 294 if (r.IsNone()) {
293 CHECK(field_type->Is(HeapType::None())); 295 CHECK(type_is_none);
294 } else if (!HeapType::Any()->Is(field_type)) { 296 } else if (!type_is_any && !(type_is_none && r.IsHeapObject())) {
295 CHECK(!field_type->NowStable() || field_type->NowContains(value)); 297 CHECK(!field_type->NowStable() || field_type->NowContains(value));
296 } 298 }
297 } 299 }
298 } 300 }
299 } 301 }
300 302
301 // If a GC was caused while constructing this object, the elements 303 // If a GC was caused while constructing this object, the elements
302 // pointer may point to a one pointer filler map. 304 // pointer may point to a one pointer filler map.
303 if (ElementsAreSafeToExamine()) { 305 if (ElementsAreSafeToExamine()) {
304 CHECK_EQ((map()->has_fast_smi_or_object_elements() || 306 CHECK_EQ((map()->has_fast_smi_or_object_elements() ||
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 ? it.rinfo()->target_cell() 1271 ? it.rinfo()->target_cell()
1270 : it.rinfo()->target_object(); 1272 : it.rinfo()->target_object();
1271 CHECK(!CanLeak(target, heap, skip_weak_cell)); 1273 CHECK(!CanLeak(target, heap, skip_weak_cell));
1272 } 1274 }
1273 } 1275 }
1274 1276
1275 1277
1276 #endif // DEBUG 1278 #endif // DEBUG
1277 1279
1278 } } // namespace v8::internal 1280 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698