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

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

Issue 15943002: v8 typed arrays: add DataView type (Closed)
Patch Set: v8 typed arrays: add DataView type, v2 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
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()->IsNumber() || byte_length()->IsUndefined());
749 || byte_length()->IsUndefined());
750 } 753 }
751 754
752 755
756 void JSDataView::JSDataViewVerify() {
757 CHECK(IsJSDataView());
758 JSObjectVerify();
759
760 VerifyPointer(buffer());
761 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined());
762
763 VerifyPointer(byte_offset());
764 CHECK(byte_offset()->IsNumber() || byte_offset()->IsUndefined());
765
766 VerifyPointer(byte_length());
767 CHECK(byte_length()->IsNumber() || byte_length()->IsUndefined());
768
769 VerifyPointer(elements());
770 }
771
772
753 void JSTypedArray::JSTypedArrayVerify() { 773 void JSTypedArray::JSTypedArrayVerify() {
754 CHECK(IsJSTypedArray()); 774 CHECK(IsJSTypedArray());
755 JSObjectVerify(); 775 JSObjectVerify();
756 VerifyPointer(buffer()); 776 VerifyPointer(buffer());
757 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined()); 777 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined());
758 778
759 VerifyPointer(byte_offset()); 779 VerifyPointer(byte_offset());
760 CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber() 780 CHECK(byte_offset()->IsNumber() || byte_offset()->IsUndefined());
761 || byte_offset()->IsUndefined());
762 781
763 VerifyPointer(byte_length()); 782 VerifyPointer(byte_length());
764 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() 783 CHECK(byte_length()->IsNumber() || byte_length()->IsUndefined());
765 || byte_length()->IsUndefined());
766 784
767 VerifyPointer(length()); 785 VerifyPointer(length());
768 CHECK(length()->IsSmi() || length()->IsHeapNumber() 786 CHECK(length()->IsNumber() || length()->IsUndefined());
769 || length()->IsUndefined());
770 787
771 VerifyPointer(elements()); 788 VerifyPointer(elements());
772 } 789 }
773 790
774 791
775 void Foreign::ForeignVerify() { 792 void Foreign::ForeignVerify() {
776 CHECK(IsForeign()); 793 CHECK(IsForeign());
777 } 794 }
778 795
779 796
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 for (int i = 0; i < number_of_transitions(); ++i) { 1136 for (int i = 0; i < number_of_transitions(); ++i) {
1120 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1137 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1121 } 1138 }
1122 return true; 1139 return true;
1123 } 1140 }
1124 1141
1125 1142
1126 #endif // DEBUG 1143 #endif // DEBUG
1127 1144
1128 } } // namespace v8::internal 1145 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698