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

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

Issue 15943002: v8 typed arrays: add DataView type (Closed)
Patch Set: Created 7 years, 7 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
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 break; 194 break;
195 case SHARED_FUNCTION_INFO_TYPE: 195 case SHARED_FUNCTION_INFO_TYPE:
196 SharedFunctionInfo::cast(this)->SharedFunctionInfoVerify(); 196 SharedFunctionInfo::cast(this)->SharedFunctionInfoVerify();
197 break; 197 break;
198 case JS_MESSAGE_OBJECT_TYPE: 198 case JS_MESSAGE_OBJECT_TYPE:
199 JSMessageObject::cast(this)->JSMessageObjectVerify(); 199 JSMessageObject::cast(this)->JSMessageObjectVerify();
200 break; 200 break;
201 case JS_ARRAY_BUFFER_TYPE: 201 case JS_ARRAY_BUFFER_TYPE:
202 JSArrayBuffer::cast(this)->JSArrayBufferVerify(); 202 JSArrayBuffer::cast(this)->JSArrayBufferVerify();
203 break; 203 break;
204 case JS_DATA_VIEW_TYPE:
205 JSDataView::cast(this)->JSDataViewVerify();
206 break;
204 case JS_TYPED_ARRAY_TYPE: 207 case JS_TYPED_ARRAY_TYPE:
205 JSTypedArray::cast(this)->JSTypedArrayVerify(); 208 JSTypedArray::cast(this)->JSTypedArrayVerify();
206 break; 209 break;
207 210
208 #define MAKE_STRUCT_CASE(NAME, Name, name) \ 211 #define MAKE_STRUCT_CASE(NAME, Name, name) \
209 case NAME##_TYPE: \ 212 case NAME##_TYPE: \
210 Name::cast(this)->Name##Verify(); \ 213 Name::cast(this)->Name##Verify(); \
211 break; 214 break;
212 STRUCT_LIST(MAKE_STRUCT_CASE) 215 STRUCT_LIST(MAKE_STRUCT_CASE)
213 #undef MAKE_STRUCT_CASE 216 #undef MAKE_STRUCT_CASE
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 } 737 }
735 738
736 739
737 void JSFunctionProxy::JSFunctionProxyVerify() { 740 void JSFunctionProxy::JSFunctionProxyVerify() {
738 CHECK(IsJSFunctionProxy()); 741 CHECK(IsJSFunctionProxy());
739 JSProxyVerify(); 742 JSProxyVerify();
740 VerifyPointer(call_trap()); 743 VerifyPointer(call_trap());
741 VerifyPointer(construct_trap()); 744 VerifyPointer(construct_trap());
742 } 745 }
743 746
747
744 void JSArrayBuffer::JSArrayBufferVerify() { 748 void JSArrayBuffer::JSArrayBufferVerify() {
745 CHECK(IsJSArrayBuffer()); 749 CHECK(IsJSArrayBuffer());
746 JSObjectVerify(); 750 JSObjectVerify();
747 VerifyPointer(byte_length()); 751 VerifyPointer(byte_length());
748 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() 752 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber()
749 || byte_length()->IsUndefined()); 753 || byte_length()->IsUndefined());
750 } 754 }
751 755
752 756
757 void JSDataView::JSDataViewVerify() {
758 CHECK(IsJSDataView());
759 JSObjectVerify();
760
761 VerifyPointer(buffer());
762 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined());
763
764 VerifyPointer(byte_offset());
765 CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber()
Sven Panne 2013/05/24 06:58:25 Use IsNumber() here and below.
bnoordhuis 2013/05/24 11:49:03 Why is that? I ask because JSArrayBufferVerify() u
bnoordhuis 2013/05/24 11:53:52 Never mind, I see that IsNumber() is just IsSmi()
Sven Panne 2013/05/24 12:19:20 This would be nice.
766 || byte_offset()->IsUndefined());
767
768 VerifyPointer(byte_length());
769 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber()
770 || byte_length()->IsUndefined());
771
772 VerifyPointer(elements());
773 }
774
775
753 void JSTypedArray::JSTypedArrayVerify() { 776 void JSTypedArray::JSTypedArrayVerify() {
754 CHECK(IsJSTypedArray()); 777 CHECK(IsJSTypedArray());
755 JSObjectVerify(); 778 JSObjectVerify();
756 VerifyPointer(buffer()); 779 VerifyPointer(buffer());
757 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined()); 780 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined());
758 781
759 VerifyPointer(byte_offset()); 782 VerifyPointer(byte_offset());
760 CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber() 783 CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber()
761 || byte_offset()->IsUndefined()); 784 || byte_offset()->IsUndefined());
762 785
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 for (int i = 0; i < number_of_transitions(); ++i) { 1142 for (int i = 0; i < number_of_transitions(); ++i) {
1120 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1143 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1121 } 1144 }
1122 return true; 1145 return true;
1123 } 1146 }
1124 1147
1125 1148
1126 #endif // DEBUG 1149 #endif // DEBUG
1127 1150
1128 } } // namespace v8::internal 1151 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698