| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 break; | 149 break; |
| 150 case JS_BUILTINS_OBJECT_TYPE: | 150 case JS_BUILTINS_OBJECT_TYPE: |
| 151 JSBuiltinsObject::cast(this)->JSBuiltinsObjectVerify(); | 151 JSBuiltinsObject::cast(this)->JSBuiltinsObjectVerify(); |
| 152 break; | 152 break; |
| 153 case JS_GLOBAL_PROPERTY_CELL_TYPE: | 153 case JS_GLOBAL_PROPERTY_CELL_TYPE: |
| 154 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellVerify(); | 154 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellVerify(); |
| 155 break; | 155 break; |
| 156 case JS_ARRAY_TYPE: | 156 case JS_ARRAY_TYPE: |
| 157 JSArray::cast(this)->JSArrayVerify(); | 157 JSArray::cast(this)->JSArrayVerify(); |
| 158 break; | 158 break; |
| 159 case JS_SET_TYPE: |
| 160 JSSet::cast(this)->JSSetVerify(); |
| 161 break; |
| 162 case JS_MAP_TYPE: |
| 163 JSMap::cast(this)->JSMapVerify(); |
| 164 break; |
| 159 case JS_WEAK_MAP_TYPE: | 165 case JS_WEAK_MAP_TYPE: |
| 160 JSWeakMap::cast(this)->JSWeakMapVerify(); | 166 JSWeakMap::cast(this)->JSWeakMapVerify(); |
| 161 break; | 167 break; |
| 162 case JS_REGEXP_TYPE: | 168 case JS_REGEXP_TYPE: |
| 163 JSRegExp::cast(this)->JSRegExpVerify(); | 169 JSRegExp::cast(this)->JSRegExpVerify(); |
| 164 break; | 170 break; |
| 165 case FILLER_TYPE: | 171 case FILLER_TYPE: |
| 166 break; | 172 break; |
| 167 case JS_PROXY_TYPE: | 173 case JS_PROXY_TYPE: |
| 168 JSProxy::cast(this)->JSProxyVerify(); | 174 JSProxy::cast(this)->JSProxyVerify(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 262 |
| 257 | 263 |
| 258 void ExternalDoubleArray::ExternalDoubleArrayVerify() { | 264 void ExternalDoubleArray::ExternalDoubleArrayVerify() { |
| 259 ASSERT(IsExternalDoubleArray()); | 265 ASSERT(IsExternalDoubleArray()); |
| 260 } | 266 } |
| 261 | 267 |
| 262 | 268 |
| 263 void JSObject::JSObjectVerify() { | 269 void JSObject::JSObjectVerify() { |
| 264 VerifyHeapPointer(properties()); | 270 VerifyHeapPointer(properties()); |
| 265 VerifyHeapPointer(elements()); | 271 VerifyHeapPointer(elements()); |
| 272 |
| 273 if (GetElementsKind() == NON_STRICT_ARGUMENTS_ELEMENTS) { |
| 274 ASSERT(this->elements()->IsFixedArray()); |
| 275 ASSERT(this->elements()->length() >= 2); |
| 276 } |
| 277 |
| 266 if (HasFastProperties()) { | 278 if (HasFastProperties()) { |
| 267 CHECK_EQ(map()->unused_property_fields(), | 279 CHECK_EQ(map()->unused_property_fields(), |
| 268 (map()->inobject_properties() + properties()->length() - | 280 (map()->inobject_properties() + properties()->length() - |
| 269 map()->NextFreePropertyIndex())); | 281 map()->NextFreePropertyIndex())); |
| 270 } | 282 } |
| 271 ASSERT_EQ((map()->has_fast_elements() || map()->has_fast_smi_only_elements()), | 283 ASSERT_EQ((map()->has_fast_elements() || map()->has_fast_smi_only_elements()), |
| 272 (elements()->map() == GetHeap()->fixed_array_map() || | 284 (elements()->map() == GetHeap()->fixed_array_map() || |
| 273 elements()->map() == GetHeap()->fixed_cow_array_map())); | 285 elements()->map() == GetHeap()->fixed_cow_array_map())); |
| 274 ASSERT(map()->has_fast_elements() == HasFastElements()); | 286 ASSERT(map()->has_fast_elements() == HasFastElements()); |
| 275 } | 287 } |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 | 499 |
| 488 void JSArray::JSArrayVerify() { | 500 void JSArray::JSArrayVerify() { |
| 489 JSObjectVerify(); | 501 JSObjectVerify(); |
| 490 ASSERT(length()->IsNumber() || length()->IsUndefined()); | 502 ASSERT(length()->IsNumber() || length()->IsUndefined()); |
| 491 ASSERT(elements()->IsUndefined() || | 503 ASSERT(elements()->IsUndefined() || |
| 492 elements()->IsFixedArray() || | 504 elements()->IsFixedArray() || |
| 493 elements()->IsFixedDoubleArray()); | 505 elements()->IsFixedDoubleArray()); |
| 494 } | 506 } |
| 495 | 507 |
| 496 | 508 |
| 509 void JSSet::JSSetVerify() { |
| 510 CHECK(IsJSSet()); |
| 511 JSObjectVerify(); |
| 512 VerifyHeapPointer(table()); |
| 513 ASSERT(table()->IsHashTable() || table()->IsUndefined()); |
| 514 } |
| 515 |
| 516 |
| 517 void JSMap::JSMapVerify() { |
| 518 CHECK(IsJSMap()); |
| 519 JSObjectVerify(); |
| 520 VerifyHeapPointer(table()); |
| 521 ASSERT(table()->IsHashTable() || table()->IsUndefined()); |
| 522 } |
| 523 |
| 524 |
| 497 void JSWeakMap::JSWeakMapVerify() { | 525 void JSWeakMap::JSWeakMapVerify() { |
| 498 CHECK(IsJSWeakMap()); | 526 CHECK(IsJSWeakMap()); |
| 499 JSObjectVerify(); | 527 JSObjectVerify(); |
| 500 VerifyHeapPointer(table()); | 528 VerifyHeapPointer(table()); |
| 501 ASSERT(table()->IsHashTable() || table()->IsUndefined()); | 529 ASSERT(table()->IsHashTable() || table()->IsUndefined()); |
| 502 } | 530 } |
| 503 | 531 |
| 504 | 532 |
| 505 void JSRegExp::JSRegExpVerify() { | 533 void JSRegExp::JSRegExpVerify() { |
| 506 JSObjectVerify(); | 534 JSObjectVerify(); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 ASSERT(e->IsUndefined()); | 847 ASSERT(e->IsUndefined()); |
| 820 } | 848 } |
| 821 } | 849 } |
| 822 } | 850 } |
| 823 } | 851 } |
| 824 | 852 |
| 825 | 853 |
| 826 #endif // DEBUG | 854 #endif // DEBUG |
| 827 | 855 |
| 828 } } // namespace v8::internal | 856 } } // namespace v8::internal |
| OLD | NEW |