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

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

Issue 7473031: Remaining changes to fully support FastDoubleArray. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years, 5 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') | test/cctest/test-api.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 2011 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
11 // with the distribution. 11 // with the distribution.
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 case FAST_ELEMENTS: { 275 case FAST_ELEMENTS: {
276 // Print in array notation for non-sparse arrays. 276 // Print in array notation for non-sparse arrays.
277 FixedArray* p = FixedArray::cast(elements()); 277 FixedArray* p = FixedArray::cast(elements());
278 for (int i = 0; i < p->length(); i++) { 278 for (int i = 0; i < p->length(); i++) {
279 PrintF(out, " %d: ", i); 279 PrintF(out, " %d: ", i);
280 p->get(i)->ShortPrint(out); 280 p->get(i)->ShortPrint(out);
281 PrintF(out, "\n"); 281 PrintF(out, "\n");
282 } 282 }
283 break; 283 break;
284 } 284 }
285 case FAST_DOUBLE_ELEMENTS: {
286 // Print in array notation for non-sparse arrays.
287 FixedDoubleArray* p = FixedDoubleArray::cast(elements());
288 for (int i = 0; i < p->length(); i++) {
289 if (p->is_the_hole(i)) {
290 PrintF(out, " %d: <the hole>", i);
291 } else {
292 PrintF(out, " %d: %g", i, p->get(i));
293 }
294 PrintF(out, "\n");
295 }
296 break;
297 }
285 case EXTERNAL_PIXEL_ELEMENTS: { 298 case EXTERNAL_PIXEL_ELEMENTS: {
286 ExternalPixelArray* p = ExternalPixelArray::cast(elements()); 299 ExternalPixelArray* p = ExternalPixelArray::cast(elements());
287 for (int i = 0; i < p->length(); i++) { 300 for (int i = 0; i < p->length(); i++) {
288 PrintF(out, " %d: %d\n", i, p->get(i)); 301 PrintF(out, " %d: %d\n", i, p->get(i));
289 } 302 }
290 break; 303 break;
291 } 304 }
292 case EXTERNAL_BYTE_ELEMENTS: { 305 case EXTERNAL_BYTE_ELEMENTS: {
293 ExternalByteArray* p = ExternalByteArray::cast(elements()); 306 ExternalByteArray* p = ExternalByteArray::cast(elements());
294 for (int i = 0; i < p->length(); i++) { 307 for (int i = 0; i < p->length(); i++) {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 break; 366 break;
354 case NON_STRICT_ARGUMENTS_ELEMENTS: { 367 case NON_STRICT_ARGUMENTS_ELEMENTS: {
355 FixedArray* p = FixedArray::cast(elements()); 368 FixedArray* p = FixedArray::cast(elements());
356 for (int i = 2; i < p->length(); i++) { 369 for (int i = 2; i < p->length(); i++) {
357 PrintF(out, " %d: ", i); 370 PrintF(out, " %d: ", i);
358 p->get(i)->ShortPrint(out); 371 p->get(i)->ShortPrint(out);
359 PrintF(out, "\n"); 372 PrintF(out, "\n");
360 } 373 }
361 break; 374 break;
362 } 375 }
363 default:
364 UNREACHABLE();
365 break;
366 } 376 }
367 } 377 }
368 378
369 379
370 void JSObject::JSObjectPrint(FILE* out) { 380 void JSObject::JSObjectPrint(FILE* out) {
371 PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this)); 381 PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this));
372 PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map())); 382 PrintF(out, " - map = %p\n", reinterpret_cast<void*>(map()));
373 PrintF(out, " - prototype = %p\n", reinterpret_cast<void*>(GetPrototype())); 383 PrintF(out, " - prototype = %p\n", reinterpret_cast<void*>(GetPrototype()));
374 PrintF(out, " {\n"); 384 PrintF(out, " {\n");
375 PrintProperties(out); 385 PrintProperties(out);
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 desc.Print(out); 846 desc.Print(out);
837 } 847 }
838 PrintF(out, "\n"); 848 PrintF(out, "\n");
839 } 849 }
840 850
841 851
842 #endif // OBJECT_PRINT 852 #endif // OBJECT_PRINT
843 853
844 854
845 } } // namespace v8::internal 855 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698