[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}
This commit is contained in:
jarin 2015-01-16 14:21:08 -08:00 committed by Commit bot
parent 459c45db0a
commit 2e4e43a2dc

View File

@ -80,6 +80,12 @@ class JSTypedLoweringTest : public TypedGraphTest {
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> buffer = factory()->NewJSArrayBuffer();
Runtime::SetupArrayBuffer(isolate(), buffer, true, bytes, byte_length);
@ -369,8 +375,12 @@ TEST_F(JSTypedLoweringTest, JSToNumberWithPlainPrimitive) {
Node* const context = Parameter(Type::Any(), 1);
Node* const effect = graph()->start();
Node* const control = graph()->start();
Reduction r = Reduce(graph()->NewNode(javascript()->ToNumber(), input,
context, effect, control));
Reduction r =
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());
EXPECT_THAT(r.replacement(), IsToNumber(input, IsNumberConstant(BitEq(0.0)),
graph()->start(), control));