| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 // pointer may point to a one pointer filler map. | 268 // pointer may point to a one pointer filler map. |
| 269 return reinterpret_cast<Map*>(elements()) != | 269 return reinterpret_cast<Map*>(elements()) != |
| 270 GetHeap()->one_pointer_filler_map(); | 270 GetHeap()->one_pointer_filler_map(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 | 273 |
| 274 void JSObject::JSObjectVerify() { | 274 void JSObject::JSObjectVerify() { |
| 275 VerifyHeapPointer(properties()); | 275 VerifyHeapPointer(properties()); |
| 276 VerifyHeapPointer(elements()); | 276 VerifyHeapPointer(elements()); |
| 277 | 277 |
| 278 if (GetElementsKind() == NON_STRICT_ARGUMENTS_ELEMENTS) { | 278 if (GetElementsKind() == SLOPPY_ARGUMENTS_ELEMENTS) { |
| 279 CHECK(this->elements()->IsFixedArray()); | 279 CHECK(this->elements()->IsFixedArray()); |
| 280 CHECK_GE(this->elements()->length(), 2); | 280 CHECK_GE(this->elements()->length(), 2); |
| 281 } | 281 } |
| 282 | 282 |
| 283 if (HasFastProperties()) { | 283 if (HasFastProperties()) { |
| 284 CHECK_EQ(map()->unused_property_fields(), | 284 CHECK_EQ(map()->unused_property_fields(), |
| 285 (map()->inobject_properties() + properties()->length() - | 285 (map()->inobject_properties() + properties()->length() - |
| 286 map()->NextFreePropertyIndex())); | 286 map()->NextFreePropertyIndex())); |
| 287 DescriptorArray* descriptors = map()->instance_descriptors(); | 287 DescriptorArray* descriptors = map()->instance_descriptors(); |
| 288 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { | 288 for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 361 |
| 362 void PolymorphicCodeCache::PolymorphicCodeCacheVerify() { | 362 void PolymorphicCodeCache::PolymorphicCodeCacheVerify() { |
| 363 VerifyHeapPointer(cache()); | 363 VerifyHeapPointer(cache()); |
| 364 CHECK(cache()->IsUndefined() || cache()->IsPolymorphicCodeCacheHashTable()); | 364 CHECK(cache()->IsUndefined() || cache()->IsPolymorphicCodeCacheHashTable()); |
| 365 } | 365 } |
| 366 | 366 |
| 367 | 367 |
| 368 void TypeFeedbackInfo::TypeFeedbackInfoVerify() { | 368 void TypeFeedbackInfo::TypeFeedbackInfoVerify() { |
| 369 VerifyObjectField(kStorage1Offset); | 369 VerifyObjectField(kStorage1Offset); |
| 370 VerifyObjectField(kStorage2Offset); | 370 VerifyObjectField(kStorage2Offset); |
| 371 VerifyHeapPointer(feedback_vector()); | |
| 372 } | 371 } |
| 373 | 372 |
| 374 | 373 |
| 375 void AliasedArgumentsEntry::AliasedArgumentsEntryVerify() { | 374 void AliasedArgumentsEntry::AliasedArgumentsEntryVerify() { |
| 376 VerifySmiField(kAliasedContextSlot); | 375 VerifySmiField(kAliasedContextSlot); |
| 377 } | 376 } |
| 378 | 377 |
| 379 | 378 |
| 380 void FixedArray::FixedArrayVerify() { | 379 void FixedArray::FixedArrayVerify() { |
| 381 for (int i = 0; i < length(); i++) { | 380 for (int i = 0; i < length(); i++) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 397 (BitCast<uint64_t>(value) == | 396 (BitCast<uint64_t>(value) == |
| 398 BitCast<uint64_t>(canonical_not_the_hole_nan_as_double())) || | 397 BitCast<uint64_t>(canonical_not_the_hole_nan_as_double())) || |
| 399 ((BitCast<uint64_t>(value) & Double::kSignMask) != 0)); | 398 ((BitCast<uint64_t>(value) & Double::kSignMask) != 0)); |
| 400 } | 399 } |
| 401 } | 400 } |
| 402 } | 401 } |
| 403 | 402 |
| 404 | 403 |
| 405 void ConstantPoolArray::ConstantPoolArrayVerify() { | 404 void ConstantPoolArray::ConstantPoolArrayVerify() { |
| 406 CHECK(IsConstantPoolArray()); | 405 CHECK(IsConstantPoolArray()); |
| 406 for (int i = 0; i < count_of_code_ptr_entries(); i++) { |
| 407 Address code_entry = get_code_ptr_entry(first_code_ptr_index() + i); |
| 408 VerifyPointer(Code::GetCodeFromTargetAddress(code_entry)); |
| 409 } |
| 410 for (int i = 0; i < count_of_heap_ptr_entries(); i++) { |
| 411 VerifyObjectField(OffsetOfElementAt(first_heap_ptr_index() + i)); |
| 412 } |
| 407 } | 413 } |
| 408 | 414 |
| 409 | 415 |
| 410 void JSGeneratorObject::JSGeneratorObjectVerify() { | 416 void JSGeneratorObject::JSGeneratorObjectVerify() { |
| 411 // In an expression like "new g()", there can be a point where a generator | 417 // In an expression like "new g()", there can be a point where a generator |
| 412 // object is allocated but its fields are all undefined, as it hasn't yet been | 418 // object is allocated but its fields are all undefined, as it hasn't yet been |
| 413 // initialized by the generator. Hence these weak checks. | 419 // initialized by the generator. Hence these weak checks. |
| 414 VerifyObjectField(kFunctionOffset); | 420 VerifyObjectField(kFunctionOffset); |
| 415 VerifyObjectField(kContextOffset); | 421 VerifyObjectField(kContextOffset); |
| 416 VerifyObjectField(kReceiverOffset); | 422 VerifyObjectField(kReceiverOffset); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 next_function_link()->IsUndefined() || | 544 next_function_link()->IsUndefined() || |
| 539 next_function_link()->IsJSFunction()); | 545 next_function_link()->IsJSFunction()); |
| 540 } | 546 } |
| 541 | 547 |
| 542 | 548 |
| 543 void SharedFunctionInfo::SharedFunctionInfoVerify() { | 549 void SharedFunctionInfo::SharedFunctionInfoVerify() { |
| 544 CHECK(IsSharedFunctionInfo()); | 550 CHECK(IsSharedFunctionInfo()); |
| 545 VerifyObjectField(kNameOffset); | 551 VerifyObjectField(kNameOffset); |
| 546 VerifyObjectField(kCodeOffset); | 552 VerifyObjectField(kCodeOffset); |
| 547 VerifyObjectField(kOptimizedCodeMapOffset); | 553 VerifyObjectField(kOptimizedCodeMapOffset); |
| 554 VerifyObjectField(kFeedbackVectorOffset); |
| 548 VerifyObjectField(kScopeInfoOffset); | 555 VerifyObjectField(kScopeInfoOffset); |
| 549 VerifyObjectField(kInstanceClassNameOffset); | 556 VerifyObjectField(kInstanceClassNameOffset); |
| 550 VerifyObjectField(kFunctionDataOffset); | 557 VerifyObjectField(kFunctionDataOffset); |
| 551 VerifyObjectField(kScriptOffset); | 558 VerifyObjectField(kScriptOffset); |
| 552 VerifyObjectField(kDebugInfoOffset); | 559 VerifyObjectField(kDebugInfoOffset); |
| 553 } | 560 } |
| 554 | 561 |
| 555 | 562 |
| 556 void JSGlobalProxy::JSGlobalProxyVerify() { | 563 void JSGlobalProxy::JSGlobalProxyVerify() { |
| 557 CHECK(IsJSGlobalProxy()); | 564 CHECK(IsJSGlobalProxy()); |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 CHECK(!IsValid() || GetAllocationSite()->IsAllocationSite()); | 931 CHECK(!IsValid() || GetAllocationSite()->IsAllocationSite()); |
| 925 } | 932 } |
| 926 | 933 |
| 927 | 934 |
| 928 void Script::ScriptVerify() { | 935 void Script::ScriptVerify() { |
| 929 CHECK(IsScript()); | 936 CHECK(IsScript()); |
| 930 VerifyPointer(source()); | 937 VerifyPointer(source()); |
| 931 VerifyPointer(name()); | 938 VerifyPointer(name()); |
| 932 line_offset()->SmiVerify(); | 939 line_offset()->SmiVerify(); |
| 933 column_offset()->SmiVerify(); | 940 column_offset()->SmiVerify(); |
| 934 VerifyPointer(data()); | |
| 935 VerifyPointer(wrapper()); | 941 VerifyPointer(wrapper()); |
| 936 type()->SmiVerify(); | 942 type()->SmiVerify(); |
| 937 VerifyPointer(line_ends()); | 943 VerifyPointer(line_ends()); |
| 938 VerifyPointer(id()); | 944 VerifyPointer(id()); |
| 939 } | 945 } |
| 940 | 946 |
| 941 | 947 |
| 942 void JSFunctionResultCache::JSFunctionResultCacheVerify() { | 948 void JSFunctionResultCache::JSFunctionResultCacheVerify() { |
| 943 JSFunction::cast(get(kFactoryIndex))->Verify(); | 949 JSFunction::cast(get(kFactoryIndex))->Verify(); |
| 944 | 950 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 info->number_of_fast_used_elements_ += e->length(); | 1053 info->number_of_fast_used_elements_ += e->length(); |
| 1048 break; | 1054 break; |
| 1049 } | 1055 } |
| 1050 case DICTIONARY_ELEMENTS: { | 1056 case DICTIONARY_ELEMENTS: { |
| 1051 SeededNumberDictionary* dict = element_dictionary(); | 1057 SeededNumberDictionary* dict = element_dictionary(); |
| 1052 info->number_of_slow_used_elements_ += dict->NumberOfElements(); | 1058 info->number_of_slow_used_elements_ += dict->NumberOfElements(); |
| 1053 info->number_of_slow_unused_elements_ += | 1059 info->number_of_slow_unused_elements_ += |
| 1054 dict->Capacity() - dict->NumberOfElements(); | 1060 dict->Capacity() - dict->NumberOfElements(); |
| 1055 break; | 1061 break; |
| 1056 } | 1062 } |
| 1057 case NON_STRICT_ARGUMENTS_ELEMENTS: | 1063 case SLOPPY_ARGUMENTS_ELEMENTS: |
| 1058 break; | 1064 break; |
| 1059 } | 1065 } |
| 1060 } | 1066 } |
| 1061 | 1067 |
| 1062 | 1068 |
| 1063 void JSObject::SpillInformation::Clear() { | 1069 void JSObject::SpillInformation::Clear() { |
| 1064 number_of_objects_ = 0; | 1070 number_of_objects_ = 0; |
| 1065 number_of_objects_with_fast_properties_ = 0; | 1071 number_of_objects_with_fast_properties_ = 0; |
| 1066 number_of_objects_with_fast_elements_ = 0; | 1072 number_of_objects_with_fast_elements_ = 0; |
| 1067 number_of_fast_used_fields_ = 0; | 1073 number_of_fast_used_fields_ = 0; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 for (int i = 0; i < number_of_transitions(); ++i) { | 1157 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1152 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1158 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1153 } | 1159 } |
| 1154 return true; | 1160 return true; |
| 1155 } | 1161 } |
| 1156 | 1162 |
| 1157 | 1163 |
| 1158 #endif // DEBUG | 1164 #endif // DEBUG |
| 1159 | 1165 |
| 1160 } } // namespace v8::internal | 1166 } } // namespace v8::internal |
| OLD | NEW |