v8/test/mjsunit/constant-fold-control-instructions.js
jgruber 9e65ecd957 [regexp] Remove IsRegExp intrinsic
The two remaining uses of this intrinsic in debug.js and mirrors.js now
simply rely on the runtime function.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2591923003
Cr-Original-Commit-Position: refs/heads/master@{#41892}
Committed: c9cb94a06f
Review-Url: https://codereview.chromium.org/2591923003
Cr-Commit-Position: refs/heads/master@{#42128}
2017-01-09 09:34:48 +00:00

33 lines
852 B
JavaScript

// Copyright 2014 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 --fold-constants
function test() {
assertEquals("string", typeof "");
assertEquals("number", typeof 1.1);
assertEquals("number", typeof 1);
assertEquals("boolean", typeof true);
assertEquals("function", typeof function() {});
assertEquals("object", typeof null);
assertEquals("object", typeof {});
assertEquals("object", typeof /regex/);
assertTrue(%_IsSmi(1));
assertFalse(%_IsSmi(1.1));
assertFalse(%_IsSmi({}));
assertTrue(%_IsArray([1]));
assertFalse(%_IsArray(function() {}));
assertTrue(%_IsJSReceiver(new Date()));
assertFalse(%_IsJSReceiver(1));
}
test();
test();
%OptimizeFunctionOnNextCall(test);
test();