Fix JSObject::PrintTransitions.

BUG=347912
LOG=y
R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/183683005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19601 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
bmeurer@chromium.org 2014-02-28 11:41:07 +00:00
parent 38ca2629be
commit 70242fe3bb
2 changed files with 40 additions and 19 deletions

View File

@ -400,28 +400,39 @@ void JSObject::PrintTransitions(FILE* out) {
if (!map()->HasTransitionArray()) return;
TransitionArray* transitions = map()->transitions();
for (int i = 0; i < transitions->number_of_transitions(); i++) {
Name* key = transitions->GetKey(i);
PrintF(out, " ");
transitions->GetKey(i)->NamePrint(out);
key->NamePrint(out);
PrintF(out, ": ");
switch (transitions->GetTargetDetails(i).type()) {
case FIELD: {
PrintF(out, " (transition to field)\n");
break;
if (key == GetHeap()->frozen_symbol()) {
PrintF(out, " (transition to frozen)\n");
} else if (key == GetHeap()->elements_transition_symbol()) {
PrintF(out, " (transition to ");
PrintElementsKind(out, transitions->GetTarget(i)->elements_kind());
PrintF(out, ")\n");
} else if (key == GetHeap()->observed_symbol()) {
PrintF(out, " (transition to Object.observe)\n");
} else {
switch (transitions->GetTargetDetails(i).type()) {
case FIELD: {
PrintF(out, " (transition to field)\n");
break;
}
case CONSTANT:
PrintF(out, " (transition to constant)\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;
}
case CONSTANT:
PrintF(out, " (transition to constant)\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;
}
}
}

View File

@ -0,0 +1,10 @@
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
var __v_4 = {};
__v_2 = {};
__v_2[1024] = 0;
%DebugPrint(__v_4);