1852300954
Replaces the graph-based liveness analyzer in the bytecode graph builder with an initial bytecode-based liveness analysis pass, which is added to the existing loop extent analysis. Now the StateValues in the graph have their inputs initialised to optimized_out, rather than being modified after the graph is built. Review-Url: https://codereview.chromium.org/2523893003 Cr-Commit-Position: refs/heads/master@{#41344}
32 lines
995 B
JavaScript
32 lines
995 B
JavaScript
// Copyright 2012 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: --noanalyze-environment-liveness
|
|
|
|
|
|
'use strict';
|
|
var Debug = debug.Debug;
|
|
var exception = null;
|
|
|
|
function listener(event, exec_state, event_data, data) {
|
|
if (event != Debug.DebugEvent.Break) return;
|
|
try {
|
|
var scopes = exec_state.frame(0).allScopes();
|
|
assertEquals(debug.ScopeType.Eval, scopes[0].scopeType());
|
|
assertEquals(1, scopes[0].scopeObject().value().a);
|
|
assertEquals(debug.ScopeType.Script, scopes[1].scopeType());
|
|
assertEquals(undefined, scopes[1].scopeObject().value().a);
|
|
assertEquals(debug.ScopeType.Global, scopes[2].scopeType());
|
|
assertEquals(undefined, scopes[2].scopeObject().value().a);
|
|
} catch (e) {
|
|
exception = e;
|
|
}
|
|
}
|
|
|
|
Debug.setListener(listener);
|
|
// Eval inherits strict mode.
|
|
eval("var a = 1; debugger;");
|
|
Debug.setListener(null);
|
|
assertNull(exception);
|