diff options
Diffstat (limited to 'deps/v8/test/unittests/compiler/js-intrinsic-lowering-unittest.cc')
-rw-r--r-- | deps/v8/test/unittests/compiler/js-intrinsic-lowering-unittest.cc | 75 |
1 files changed, 21 insertions, 54 deletions
diff --git a/deps/v8/test/unittests/compiler/js-intrinsic-lowering-unittest.cc b/deps/v8/test/unittests/compiler/js-intrinsic-lowering-unittest.cc index 919c1b2237..de0eefc531 100644 --- a/deps/v8/test/unittests/compiler/js-intrinsic-lowering-unittest.cc +++ b/deps/v8/test/unittests/compiler/js-intrinsic-lowering-unittest.cc @@ -91,7 +91,8 @@ TEST_F(JSIntrinsicLoweringTest, InlineOptimizedDoubleLo) { graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineDoubleLo, 1), input, context, effect, control)); ASSERT_TRUE(r.Changed()); - EXPECT_THAT(r.replacement(), IsFloat64ExtractLowWord32(input)); + EXPECT_THAT(r.replacement(), + IsFloat64ExtractLowWord32(IsGuard(Type::Number(), input, _))); } @@ -108,7 +109,8 @@ TEST_F(JSIntrinsicLoweringTest, InlineOptimizedDoubleHi) { graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineDoubleHi, 1), input, context, effect, control)); ASSERT_TRUE(r.Changed()); - EXPECT_THAT(r.replacement(), IsFloat64ExtractHighWord32(input)); + EXPECT_THAT(r.replacement(), + IsFloat64ExtractHighWord32(IsGuard(Type::Number(), input, _))); } @@ -240,58 +242,6 @@ TEST_F(JSIntrinsicLoweringTest, InlineIsJSReceiver) { // ----------------------------------------------------------------------------- -// %_MathFloor - - -TEST_F(JSIntrinsicLoweringTest, InlineMathFloor) { - Node* const input = Parameter(0); - Node* const context = Parameter(1); - Node* const effect = graph()->start(); - Node* const control = graph()->start(); - Reduction const r = Reduce( - graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathFloor, 1), - input, context, effect, control), - MachineOperatorBuilder::kFloat64RoundDown); - ASSERT_TRUE(r.Changed()); - EXPECT_THAT(r.replacement(), IsFloat64RoundDown(input)); -} - - -// ----------------------------------------------------------------------------- -// %_MathSqrt - - -TEST_F(JSIntrinsicLoweringTest, InlineMathSqrt) { - Node* const input = Parameter(0); - Node* const context = Parameter(1); - Node* const effect = graph()->start(); - Node* const control = graph()->start(); - Reduction const r = Reduce( - graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathSqrt, 1), - input, context, effect, control)); - ASSERT_TRUE(r.Changed()); - EXPECT_THAT(r.replacement(), IsFloat64Sqrt(input)); -} - - -// ----------------------------------------------------------------------------- -// %_MathClz32 - - -TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) { - Node* const input = Parameter(0); - Node* const context = Parameter(1); - Node* const effect = graph()->start(); - Node* const control = graph()->start(); - Reduction const r = Reduce( - graph()->NewNode(javascript()->CallRuntime(Runtime::kInlineMathClz32, 1), - input, context, effect, control)); - ASSERT_TRUE(r.Changed()); - EXPECT_THAT(r.replacement(), IsWord32Clz(input)); -} - - -// ----------------------------------------------------------------------------- // %_ValueOf @@ -334,6 +284,23 @@ TEST_F(JSIntrinsicLoweringTest, InlineValueOf) { AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); } +// ----------------------------------------------------------------------------- +// %_GetOrdinaryHasInstance + +TEST_F(JSIntrinsicLoweringTest, InlineGetOrdinaryHasInstance) { + Node* const context = Parameter(0); + Node* const effect = graph()->start(); + Node* const control = graph()->start(); + Reduction const r = Reduce(graph()->NewNode( + javascript()->CallRuntime(Runtime::kInlineGetOrdinaryHasInstance, 0), + context, effect, control)); + ASSERT_TRUE(r.Changed()); + EXPECT_THAT( + r.replacement(), + IsLoadContext( + ContextAccess(0, Context::ORDINARY_HAS_INSTANCE_INDEX, true), _)); +} + } // namespace compiler } // namespace internal } // namespace v8 |