v8/test/mjsunit/compiler/regress-758096.js
Jaroslav Sevcik 8cf4aafc21 [turbofan] Reland^2 "Polymorphic inlining - try merge map check dispatch with function call dispatch."
This reverts commit e26e6d8857.

Bug: chromium:758096
Change-Id: I1d8ecda995c93c84a9a3c24da041fdb730dbd3b2
Reviewed-on: https://chromium-review.googlesource.com/628169
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47812}
2017-09-05 07:32:16 +00:00

25 lines
473 B
JavaScript

// Copyright 2017 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 x = 1;
x.__proto__.f = function() { return 1; }
function g() {}
g.prototype.f = function() { return 3; };
var y = new g();
function f(obj) {
return obj.f();
}
f(x);
f(y);
f(x);
f(y);
%OptimizeFunctionOnNextCall(f);
assertEquals(1, f(x));
assertEquals(3, f(y));