OLD | NEW |
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 break; | 393 break; |
394 } | 394 } |
395 } | 395 } |
396 } | 396 } |
397 | 397 |
398 | 398 |
399 void JSObject::PrintTransitions(FILE* out) { | 399 void JSObject::PrintTransitions(FILE* out) { |
400 if (!map()->HasTransitionArray()) return; | 400 if (!map()->HasTransitionArray()) return; |
401 TransitionArray* transitions = map()->transitions(); | 401 TransitionArray* transitions = map()->transitions(); |
402 for (int i = 0; i < transitions->number_of_transitions(); i++) { | 402 for (int i = 0; i < transitions->number_of_transitions(); i++) { |
| 403 Name* key = transitions->GetKey(i); |
403 PrintF(out, " "); | 404 PrintF(out, " "); |
404 transitions->GetKey(i)->NamePrint(out); | 405 key->NamePrint(out); |
405 PrintF(out, ": "); | 406 PrintF(out, ": "); |
406 switch (transitions->GetTargetDetails(i).type()) { | 407 if (key == GetHeap()->frozen_symbol()) { |
407 case FIELD: { | 408 PrintF(out, " (transition to frozen)\n"); |
408 PrintF(out, " (transition to field)\n"); | 409 } else if (key == GetHeap()->elements_transition_symbol()) { |
409 break; | 410 PrintF(out, " (transition to "); |
| 411 PrintElementsKind(out, transitions->GetTarget(i)->elements_kind()); |
| 412 PrintF(out, ")\n"); |
| 413 } else if (key == GetHeap()->observed_symbol()) { |
| 414 PrintF(out, " (transition to Object.observe)\n"); |
| 415 } else { |
| 416 switch (transitions->GetTargetDetails(i).type()) { |
| 417 case FIELD: { |
| 418 PrintF(out, " (transition to field)\n"); |
| 419 break; |
| 420 } |
| 421 case CONSTANT: |
| 422 PrintF(out, " (transition to constant)\n"); |
| 423 break; |
| 424 case CALLBACKS: |
| 425 PrintF(out, " (transition to callback)\n"); |
| 426 break; |
| 427 // Values below are never in the target descriptor array. |
| 428 case NORMAL: |
| 429 case HANDLER: |
| 430 case INTERCEPTOR: |
| 431 case TRANSITION: |
| 432 case NONEXISTENT: |
| 433 UNREACHABLE(); |
| 434 break; |
410 } | 435 } |
411 case CONSTANT: | |
412 PrintF(out, " (transition to constant)\n"); | |
413 break; | |
414 case CALLBACKS: | |
415 PrintF(out, " (transition to callback)\n"); | |
416 break; | |
417 // Values below are never in the target descriptor array. | |
418 case NORMAL: | |
419 case HANDLER: | |
420 case INTERCEPTOR: | |
421 case TRANSITION: | |
422 case NONEXISTENT: | |
423 UNREACHABLE(); | |
424 break; | |
425 } | 436 } |
426 } | 437 } |
427 } | 438 } |
428 | 439 |
429 | 440 |
430 void JSObject::JSObjectPrint(FILE* out) { | 441 void JSObject::JSObjectPrint(FILE* out) { |
431 PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this)); | 442 PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this)); |
432 PrintF(out, " - map = %p [", reinterpret_cast<void*>(map())); | 443 PrintF(out, " - map = %p [", reinterpret_cast<void*>(map())); |
433 // Don't call GetElementsKind, its validation code can cause the printer to | 444 // Don't call GetElementsKind, its validation code can cause the printer to |
434 // fail when debugging. | 445 // fail when debugging. |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1218 } | 1229 } |
1219 } | 1230 } |
1220 PrintF(out, "\n"); | 1231 PrintF(out, "\n"); |
1221 } | 1232 } |
1222 | 1233 |
1223 | 1234 |
1224 #endif // OBJECT_PRINT | 1235 #endif // OBJECT_PRINT |
1225 | 1236 |
1226 | 1237 |
1227 } } // namespace v8::internal | 1238 } } // namespace v8::internal |
OLD | NEW |