v8_sanity_checks.js 1.23 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// Copyright 2019 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.

// This file is executed separately before the correctness test case. Add here
// checking of global properties that should never differ in any configuration.
// A difference found in the prints below will prevent any further correctness
// comparison for the selected configurations to avoid flooding bugs.

print("https://crbug.com/932656");
print(Object.getOwnPropertyNames(this));

print("https://crbug.com/935800");
(function () {
  function foo() {
    "use asm";
    function baz() {}
    return {bar: baz};
  }
20
  print(Object.getOwnPropertyNames(foo().bar));
21
})();
22 23 24 25 26 27 28 29 30 31 32

print("https://crbug.com/985154");
(function () {
  "use strict";
  function foo() {
    "use asm";
    function baz() {}
    return {bar: baz};
  }
  print(Object.getOwnPropertyNames(foo().bar));
})();
33 34 35 36 37 38 39 40 41 42 43 44 45

print("Suppresses sensitive natives");
(function () {
  function foo() {}
  %PrepareFunctionForOptimization(foo);
  foo();
  foo();
  %OptimizeFunctionOnNextCall(foo);
  foo();
  print(%GetOptimizationStatus(foo));
  const fun = new Function("f", "sync", "return %GetOptimizationStatus(f);");
  print(fun(foo));
})();