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

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

Issue 10444055: Promoting elements transitions to their own field. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: renaming SearchMode fields and moving it into descriptor array class Created 8 years, 6 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
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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 break; 266 break;
267 } 267 }
268 case CONSTANT_FUNCTION: 268 case CONSTANT_FUNCTION:
269 descs->GetConstantFunction(i)->ShortPrint(out); 269 descs->GetConstantFunction(i)->ShortPrint(out);
270 PrintF(out, " (constant function)\n"); 270 PrintF(out, " (constant function)\n");
271 break; 271 break;
272 case CALLBACKS: 272 case CALLBACKS:
273 descs->GetCallbacksObject(i)->ShortPrint(out); 273 descs->GetCallbacksObject(i)->ShortPrint(out);
274 PrintF(out, " (callback)\n"); 274 PrintF(out, " (callback)\n");
275 break; 275 break;
276 case ELEMENTS_TRANSITION: {
277 PrintF(out, "(elements transition to ");
278 Object* descriptor_contents = descs->GetValue(i);
279 if (descriptor_contents->IsMap()) {
280 Map* map = Map::cast(descriptor_contents);
281 PrintElementsKind(out, map->elements_kind());
282 } else {
283 FixedArray* map_array = FixedArray::cast(descriptor_contents);
284 for (int i = 0; i < map_array->length(); ++i) {
285 Map* map = Map::cast(map_array->get(i));
286 if (i != 0) {
287 PrintF(out, ", ");
288 }
289 PrintElementsKind(out, map->elements_kind());
290 }
291 }
292 PrintF(out, ")\n");
293 break;
294 }
295 case MAP_TRANSITION: 276 case MAP_TRANSITION:
296 PrintF(out, "(map transition)\n"); 277 PrintF(out, "(map transition)\n");
297 break; 278 break;
298 case CONSTANT_TRANSITION: 279 case CONSTANT_TRANSITION:
299 PrintF(out, "(constant transition)\n"); 280 PrintF(out, "(constant transition)\n");
300 break; 281 break;
301 case NULL_DESCRIPTOR: 282 case NULL_DESCRIPTOR:
302 PrintF(out, "(null descriptor)\n"); 283 PrintF(out, "(null descriptor)\n");
303 break; 284 break;
304 case NORMAL: // only in slow mode 285 case NORMAL: // only in slow mode
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 412
432 void JSObject::JSObjectPrint(FILE* out) { 413 void JSObject::JSObjectPrint(FILE* out) {
433 PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this)); 414 PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this));
434 PrintF(out, " - map = %p [", reinterpret_cast<void*>(map())); 415 PrintF(out, " - map = %p [", reinterpret_cast<void*>(map()));
435 // Don't call GetElementsKind, its validation code can cause the printer to 416 // Don't call GetElementsKind, its validation code can cause the printer to
436 // fail when debugging. 417 // fail when debugging.
437 PrintElementsKind(out, this->map()->elements_kind()); 418 PrintElementsKind(out, this->map()->elements_kind());
438 PrintF(out, 419 PrintF(out,
439 "]\n - prototype = %p\n", 420 "]\n - prototype = %p\n",
440 reinterpret_cast<void*>(GetPrototype())); 421 reinterpret_cast<void*>(GetPrototype()));
422 PrintF(out,
423 " - elements transition to = %p\n",
424 reinterpret_cast<void*>(map()->elements_transition_map()));
441 PrintF(out, " {\n"); 425 PrintF(out, " {\n");
442 PrintProperties(out); 426 PrintProperties(out);
443 PrintElements(out); 427 PrintElements(out);
444 PrintF(out, " }\n"); 428 PrintF(out, " }\n");
445 } 429 }
446 430
447 431
448 void JSModule::JSModulePrint(FILE* out) { 432 void JSModule::JSModulePrint(FILE* out) {
449 HeapObject::PrintHeader(out, "JSModule"); 433 HeapObject::PrintHeader(out, "JSModule");
450 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); 434 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map()));
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 desc.Print(out); 1017 desc.Print(out);
1034 } 1018 }
1035 PrintF(out, "\n"); 1019 PrintF(out, "\n");
1036 } 1020 }
1037 1021
1038 1022
1039 #endif // OBJECT_PRINT 1023 #endif // OBJECT_PRINT
1040 1024
1041 1025
1042 } } // namespace v8::internal 1026 } } // namespace v8::internal
OLDNEW
« src/objects.cc ('K') | « src/objects-inl.h ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698