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

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

Issue 6546036: Combine typed and pixel arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: final version Created 9 years, 9 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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 break; 81 break;
82 case HEAP_NUMBER_TYPE: 82 case HEAP_NUMBER_TYPE:
83 HeapNumber::cast(this)->HeapNumberPrint(out); 83 HeapNumber::cast(this)->HeapNumberPrint(out);
84 break; 84 break;
85 case FIXED_ARRAY_TYPE: 85 case FIXED_ARRAY_TYPE:
86 FixedArray::cast(this)->FixedArrayPrint(out); 86 FixedArray::cast(this)->FixedArrayPrint(out);
87 break; 87 break;
88 case BYTE_ARRAY_TYPE: 88 case BYTE_ARRAY_TYPE:
89 ByteArray::cast(this)->ByteArrayPrint(out); 89 ByteArray::cast(this)->ByteArrayPrint(out);
90 break; 90 break;
91 case PIXEL_ARRAY_TYPE: 91 case EXTERNAL_PIXEL_ARRAY_TYPE:
92 PixelArray::cast(this)->PixelArrayPrint(out); 92 ExternalPixelArray::cast(this)->ExternalPixelArrayPrint(out);
93 break; 93 break;
94 case EXTERNAL_BYTE_ARRAY_TYPE: 94 case EXTERNAL_BYTE_ARRAY_TYPE:
95 ExternalByteArray::cast(this)->ExternalByteArrayPrint(out); 95 ExternalByteArray::cast(this)->ExternalByteArrayPrint(out);
96 break; 96 break;
97 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: 97 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE:
98 ExternalUnsignedByteArray::cast(this) 98 ExternalUnsignedByteArray::cast(this)
99 ->ExternalUnsignedByteArrayPrint(out); 99 ->ExternalUnsignedByteArrayPrint(out);
100 break; 100 break;
101 case EXTERNAL_SHORT_ARRAY_TYPE: 101 case EXTERNAL_SHORT_ARRAY_TYPE:
102 ExternalShortArray::cast(this)->ExternalShortArrayPrint(out); 102 ExternalShortArray::cast(this)->ExternalShortArrayPrint(out);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 break; 170 break;
171 } 171 }
172 } 172 }
173 173
174 174
175 void ByteArray::ByteArrayPrint(FILE* out) { 175 void ByteArray::ByteArrayPrint(FILE* out) {
176 PrintF(out, "byte array, data starts at %p", GetDataStartAddress()); 176 PrintF(out, "byte array, data starts at %p", GetDataStartAddress());
177 } 177 }
178 178
179 179
180 void PixelArray::PixelArrayPrint(FILE* out) { 180 void ExternalPixelArray::ExternalPixelArrayPrint(FILE* out) {
181 PrintF(out, "pixel array"); 181 PrintF(out, "external pixel array");
182 } 182 }
183 183
184 184
185 void ExternalByteArray::ExternalByteArrayPrint(FILE* out) { 185 void ExternalByteArray::ExternalByteArrayPrint(FILE* out) {
186 PrintF(out, "external byte array"); 186 PrintF(out, "external byte array");
187 } 187 }
188 188
189 189
190 void ExternalUnsignedByteArray::ExternalUnsignedByteArrayPrint(FILE* out) { 190 void ExternalUnsignedByteArray::ExternalUnsignedByteArrayPrint(FILE* out) {
191 PrintF(out, "external unsigned byte array"); 191 PrintF(out, "external unsigned byte array");
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 case FAST_ELEMENTS: { 264 case FAST_ELEMENTS: {
265 // Print in array notation for non-sparse arrays. 265 // Print in array notation for non-sparse arrays.
266 FixedArray* p = FixedArray::cast(elements()); 266 FixedArray* p = FixedArray::cast(elements());
267 for (int i = 0; i < p->length(); i++) { 267 for (int i = 0; i < p->length(); i++) {
268 PrintF(out, " %d: ", i); 268 PrintF(out, " %d: ", i);
269 p->get(i)->ShortPrint(out); 269 p->get(i)->ShortPrint(out);
270 PrintF(out, "\n"); 270 PrintF(out, "\n");
271 } 271 }
272 break; 272 break;
273 } 273 }
274 case PIXEL_ELEMENTS: { 274 case EXTERNAL_PIXEL_ELEMENTS: {
275 PixelArray* p = PixelArray::cast(elements()); 275 ExternalPixelArray* p = ExternalPixelArray::cast(elements());
276 for (int i = 0; i < p->length(); i++) { 276 for (int i = 0; i < p->length(); i++) {
277 PrintF(out, " %d: %d\n", i, p->get(i)); 277 PrintF(out, " %d: %d\n", i, p->get(i));
278 } 278 }
279 break; 279 break;
280 } 280 }
281 case EXTERNAL_BYTE_ELEMENTS: { 281 case EXTERNAL_BYTE_ELEMENTS: {
282 ExternalByteArray* p = ExternalByteArray::cast(elements()); 282 ExternalByteArray* p = ExternalByteArray::cast(elements());
283 for (int i = 0; i < p->length(); i++) { 283 for (int i = 0; i < p->length(); i++) {
284 PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i))); 284 PrintF(out, " %d: %d\n", i, static_cast<int>(p->get(i)));
285 } 285 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 case EXTERNAL_SYMBOL_TYPE: return "EXTERNAL_SYMBOL"; 365 case EXTERNAL_SYMBOL_TYPE: return "EXTERNAL_SYMBOL";
366 case ASCII_STRING_TYPE: return "ASCII_STRING"; 366 case ASCII_STRING_TYPE: return "ASCII_STRING";
367 case STRING_TYPE: return "TWO_BYTE_STRING"; 367 case STRING_TYPE: return "TWO_BYTE_STRING";
368 case CONS_STRING_TYPE: 368 case CONS_STRING_TYPE:
369 case CONS_ASCII_STRING_TYPE: return "CONS_STRING"; 369 case CONS_ASCII_STRING_TYPE: return "CONS_STRING";
370 case EXTERNAL_ASCII_STRING_TYPE: 370 case EXTERNAL_ASCII_STRING_TYPE:
371 case EXTERNAL_STRING_WITH_ASCII_DATA_TYPE: 371 case EXTERNAL_STRING_WITH_ASCII_DATA_TYPE:
372 case EXTERNAL_STRING_TYPE: return "EXTERNAL_STRING"; 372 case EXTERNAL_STRING_TYPE: return "EXTERNAL_STRING";
373 case FIXED_ARRAY_TYPE: return "FIXED_ARRAY"; 373 case FIXED_ARRAY_TYPE: return "FIXED_ARRAY";
374 case BYTE_ARRAY_TYPE: return "BYTE_ARRAY"; 374 case BYTE_ARRAY_TYPE: return "BYTE_ARRAY";
375 case PIXEL_ARRAY_TYPE: return "PIXEL_ARRAY"; 375 case EXTERNAL_PIXEL_ARRAY_TYPE: return "EXTERNAL_PIXEL_ARRAY";
376 case EXTERNAL_BYTE_ARRAY_TYPE: return "EXTERNAL_BYTE_ARRAY"; 376 case EXTERNAL_BYTE_ARRAY_TYPE: return "EXTERNAL_BYTE_ARRAY";
377 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: 377 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE:
378 return "EXTERNAL_UNSIGNED_BYTE_ARRAY"; 378 return "EXTERNAL_UNSIGNED_BYTE_ARRAY";
379 case EXTERNAL_SHORT_ARRAY_TYPE: return "EXTERNAL_SHORT_ARRAY"; 379 case EXTERNAL_SHORT_ARRAY_TYPE: return "EXTERNAL_SHORT_ARRAY";
380 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: 380 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE:
381 return "EXTERNAL_UNSIGNED_SHORT_ARRAY"; 381 return "EXTERNAL_UNSIGNED_SHORT_ARRAY";
382 case EXTERNAL_INT_ARRAY_TYPE: return "EXTERNAL_INT_ARRAY"; 382 case EXTERNAL_INT_ARRAY_TYPE: return "EXTERNAL_INT_ARRAY";
383 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: 383 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE:
384 return "EXTERNAL_UNSIGNED_INT_ARRAY"; 384 return "EXTERNAL_UNSIGNED_INT_ARRAY";
385 case EXTERNAL_FLOAT_ARRAY_TYPE: return "EXTERNAL_FLOAT_ARRAY"; 385 case EXTERNAL_FLOAT_ARRAY_TYPE: return "EXTERNAL_FLOAT_ARRAY";
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 desc.Print(out); 792 desc.Print(out);
793 } 793 }
794 PrintF(out, "\n"); 794 PrintF(out, "\n");
795 } 795 }
796 796
797 797
798 #endif // OBJECT_PRINT 798 #endif // OBJECT_PRINT
799 799
800 800
801 } } // namespace v8::internal 801 } } // 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