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

Side by Side Diff: src/objects-printer.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-inl.h ('k') | src/objects-visiting.cc » ('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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(out); 179 SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(out);
180 break; 180 break;
181 case JS_MESSAGE_OBJECT_TYPE: 181 case JS_MESSAGE_OBJECT_TYPE:
182 JSMessageObject::cast(this)->JSMessageObjectPrint(out); 182 JSMessageObject::cast(this)->JSMessageObjectPrint(out);
183 break; 183 break;
184 case JS_GLOBAL_PROPERTY_CELL_TYPE: 184 case JS_GLOBAL_PROPERTY_CELL_TYPE:
185 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out); 185 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out);
186 break; 186 break;
187 case JS_ARRAY_BUFFER_TYPE: 187 case JS_ARRAY_BUFFER_TYPE:
188 JSArrayBuffer::cast(this)->JSArrayBufferPrint(out); 188 JSArrayBuffer::cast(this)->JSArrayBufferPrint(out);
189 case JS_TYPED_ARRAY_TYPE:
190 JSTypedArray::cast(this)->JSTypedArrayPrint(out);
189 #define MAKE_STRUCT_CASE(NAME, Name, name) \ 191 #define MAKE_STRUCT_CASE(NAME, Name, name) \
190 case NAME##_TYPE: \ 192 case NAME##_TYPE: \
191 Name::cast(this)->Name##Print(out); \ 193 Name::cast(this)->Name##Print(out); \
192 break; 194 break;
193 STRUCT_LIST(MAKE_STRUCT_CASE) 195 STRUCT_LIST(MAKE_STRUCT_CASE)
194 #undef MAKE_STRUCT_CASE 196 #undef MAKE_STRUCT_CASE
195 197
196 default: 198 default:
197 PrintF(out, "UNKNOWN TYPE %d", map()->instance_type()); 199 PrintF(out, "UNKNOWN TYPE %d", map()->instance_type());
198 UNREACHABLE(); 200 UNREACHABLE();
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 void JSArrayBuffer::JSArrayBufferPrint(FILE* out) { 802 void JSArrayBuffer::JSArrayBufferPrint(FILE* out) {
801 HeapObject::PrintHeader(out, "JSArrayBuffer"); 803 HeapObject::PrintHeader(out, "JSArrayBuffer");
802 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); 804 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));
803 PrintF(out, " - backing_store = -0x%p\n", backing_store()); 805 PrintF(out, " - backing_store = -0x%p\n", backing_store());
804 PrintF(out, " - byte_length = "); 806 PrintF(out, " - byte_length = ");
805 byte_length()->ShortPrint(out); 807 byte_length()->ShortPrint(out);
806 PrintF(out, "\n"); 808 PrintF(out, "\n");
807 } 809 }
808 810
809 811
812 void JSTypedArray::JSTypedArrayPrint(FILE* out) {
813 HeapObject::PrintHeader(out, "JSTypedArray");
814 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));
815 PrintF(out, " - buffer =");
816 buffer()->ShortPrint(out);
817 PrintF(out, "\n - byte_offset = ");
818 byte_offset()->ShortPrint(out);
819 PrintF(out, "\n - byte_length = ");
820 byte_length()->ShortPrint(out);
821 PrintF(out, " - length = ");
822 length()->ShortPrint(out);
823 PrintF("\n");
824 PrintElements(out);
825 }
826
827
810 void JSFunction::JSFunctionPrint(FILE* out) { 828 void JSFunction::JSFunctionPrint(FILE* out) {
811 HeapObject::PrintHeader(out, "Function"); 829 HeapObject::PrintHeader(out, "Function");
812 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); 830 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));
813 PrintF(out, " - initial_map = "); 831 PrintF(out, " - initial_map = ");
814 if (has_initial_map()) { 832 if (has_initial_map()) {
815 initial_map()->ShortPrint(out); 833 initial_map()->ShortPrint(out);
816 } 834 }
817 PrintF(out, "\n - shared_info = "); 835 PrintF(out, "\n - shared_info = ");
818 shared()->ShortPrint(out); 836 shared()->ShortPrint(out);
819 PrintF(out, "\n - name = "); 837 PrintF(out, "\n - name = ");
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 } 1203 }
1186 } 1204 }
1187 PrintF(out, "\n"); 1205 PrintF(out, "\n");
1188 } 1206 }
1189 1207
1190 1208
1191 #endif // OBJECT_PRINT 1209 #endif // OBJECT_PRINT
1192 1210
1193 1211
1194 } } // namespace v8::internal 1212 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698