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

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

Issue 17153011: DataView implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Self-review Created 7 years, 6 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
OLDNEW
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
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
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());
rossberg 2013/06/21 08:44:01 Why not CHECK(IsJSArrayBufferView())?
Dmitry Lomov (no reviews) 2013/06/21 11:32:10 Done.
766 JSObjectVerify(); 768 JSObjectVerify();
767 VerifyPointer(buffer()); 769 VerifyPointer(buffer());
768 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined()); 770 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined());
769 771
770 VerifyPointer(byte_offset()); 772 VerifyPointer(byte_offset());
771 CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber() 773 CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber()
772 || byte_offset()->IsUndefined()); 774 || byte_offset()->IsUndefined());
773 775
774 VerifyPointer(byte_length()); 776 VerifyPointer(byte_length());
775 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() 777 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber()
776 || byte_length()->IsUndefined()); 778 || byte_length()->IsUndefined());
779 }
777 780
rossberg 2013/06/21 08:44:01 Nit: 2 empty lines
Dmitry Lomov (no reviews) 2013/06/21 11:32:10 Done.
781 void JSTypedArray::JSTypedArrayVerify() {
782 CHECK(IsJSTypedArray());
783 JSArrayBufferViewVerify();
778 VerifyPointer(length()); 784 VerifyPointer(length());
779 CHECK(length()->IsSmi() || length()->IsHeapNumber() 785 CHECK(length()->IsSmi() || length()->IsHeapNumber()
780 || length()->IsUndefined()); 786 || length()->IsUndefined());
781 787
782 VerifyPointer(elements()); 788 VerifyPointer(elements());
783 } 789 }
784 790
785 791
792 void JSDataView::JSDataViewVerify() {
793 CHECK(IsJSDataView());
794 JSArrayBufferViewVerify();
795 }
796
797
786 void Foreign::ForeignVerify() { 798 void Foreign::ForeignVerify() {
787 CHECK(IsForeign()); 799 CHECK(IsForeign());
788 } 800 }
789 801
790 802
791 void Box::BoxVerify() { 803 void Box::BoxVerify() {
792 CHECK(IsBox()); 804 CHECK(IsBox());
793 value()->Verify(); 805 value()->Verify();
794 } 806 }
795 807
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 for (int i = 0; i < number_of_transitions(); ++i) { 1148 for (int i = 0; i < number_of_transitions(); ++i) {
1137 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1149 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1138 } 1150 }
1139 return true; 1151 return true;
1140 } 1152 }
1141 1153
1142 1154
1143 #endif // DEBUG 1155 #endif // DEBUG
1144 1156
1145 } } // namespace v8::internal 1157 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698