regress-698790.js 620 Bytes
Newer Older
1 2 3 4
// 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.

5
// Flags: --allow-natives-syntax
6 7 8

// Call RegExp constructor with a cons string.

9
var cons_string = %ConstructConsString("", "aaaaaaaaaaaaaa");
10 11 12 13
new RegExp(cons_string);

// Same thing but using TF lowering.

14 15 16 17 18
function make_cons_string(s) {
  return s + 'aaaaaaaaaaaaaa';
};
%PrepareFunctionForOptimization(make_cons_string);
make_cons_string('');
19
%OptimizeFunctionOnNextCall(make_cons_string);
20
var cons_str = make_cons_string("");
21
new RegExp(cons_str);