OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/js-context-specialization.h" | 5 #include "src/compiler/js-context-specialization.h" |
6 #include "src/compiler/js-operator.h" | 6 #include "src/compiler/js-operator.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/compiler/source-position.h" | 9 #include "src/compiler/source-position.h" |
10 #include "test/cctest/cctest.h" | 10 #include "test/cctest/cctest.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 Node* effect_use = other_load; | 215 Node* effect_use = other_load; |
216 Node* other_use = | 216 Node* other_use = |
217 t.graph()->NewNode(t.simplified()->ChangeTaggedToInt32(), other_load); | 217 t.graph()->NewNode(t.simplified()->ChangeTaggedToInt32(), other_load); |
218 | 218 |
219 Node* add = | 219 Node* add = |
220 t.graph()->NewNode(t.javascript()->Add(LanguageMode::SLOPPY), value_use, | 220 t.graph()->NewNode(t.javascript()->Add(LanguageMode::SLOPPY), value_use, |
221 other_use, param_context, other_load, start); | 221 other_use, param_context, other_load, start); |
222 | 222 |
223 Node* ret = | 223 Node* ret = |
224 t.graph()->NewNode(t.common()->Return(), add, effect_use, start); | 224 t.graph()->NewNode(t.common()->Return(), add, effect_use, start); |
225 Node* end = t.graph()->NewNode(t.common()->End(), ret); | 225 Node* end = t.graph()->NewNode(t.common()->End(1), ret); |
226 USE(end); | 226 USE(end); |
227 t.graph()->SetEnd(end); | 227 t.graph()->SetEnd(end); |
228 | 228 |
229 // Double check the above graph is what we expect, or the test is broken. | 229 // Double check the above graph is what we expect, or the test is broken. |
230 CheckEffectInput(effect_in, load); | 230 CheckEffectInput(effect_in, load); |
231 CheckEffectInput(load, effect_use); | 231 CheckEffectInput(load, effect_use); |
232 | 232 |
233 // Perform the reduction on the entire graph. | 233 // Perform the reduction on the entire graph. |
234 GraphReducer graph_reducer(t.graph(), t.main_zone()); | 234 GraphReducer graph_reducer(t.graph(), t.main_zone()); |
235 graph_reducer.AddReducer(&spec); | 235 graph_reducer.AddReducer(&spec); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 { | 298 { |
299 FunctionTester T( | 299 FunctionTester T( |
300 "(function() { if (false) { var x = 1; } function inc(a)" | 300 "(function() { if (false) { var x = 1; } function inc(a)" |
301 " { return a + x; } return inc; })()"); // x is undefined! | 301 " { return a + x; } return inc; })()"); // x is undefined! |
302 | 302 |
303 CHECK(T.Call(T.Val(0.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); | 303 CHECK(T.Call(T.Val(0.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); |
304 CHECK(T.Call(T.Val(2.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); | 304 CHECK(T.Call(T.Val(2.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); |
305 CHECK(T.Call(T.Val(-2.1), T.Val(0.0)).ToHandleChecked()->IsNaN()); | 305 CHECK(T.Call(T.Val(-2.1), T.Val(0.0)).ToHandleChecked()->IsNaN()); |
306 } | 306 } |
307 } | 307 } |
OLD | NEW |