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

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

Issue 360023003: Revert "Replace HeapNumber as doublebox with an explicit MutableHeapNumber." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/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/jsregexp.h" 9 #include "src/jsregexp.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 switch (instance_type) { 49 switch (instance_type) {
50 case SYMBOL_TYPE: 50 case SYMBOL_TYPE:
51 Symbol::cast(this)->SymbolVerify(); 51 Symbol::cast(this)->SymbolVerify();
52 break; 52 break;
53 case MAP_TYPE: 53 case MAP_TYPE:
54 Map::cast(this)->MapVerify(); 54 Map::cast(this)->MapVerify();
55 break; 55 break;
56 case HEAP_NUMBER_TYPE: 56 case HEAP_NUMBER_TYPE:
57 case MUTABLE_HEAP_NUMBER_TYPE:
58 HeapNumber::cast(this)->HeapNumberVerify(); 57 HeapNumber::cast(this)->HeapNumberVerify();
59 break; 58 break;
60 case FIXED_ARRAY_TYPE: 59 case FIXED_ARRAY_TYPE:
61 FixedArray::cast(this)->FixedArrayVerify(); 60 FixedArray::cast(this)->FixedArrayVerify();
62 break; 61 break;
63 case FIXED_DOUBLE_ARRAY_TYPE: 62 case FIXED_DOUBLE_ARRAY_TYPE:
64 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); 63 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify();
65 break; 64 break;
66 case CONSTANT_POOL_ARRAY_TYPE: 65 case CONSTANT_POOL_ARRAY_TYPE:
67 ConstantPoolArray::cast(this)->ConstantPoolArrayVerify(); 66 ConstantPoolArray::cast(this)->ConstantPoolArrayVerify();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 void Symbol::SymbolVerify() { 198 void Symbol::SymbolVerify() {
200 CHECK(IsSymbol()); 199 CHECK(IsSymbol());
201 CHECK(HasHashCode()); 200 CHECK(HasHashCode());
202 CHECK_GT(Hash(), 0); 201 CHECK_GT(Hash(), 0);
203 CHECK(name()->IsUndefined() || name()->IsString()); 202 CHECK(name()->IsUndefined() || name()->IsString());
204 CHECK(flags()->IsSmi()); 203 CHECK(flags()->IsSmi());
205 } 204 }
206 205
207 206
208 void HeapNumber::HeapNumberVerify() { 207 void HeapNumber::HeapNumberVerify() {
209 CHECK(IsHeapNumber() || IsMutableHeapNumber()); 208 CHECK(IsHeapNumber());
210 } 209 }
211 210
212 211
213 void ByteArray::ByteArrayVerify() { 212 void ByteArray::ByteArrayVerify() {
214 CHECK(IsByteArray()); 213 CHECK(IsByteArray());
215 } 214 }
216 215
217 216
218 void FreeSpace::FreeSpaceVerify() { 217 void FreeSpace::FreeSpaceVerify() {
219 CHECK(IsFreeSpace()); 218 CHECK(IsFreeSpace());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (HasFastProperties()) { 256 if (HasFastProperties()) {
258 CHECK_EQ(map()->unused_property_fields(), 257 CHECK_EQ(map()->unused_property_fields(),
259 (map()->inobject_properties() + properties()->length() - 258 (map()->inobject_properties() + properties()->length() -
260 map()->NextFreePropertyIndex())); 259 map()->NextFreePropertyIndex()));
261 DescriptorArray* descriptors = map()->instance_descriptors(); 260 DescriptorArray* descriptors = map()->instance_descriptors();
262 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { 261 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
263 if (descriptors->GetDetails(i).type() == FIELD) { 262 if (descriptors->GetDetails(i).type() == FIELD) {
264 Representation r = descriptors->GetDetails(i).representation(); 263 Representation r = descriptors->GetDetails(i).representation();
265 FieldIndex index = FieldIndex::ForDescriptor(map(), i); 264 FieldIndex index = FieldIndex::ForDescriptor(map(), i);
266 Object* value = RawFastPropertyAt(index); 265 Object* value = RawFastPropertyAt(index);
267 if (r.IsDouble()) ASSERT(value->IsMutableHeapNumber()); 266 if (r.IsDouble()) ASSERT(value->IsHeapNumber());
268 if (value->IsUninitialized()) continue; 267 if (value->IsUninitialized()) continue;
269 if (r.IsSmi()) ASSERT(value->IsSmi()); 268 if (r.IsSmi()) ASSERT(value->IsSmi());
270 if (r.IsHeapObject()) ASSERT(value->IsHeapObject()); 269 if (r.IsHeapObject()) ASSERT(value->IsHeapObject());
271 HeapType* field_type = descriptors->GetFieldType(i); 270 HeapType* field_type = descriptors->GetFieldType(i);
272 if (r.IsNone()) { 271 if (r.IsNone()) {
273 CHECK(field_type->Is(HeapType::None())); 272 CHECK(field_type->Is(HeapType::None()));
274 } else if (!HeapType::Any()->Is(field_type)) { 273 } else if (!HeapType::Any()->Is(field_type)) {
275 CHECK(!field_type->NowStable() || field_type->NowContains(value)); 274 CHECK(!field_type->NowStable() || field_type->NowContains(value));
276 } 275 }
277 } 276 }
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 for (int i = 0; i < number_of_transitions(); ++i) { 1185 for (int i = 0; i < number_of_transitions(); ++i) {
1187 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1186 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1188 } 1187 }
1189 return true; 1188 return true;
1190 } 1189 }
1191 1190
1192 1191
1193 #endif // DEBUG 1192 #endif // DEBUG
1194 1193
1195 } } // namespace v8::internal 1194 } } // 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