| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 break; | 200 break; |
| 201 case JS_MESSAGE_OBJECT_TYPE: | 201 case JS_MESSAGE_OBJECT_TYPE: |
| 202 JSMessageObject::cast(this)->JSMessageObjectVerify(); | 202 JSMessageObject::cast(this)->JSMessageObjectVerify(); |
| 203 break; | 203 break; |
| 204 case JS_ARRAY_BUFFER_TYPE: | 204 case JS_ARRAY_BUFFER_TYPE: |
| 205 JSArrayBuffer::cast(this)->JSArrayBufferVerify(); | 205 JSArrayBuffer::cast(this)->JSArrayBufferVerify(); |
| 206 break; | 206 break; |
| 207 case JS_TYPED_ARRAY_TYPE: | 207 case JS_TYPED_ARRAY_TYPE: |
| 208 JSTypedArray::cast(this)->JSTypedArrayVerify(); | 208 JSTypedArray::cast(this)->JSTypedArrayVerify(); |
| 209 break; | 209 break; |
| 210 case JS_DATA_VIEW_TYPE: |
| 211 JSDataView::cast(this)->JSDataViewVerify(); |
| 212 break; |
| 210 | 213 |
| 211 #define MAKE_STRUCT_CASE(NAME, Name, name) \ | 214 #define MAKE_STRUCT_CASE(NAME, Name, name) \ |
| 212 case NAME##_TYPE: \ | 215 case NAME##_TYPE: \ |
| 213 Name::cast(this)->Name##Verify(); \ | 216 Name::cast(this)->Name##Verify(); \ |
| 214 break; | 217 break; |
| 215 STRUCT_LIST(MAKE_STRUCT_CASE) | 218 STRUCT_LIST(MAKE_STRUCT_CASE) |
| 216 #undef MAKE_STRUCT_CASE | 219 #undef MAKE_STRUCT_CASE |
| 217 | 220 |
| 218 default: | 221 default: |
| 219 UNREACHABLE(); | 222 UNREACHABLE(); |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 | 757 |
| 755 void JSArrayBuffer::JSArrayBufferVerify() { | 758 void JSArrayBuffer::JSArrayBufferVerify() { |
| 756 CHECK(IsJSArrayBuffer()); | 759 CHECK(IsJSArrayBuffer()); |
| 757 JSObjectVerify(); | 760 JSObjectVerify(); |
| 758 VerifyPointer(byte_length()); | 761 VerifyPointer(byte_length()); |
| 759 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() | 762 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() |
| 760 || byte_length()->IsUndefined()); | 763 || byte_length()->IsUndefined()); |
| 761 } | 764 } |
| 762 | 765 |
| 763 | 766 |
| 764 void JSTypedArray::JSTypedArrayVerify() { | 767 void JSArrayBufferView::JSArrayBufferViewVerify() { |
| 765 CHECK(IsJSTypedArray()); | 768 CHECK(IsJSArrayBufferView()); |
| 766 JSObjectVerify(); | 769 JSObjectVerify(); |
| 767 VerifyPointer(buffer()); | 770 VerifyPointer(buffer()); |
| 768 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined()); | 771 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined()); |
| 769 | 772 |
| 770 VerifyPointer(byte_offset()); | 773 VerifyPointer(byte_offset()); |
| 771 CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber() | 774 CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber() |
| 772 || byte_offset()->IsUndefined()); | 775 || byte_offset()->IsUndefined()); |
| 773 | 776 |
| 774 VerifyPointer(byte_length()); | 777 VerifyPointer(byte_length()); |
| 775 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() | 778 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() |
| 776 || byte_length()->IsUndefined()); | 779 || byte_length()->IsUndefined()); |
| 780 } |
| 777 | 781 |
| 782 |
| 783 void JSTypedArray::JSTypedArrayVerify() { |
| 784 CHECK(IsJSTypedArray()); |
| 785 JSArrayBufferViewVerify(); |
| 778 VerifyPointer(length()); | 786 VerifyPointer(length()); |
| 779 CHECK(length()->IsSmi() || length()->IsHeapNumber() | 787 CHECK(length()->IsSmi() || length()->IsHeapNumber() |
| 780 || length()->IsUndefined()); | 788 || length()->IsUndefined()); |
| 781 | 789 |
| 782 VerifyPointer(elements()); | 790 VerifyPointer(elements()); |
| 783 } | 791 } |
| 784 | 792 |
| 785 | 793 |
| 794 void JSDataView::JSDataViewVerify() { |
| 795 CHECK(IsJSDataView()); |
| 796 JSArrayBufferViewVerify(); |
| 797 } |
| 798 |
| 799 |
| 786 void Foreign::ForeignVerify() { | 800 void Foreign::ForeignVerify() { |
| 787 CHECK(IsForeign()); | 801 CHECK(IsForeign()); |
| 788 } | 802 } |
| 789 | 803 |
| 790 | 804 |
| 791 void Box::BoxVerify() { | 805 void Box::BoxVerify() { |
| 792 CHECK(IsBox()); | 806 CHECK(IsBox()); |
| 793 value()->Verify(); | 807 value()->Verify(); |
| 794 } | 808 } |
| 795 | 809 |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 for (int i = 0; i < number_of_transitions(); ++i) { | 1150 for (int i = 0; i < number_of_transitions(); ++i) { |
| 1137 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1151 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
| 1138 } | 1152 } |
| 1139 return true; | 1153 return true; |
| 1140 } | 1154 } |
| 1141 | 1155 |
| 1142 | 1156 |
| 1143 #endif // DEBUG | 1157 #endif // DEBUG |
| 1144 | 1158 |
| 1145 } } // namespace v8::internal | 1159 } } // namespace v8::internal |
| OLD | NEW |