From 70242fe3bbccfe2a6df7a67de37e6bb1e5e17a17 Mon Sep 17 00:00:00 2001 From: "bmeurer@chromium.org" Date: Fri, 28 Feb 2014 11:41:07 +0000 Subject: [PATCH] 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 --- src/objects-printer.cc | 49 +++++++++++++++++++++------------- test/mjsunit/regress/regress-347912.js | 10 +++++++ 2 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 test/mjsunit/regress/regress-347912.js diff --git a/src/objects-printer.cc b/src/objects-printer.cc index e9fb832..fb273d5 100644 --- a/src/objects-printer.cc +++ b/src/objects-printer.cc @@ -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; } } } diff --git a/test/mjsunit/regress/regress-347912.js b/test/mjsunit/regress/regress-347912.js new file mode 100644 index 0000000..b609e36 --- /dev/null +++ b/test/mjsunit/regress/regress-347912.js @@ -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); -- 2.7.4