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

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

Issue 13975012: First cut at impementing ES6 TypedArrays in V8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 years, 8 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
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 break; 191 break;
192 case SHARED_FUNCTION_INFO_TYPE: 192 case SHARED_FUNCTION_INFO_TYPE:
193 SharedFunctionInfo::cast(this)->SharedFunctionInfoVerify(); 193 SharedFunctionInfo::cast(this)->SharedFunctionInfoVerify();
194 break; 194 break;
195 case JS_MESSAGE_OBJECT_TYPE: 195 case JS_MESSAGE_OBJECT_TYPE:
196 JSMessageObject::cast(this)->JSMessageObjectVerify(); 196 JSMessageObject::cast(this)->JSMessageObjectVerify();
197 break; 197 break;
198 case JS_ARRAY_BUFFER_TYPE: 198 case JS_ARRAY_BUFFER_TYPE:
199 JSArrayBuffer::cast(this)->JSArrayBufferVerify(); 199 JSArrayBuffer::cast(this)->JSArrayBufferVerify();
200 break; 200 break;
201 case JS_TYPED_ARRAY_TYPE:
202 JSTypedArray::cast(this)->JSTypedArrayVerify();
203 break;
201 204
202 #define MAKE_STRUCT_CASE(NAME, Name, name) \ 205 #define MAKE_STRUCT_CASE(NAME, Name, name) \
203 case NAME##_TYPE: \ 206 case NAME##_TYPE: \
204 Name::cast(this)->Name##Verify(); \ 207 Name::cast(this)->Name##Verify(); \
205 break; 208 break;
206 STRUCT_LIST(MAKE_STRUCT_CASE) 209 STRUCT_LIST(MAKE_STRUCT_CASE)
207 #undef MAKE_STRUCT_CASE 210 #undef MAKE_STRUCT_CASE
208 211
209 default: 212 default:
210 UNREACHABLE(); 213 UNREACHABLE();
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 720
718 void JSArrayBuffer::JSArrayBufferVerify() { 721 void JSArrayBuffer::JSArrayBufferVerify() {
719 CHECK(IsJSArrayBuffer()); 722 CHECK(IsJSArrayBuffer());
720 JSObjectVerify(); 723 JSObjectVerify();
721 VerifyPointer(byte_length()); 724 VerifyPointer(byte_length());
722 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber() 725 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber()
723 || byte_length()->IsUndefined()); 726 || byte_length()->IsUndefined());
724 } 727 }
725 728
726 729
730 void JSTypedArray::JSTypedArrayVerify() {
731 CHECK(IsJSTypedArray());
732 JSObjectVerify();
733 VerifyPointer(buffer());
734 CHECK(buffer()->IsJSArrayBuffer() || buffer()->IsUndefined());
735
736 VerifyPointer(byte_offset());
737 CHECK(byte_offset()->IsSmi() || byte_offset()->IsHeapNumber()
738 || byte_offset()->IsUndefined());
739
740 VerifyPointer(byte_length());
741 CHECK(byte_length()->IsSmi() || byte_length()->IsHeapNumber()
742 || byte_length()->IsUndefined());
743
744 VerifyPointer(length());
745 CHECK(length()->IsSmi() || length()->IsHeapNumber()
746 || length()->IsUndefined());
747
748 VerifyPointer(elements());
749 }
750
751
727 void Foreign::ForeignVerify() { 752 void Foreign::ForeignVerify() {
728 CHECK(IsForeign()); 753 CHECK(IsForeign());
729 } 754 }
730 755
731 756
732 void AccessorInfo::AccessorInfoVerify() { 757 void AccessorInfo::AccessorInfoVerify() {
733 VerifyPointer(name()); 758 VerifyPointer(name());
734 VerifyPointer(flag()); 759 VerifyPointer(flag());
735 VerifyPointer(expected_receiver_type()); 760 VerifyPointer(expected_receiver_type());
736 } 761 }
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 for (int i = 0; i < number_of_transitions(); ++i) { 1096 for (int i = 0; i < number_of_transitions(); ++i) {
1072 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1097 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1073 } 1098 }
1074 return true; 1099 return true;
1075 } 1100 }
1076 1101
1077 1102
1078 #endif // DEBUG 1103 #endif // DEBUG
1079 1104
1080 } } // namespace v8::internal 1105 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698