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

Side by Side Diff: src/objects-printer.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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 break; 181 break;
182 case JS_MESSAGE_OBJECT_TYPE: 182 case JS_MESSAGE_OBJECT_TYPE:
183 JSMessageObject::cast(this)->JSMessageObjectPrint(out); 183 JSMessageObject::cast(this)->JSMessageObjectPrint(out);
184 break; 184 break;
185 case JS_GLOBAL_PROPERTY_CELL_TYPE: 185 case JS_GLOBAL_PROPERTY_CELL_TYPE:
186 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out); 186 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out);
187 break; 187 break;
188 case JS_ARRAY_BUFFER_TYPE: 188 case JS_ARRAY_BUFFER_TYPE:
189 JSArrayBuffer::cast(this)->JSArrayBufferPrint(out); 189 JSArrayBuffer::cast(this)->JSArrayBufferPrint(out);
190 break; 190 break;
191 case JS_DATA_VIEW_TYPE:
192 JSDataView::cast(this)->JSDataViewPrint(out);
193 break;
191 case JS_TYPED_ARRAY_TYPE: 194 case JS_TYPED_ARRAY_TYPE:
192 JSTypedArray::cast(this)->JSTypedArrayPrint(out); 195 JSTypedArray::cast(this)->JSTypedArrayPrint(out);
193 break; 196 break;
194 #define MAKE_STRUCT_CASE(NAME, Name, name) \ 197 #define MAKE_STRUCT_CASE(NAME, Name, name) \
195 case NAME##_TYPE: \ 198 case NAME##_TYPE: \
196 Name::cast(this)->Name##Print(out); \ 199 Name::cast(this)->Name##Print(out); \
197 break; 200 break;
198 STRUCT_LIST(MAKE_STRUCT_CASE) 201 STRUCT_LIST(MAKE_STRUCT_CASE)
199 #undef MAKE_STRUCT_CASE 202 #undef MAKE_STRUCT_CASE
200 203
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 void JSArrayBuffer::JSArrayBufferPrint(FILE* out) { 809 void JSArrayBuffer::JSArrayBufferPrint(FILE* out) {
807 HeapObject::PrintHeader(out, "JSArrayBuffer"); 810 HeapObject::PrintHeader(out, "JSArrayBuffer");
808 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); 811 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));
809 PrintF(out, " - backing_store = -0x%p\n", backing_store()); 812 PrintF(out, " - backing_store = -0x%p\n", backing_store());
810 PrintF(out, " - byte_length = "); 813 PrintF(out, " - byte_length = ");
811 byte_length()->ShortPrint(out); 814 byte_length()->ShortPrint(out);
812 PrintF(out, "\n"); 815 PrintF(out, "\n");
813 } 816 }
814 817
815 818
819 void JSDataView::JSDataViewPrint(FILE* out) {
820 HeapObject::PrintHeader(out, "JSDataView");
821 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));
822 PrintF(out, " - buffer =");
823 buffer()->ShortPrint(out);
824 PrintF(out, "\n - byte_offset = ");
825 byte_offset()->ShortPrint(out);
826 PrintF(out, "\n - byte_length = ");
827 byte_length()->ShortPrint(out);
828 PrintF(out, " - byte_length = ");
829 byte_length()->ShortPrint(out);
830 PrintF(out, "\n");
831 PrintElements(out);
832 }
833
834
816 void JSTypedArray::JSTypedArrayPrint(FILE* out) { 835 void JSTypedArray::JSTypedArrayPrint(FILE* out) {
817 HeapObject::PrintHeader(out, "JSTypedArray"); 836 HeapObject::PrintHeader(out, "JSTypedArray");
818 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); 837 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));
819 PrintF(out, " - buffer ="); 838 PrintF(out, " - buffer =");
820 buffer()->ShortPrint(out); 839 buffer()->ShortPrint(out);
821 PrintF(out, "\n - byte_offset = "); 840 PrintF(out, "\n - byte_offset = ");
822 byte_offset()->ShortPrint(out); 841 byte_offset()->ShortPrint(out);
823 PrintF(out, "\n - byte_length = "); 842 PrintF(out, "\n - byte_length = ");
824 byte_length()->ShortPrint(out); 843 byte_length()->ShortPrint(out);
825 PrintF(out, " - length = "); 844 PrintF(out, " - length = ");
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 } 1228 }
1210 } 1229 }
1211 PrintF(out, "\n"); 1230 PrintF(out, "\n");
1212 } 1231 }
1213 1232
1214 1233
1215 #endif // OBJECT_PRINT 1234 #endif // OBJECT_PRINT
1216 1235
1217 1236
1218 } } // namespace v8::internal 1237 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698