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

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

Issue 1636013002: Replace HeapType with a non-templated FieldType class. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix tracing of generalizations Created 4 years, 11 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
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 FieldIndex index = FieldIndex::ForDescriptor(map(), i); 291 FieldIndex index = FieldIndex::ForDescriptor(map(), i);
292 if (IsUnboxedDoubleField(index)) { 292 if (IsUnboxedDoubleField(index)) {
293 DCHECK(r.IsDouble()); 293 DCHECK(r.IsDouble());
294 continue; 294 continue;
295 } 295 }
296 Object* value = RawFastPropertyAt(index); 296 Object* value = RawFastPropertyAt(index);
297 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber()); 297 if (r.IsDouble()) DCHECK(value->IsMutableHeapNumber());
298 if (value->IsUninitialized()) continue; 298 if (value->IsUninitialized()) continue;
299 if (r.IsSmi()) DCHECK(value->IsSmi()); 299 if (r.IsSmi()) DCHECK(value->IsSmi());
300 if (r.IsHeapObject()) DCHECK(value->IsHeapObject()); 300 if (r.IsHeapObject()) DCHECK(value->IsHeapObject());
301 HeapType* field_type = descriptors->GetFieldType(i); 301 FieldType* field_type = descriptors->GetFieldType(i);
302 bool type_is_none = field_type->Is(HeapType::None()); 302 bool type_is_none = field_type->IsNone();
303 bool type_is_any = HeapType::Any()->Is(field_type); 303 bool type_is_any = field_type->IsAny();
304 if (r.IsNone()) { 304 if (r.IsNone()) {
305 CHECK(type_is_none); 305 CHECK(type_is_none);
306 } else if (!type_is_any && !(type_is_none && r.IsHeapObject())) { 306 } else if (!type_is_any && !(type_is_none && r.IsHeapObject())) {
307 // If allocation folding is off then GC could happen during inner 307 // If allocation folding is off then GC could happen during inner
308 // object literal creation and we will end up having and undefined 308 // object literal creation and we will end up having and undefined
309 // value that does not match the field type. 309 // value that does not match the field type.
310 CHECK(!field_type->NowStable() || field_type->NowContains(value) || 310 CHECK(!field_type->NowStable() || field_type->NowContains(value) ||
311 (!FLAG_use_allocation_folding && value->IsUndefined())); 311 (!FLAG_use_allocation_folding && value->IsUndefined()));
312 } 312 }
313 } 313 }
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 1326
1327 // Both are done at the same time. 1327 // Both are done at the same time.
1328 CHECK_EQ(new_it.done(), old_it.done()); 1328 CHECK_EQ(new_it.done(), old_it.done());
1329 } 1329 }
1330 1330
1331 1331
1332 #endif // DEBUG 1332 #endif // DEBUG
1333 1333
1334 } // namespace internal 1334 } // namespace internal
1335 } // namespace v8 1335 } // namespace v8
OLDNEW
« src/ic/ic.cc ('K') | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698