v8/test/mjsunit/constant-fold-control-instructions.js
hablich 1e994192d6 Revert of [regexp] Remove IsRegExp intrinsic (patchset #1 id:1 of https://codereview.chromium.org/2591923003/ )
Reason for revert:
speculative revert: https://codereview.chromium.org/2596013002/

Original issue's description:
> [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-Commit-Position: refs/heads/master@{#41892}
> Committed: c9cb94a06f

TBR=bmeurer@chromium.org,jgruber@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5339

Review-Url: https://codereview.chromium.org/2592383002
Cr-Commit-Position: refs/heads/master@{#41915}
2016-12-22 09:39:37 +00:00

36 lines
920 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(%_IsRegExp(/regexp/));
assertFalse(%_IsRegExp({}));
assertTrue(%_IsArray([1]));
assertFalse(%_IsArray(function() {}));
assertTrue(%_IsJSReceiver(new Date()));
assertFalse(%_IsJSReceiver(1));
}
test();
test();
%OptimizeFunctionOnNextCall(test);
test();