v8/test/mjsunit/debug-materialized.js
jarin f8dcbf4695 [deoptimizer] Do not pass arguments markers to the debugger.
This fixes a bug introduced by r28826 (Unify decoding of deoptimization
translations, https://codereview.chromium.org/1136223004), where we
started leaking arguments marker sentinel to the debugger, which would
then cause crashes. This change replaces the sentinel with the undefined
value in the debugger-inspectable frame.

BUG=chromium:514362
LOG=n
R=yangguo@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#29971}
2015-08-03 10:43:31 +00:00

42 lines
842 B
JavaScript

// Copyright 2015 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 --expose-debug-as debug
function dbg(x) {
debugger;
}
function foo() {
arguments[0];
dbg();
}
function bar() {
var t = { a : 1 };
dbg();
return t.a;
}
foo(1);
foo(1);
bar(1);
bar(1);
%OptimizeFunctionOnNextCall(foo);
%OptimizeFunctionOnNextCall(bar);
var Debug = debug.Debug;
Debug.setListener(function(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.Break) return;
for (var i = 0; i < exec_state.frameCount(); i++) {
var f = exec_state.frame(i);
for (var j = 0; j < f.localCount(); j++) {
print("'" + f.localName(j) + "' = " + f.localValue(j).value());
}
}
});
foo(1);
bar(1);