Commit f289311c authored by yangguo's avatar yangguo Committed by Commit bot

Add regression test for dependency to field type tracked weak map.

TBR=jkummerow@chromium.org
BUG=v8:3969
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#27291}
parent c622cb63
// 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
function Inner() {
this.property = "OK";
this.o2 = 1;
}
function Outer(inner) {
this.inner = inner;
}
var inner = new Inner();
var outer = new Outer(inner);
Outer.prototype.boom = function() {
return this.inner.property;
}
assertEquals("OK", outer.boom());
assertEquals("OK", outer.boom());
%OptimizeFunctionOnNextCall(Outer.prototype.boom);
assertEquals("OK", outer.boom());
inner = undefined;
%SetAllocationTimeout(0 /*interval*/, 2 /*timeout*/);
// Call something that will do GC while holding a handle to outer's map.
// The key is that this lets inner's map die while keeping outer's map alive.
delete outer.inner;
outer = new Outer({field: 1.51, property: "OK"});
assertEquals("OK", outer.boom());
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment