| Index: src/objects-printer.cc
|
| diff --git a/src/objects-printer.cc b/src/objects-printer.cc
|
| index 2e58c0949e5020c85008cc9621f4a071a3b2f82e..679e9dc90c3dde50dddbf23d3453b2dcdaa13058 100644
|
| --- a/src/objects-printer.cc
|
| +++ b/src/objects-printer.cc
|
| @@ -273,15 +273,11 @@ void JSObject::PrintProperties(FILE* out) {
|
| descs->GetCallbacksObject(i)->ShortPrint(out);
|
| PrintF(out, " (callback)\n");
|
| break;
|
| - case MAP_TRANSITION:
|
| - PrintF(out, "(map transition)\n");
|
| - break;
|
| - case CONSTANT_TRANSITION:
|
| - PrintF(out, "(constant transition)\n");
|
| - break;
|
| case NORMAL: // only in slow mode
|
| case HANDLER: // only in lookup results, not in descriptors
|
| case INTERCEPTOR: // only in lookup results, not in descriptors
|
| + // There are no transitions in the descriptor array.
|
| + case TRANSITION:
|
| case NONEXISTENT:
|
| UNREACHABLE();
|
| break;
|
| @@ -408,6 +404,37 @@ void JSObject::PrintElements(FILE* out) {
|
| }
|
|
|
|
|
| +void JSObject::PrintTransitions(FILE* out) {
|
| + if (!map()->HasTransitionArray()) return;
|
| + TransitionArray* transitions = map()->transitions();
|
| + for (int i = 0; i < transitions->number_of_transitions(); i++) {
|
| + PrintF(out, " ");
|
| + transitions->GetKey(i)->StringPrint(out);
|
| + PrintF(out, ": ");
|
| + switch (transitions->GetTargetDetails(i).type()) {
|
| + case FIELD: {
|
| + PrintF(out, " (transition to field)\n");
|
| + break;
|
| + }
|
| + case CONSTANT_FUNCTION:
|
| + PrintF(out, " (transition to constant function)\n");
|
| + break;
|
| + case CALLBACKS:
|
| + PrintF(out, " (transition to callback)\n");
|
| + break;
|
| + // Values below are never in the target descriptor array.
|
| + case NORMAL:
|
| + case HANDLER:
|
| + case INTERCEPTOR:
|
| + case TRANSITION:
|
| + case NONEXISTENT:
|
| + UNREACHABLE();
|
| + break;
|
| + }
|
| + }
|
| +}
|
| +
|
| +
|
| void JSObject::JSObjectPrint(FILE* out) {
|
| PrintF(out, "%p: [JSObject]\n", reinterpret_cast<void*>(this));
|
| PrintF(out, " - map = %p [", reinterpret_cast<void*>(map()));
|
| @@ -417,11 +444,9 @@ void JSObject::JSObjectPrint(FILE* out) {
|
| PrintF(out,
|
| "]\n - prototype = %p\n",
|
| reinterpret_cast<void*>(GetPrototype()));
|
| - PrintF(out,
|
| - " - elements transition to = %p\n",
|
| - reinterpret_cast<void*>(map()->elements_transition_map()));
|
| PrintF(out, " {\n");
|
| PrintProperties(out);
|
| + PrintTransitions(out);
|
| PrintElements(out);
|
| PrintF(out, " }\n");
|
| }
|
| @@ -537,6 +562,10 @@ void Map::MapPrint(FILE* out) {
|
| }
|
| PrintF(out, " - instance descriptors: ");
|
| instance_descriptors()->ShortPrint(out);
|
| + if (HasTransitionArray()) {
|
| + PrintF(out, "\n - transitions: ");
|
| + transitions()->ShortPrint(out);
|
| + }
|
| PrintF(out, "\n - prototype: ");
|
| prototype()->ShortPrint(out);
|
| PrintF(out, "\n - constructor: ");
|
| @@ -1024,6 +1053,37 @@ void DescriptorArray::PrintDescriptors(FILE* out) {
|
| }
|
|
|
|
|
| +void TransitionArray::PrintTransitions(FILE* out) {
|
| + PrintF(out, "Transition array %d\n", number_of_transitions());
|
| + for (int i = 0; i < number_of_transitions(); i++) {
|
| + PrintF(out, " %d: ", i);
|
| + GetKey(i)->StringPrint(out);
|
| + PrintF(out, ": ");
|
| + switch (GetTargetDetails(i).type()) {
|
| + case FIELD: {
|
| + PrintF(out, " (transition to field)\n");
|
| + break;
|
| + }
|
| + case CONSTANT_FUNCTION:
|
| + PrintF(out, " (transition to constant function)\n");
|
| + break;
|
| + case CALLBACKS:
|
| + PrintF(out, " (transition to callback)\n");
|
| + break;
|
| + // Values below are never in the target descriptor array.
|
| + case NORMAL:
|
| + case HANDLER:
|
| + case INTERCEPTOR:
|
| + case TRANSITION:
|
| + case NONEXISTENT:
|
| + UNREACHABLE();
|
| + break;
|
| + }
|
| + }
|
| + PrintF(out, "\n");
|
| +}
|
| +
|
| +
|
| #endif // OBJECT_PRINT
|
|
|
|
|
|
|