OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 switch (instance_type) { | 81 switch (instance_type) { |
82 case MAP_TYPE: | 82 case MAP_TYPE: |
83 Map::cast(this)->MapVerify(); | 83 Map::cast(this)->MapVerify(); |
84 break; | 84 break; |
85 case HEAP_NUMBER_TYPE: | 85 case HEAP_NUMBER_TYPE: |
86 HeapNumber::cast(this)->HeapNumberVerify(); | 86 HeapNumber::cast(this)->HeapNumberVerify(); |
87 break; | 87 break; |
88 case FIXED_ARRAY_TYPE: | 88 case FIXED_ARRAY_TYPE: |
89 FixedArray::cast(this)->FixedArrayVerify(); | 89 FixedArray::cast(this)->FixedArrayVerify(); |
90 break; | 90 break; |
| 91 case FIXED_DOUBLE_ARRAY_TYPE: |
| 92 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); |
| 93 break; |
91 case BYTE_ARRAY_TYPE: | 94 case BYTE_ARRAY_TYPE: |
92 ByteArray::cast(this)->ByteArrayVerify(); | 95 ByteArray::cast(this)->ByteArrayVerify(); |
93 break; | 96 break; |
94 case EXTERNAL_PIXEL_ARRAY_TYPE: | 97 case EXTERNAL_PIXEL_ARRAY_TYPE: |
95 ExternalPixelArray::cast(this)->ExternalPixelArrayVerify(); | 98 ExternalPixelArray::cast(this)->ExternalPixelArrayVerify(); |
96 break; | 99 break; |
97 case EXTERNAL_BYTE_ARRAY_TYPE: | 100 case EXTERNAL_BYTE_ARRAY_TYPE: |
98 ExternalByteArray::cast(this)->ExternalByteArrayVerify(); | 101 ExternalByteArray::cast(this)->ExternalByteArrayVerify(); |
99 break; | 102 break; |
100 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: | 103 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 Object* e = get(i); | 303 Object* e = get(i); |
301 if (e->IsHeapObject()) { | 304 if (e->IsHeapObject()) { |
302 VerifyHeapPointer(e); | 305 VerifyHeapPointer(e); |
303 } else { | 306 } else { |
304 e->Verify(); | 307 e->Verify(); |
305 } | 308 } |
306 } | 309 } |
307 } | 310 } |
308 | 311 |
309 | 312 |
| 313 void FixedDoubleArray::FixedDoubleArrayVerify() { |
| 314 for (int i = 0; i < length(); i++) { |
| 315 if (!is_the_hole(i)) { |
| 316 double value = get(i); |
| 317 ASSERT(!isnan(value) || |
| 318 BitCast<uint64_t>(value) == kCanonicalNonHoleNanInt64); |
| 319 } |
| 320 } |
| 321 } |
| 322 |
| 323 |
310 void JSValue::JSValueVerify() { | 324 void JSValue::JSValueVerify() { |
311 Object* v = value(); | 325 Object* v = value(); |
312 if (v->IsHeapObject()) { | 326 if (v->IsHeapObject()) { |
313 VerifyHeapPointer(v); | 327 VerifyHeapPointer(v); |
314 } | 328 } |
315 } | 329 } |
316 | 330 |
317 | 331 |
318 void JSMessageObject::JSMessageObjectVerify() { | 332 void JSMessageObject::JSMessageObjectVerify() { |
319 CHECK(IsJSMessageObject()); | 333 CHECK(IsJSMessageObject()); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 CHECK(it.rinfo()->pc() != last_gc_pc); | 439 CHECK(it.rinfo()->pc() != last_gc_pc); |
426 last_gc_pc = it.rinfo()->pc(); | 440 last_gc_pc = it.rinfo()->pc(); |
427 } | 441 } |
428 } | 442 } |
429 } | 443 } |
430 | 444 |
431 | 445 |
432 void JSArray::JSArrayVerify() { | 446 void JSArray::JSArrayVerify() { |
433 JSObjectVerify(); | 447 JSObjectVerify(); |
434 ASSERT(length()->IsNumber() || length()->IsUndefined()); | 448 ASSERT(length()->IsNumber() || length()->IsUndefined()); |
435 ASSERT(elements()->IsUndefined() || elements()->IsFixedArray()); | 449 ASSERT(elements()->IsUndefined() || |
| 450 elements()->IsFixedArray() || |
| 451 elements()->IsFixedDoubleArray()); |
436 } | 452 } |
437 | 453 |
438 | 454 |
439 void JSRegExp::JSRegExpVerify() { | 455 void JSRegExp::JSRegExpVerify() { |
440 JSObjectVerify(); | 456 JSObjectVerify(); |
441 ASSERT(data()->IsUndefined() || data()->IsFixedArray()); | 457 ASSERT(data()->IsUndefined() || data()->IsFixedArray()); |
442 switch (TypeTag()) { | 458 switch (TypeTag()) { |
443 case JSRegExp::ATOM: { | 459 case JSRegExp::ATOM: { |
444 FixedArray* arr = FixedArray::cast(data()); | 460 FixedArray* arr = FixedArray::cast(data()); |
445 ASSERT(arr->get(JSRegExp::kAtomPatternIndex)->IsString()); | 461 ASSERT(arr->get(JSRegExp::kAtomPatternIndex)->IsString()); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 ASSERT(e->IsUndefined()); | 751 ASSERT(e->IsUndefined()); |
736 } | 752 } |
737 } | 753 } |
738 } | 754 } |
739 } | 755 } |
740 | 756 |
741 | 757 |
742 #endif // DEBUG | 758 #endif // DEBUG |
743 | 759 |
744 } } // namespace v8::internal | 760 } } // namespace v8::internal |
OLD | NEW |