Commit 2e4e43a2 authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Add frame state to the PlainPrimitiveToNumber unit test.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/792043007

Cr-Commit-Position: refs/heads/master@{#26113}
parent 459c45db
...@@ -80,6 +80,12 @@ class JSTypedLoweringTest : public TypedGraphTest { ...@@ -80,6 +80,12 @@ class JSTypedLoweringTest : public TypedGraphTest {
return reducer.Reduce(node); return reducer.Reduce(node);
} }
Node* EmptyFrameState() {
MachineOperatorBuilder machine(zone());
JSGraph jsgraph(graph(), common(), javascript(), &machine);
return jsgraph.EmptyFrameState();
}
Handle<JSArrayBuffer> NewArrayBuffer(void* bytes, size_t byte_length) { Handle<JSArrayBuffer> NewArrayBuffer(void* bytes, size_t byte_length) {
Handle<JSArrayBuffer> buffer = factory()->NewJSArrayBuffer(); Handle<JSArrayBuffer> buffer = factory()->NewJSArrayBuffer();
Runtime::SetupArrayBuffer(isolate(), buffer, true, bytes, byte_length); Runtime::SetupArrayBuffer(isolate(), buffer, true, bytes, byte_length);
...@@ -369,8 +375,12 @@ TEST_F(JSTypedLoweringTest, JSToNumberWithPlainPrimitive) { ...@@ -369,8 +375,12 @@ TEST_F(JSTypedLoweringTest, JSToNumberWithPlainPrimitive) {
Node* const context = Parameter(Type::Any(), 1); Node* const context = Parameter(Type::Any(), 1);
Node* const effect = graph()->start(); Node* const effect = graph()->start();
Node* const control = graph()->start(); Node* const control = graph()->start();
Reduction r = Reduce(graph()->NewNode(javascript()->ToNumber(), input, Reduction r =
context, effect, control)); FLAG_turbo_deoptimization
? Reduce(graph()->NewNode(javascript()->ToNumber(), input, context,
EmptyFrameState(), effect, control))
: Reduce(graph()->NewNode(javascript()->ToNumber(), input, context,
effect, control));
ASSERT_TRUE(r.Changed()); ASSERT_TRUE(r.Changed());
EXPECT_THAT(r.replacement(), IsToNumber(input, IsNumberConstant(BitEq(0.0)), EXPECT_THAT(r.replacement(), IsToNumber(input, IsNumberConstant(BitEq(0.0)),
graph()->start(), control)); graph()->start(), control));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment