| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 const_context, const_context, effect_in); | 207 const_context, const_context, effect_in); |
| 208 | 208 |
| 209 | 209 |
| 210 Node* value_use = t.NewNode(t.simplified()->ChangeTaggedToInt32(), load); | 210 Node* value_use = t.NewNode(t.simplified()->ChangeTaggedToInt32(), load); |
| 211 Node* other_load = t.NewNode(t.javascript()->LoadContext(0, slot, true), | 211 Node* other_load = t.NewNode(t.javascript()->LoadContext(0, slot, true), |
| 212 param_context, param_context, load); | 212 param_context, param_context, load); |
| 213 Node* effect_use = other_load; | 213 Node* effect_use = other_load; |
| 214 Node* other_use = | 214 Node* other_use = |
| 215 t.NewNode(t.simplified()->ChangeTaggedToInt32(), other_load); | 215 t.NewNode(t.simplified()->ChangeTaggedToInt32(), other_load); |
| 216 | 216 |
| 217 Node* add = t.NewNode(t.javascript()->Add(), value_use, other_use, | 217 Node* add = t.NewNode(t.javascript()->Add(LanguageMode::SLOPPY), value_use, |
| 218 param_context, other_load, start); | 218 other_use, param_context, other_load, start); |
| 219 | 219 |
| 220 Node* ret = t.NewNode(t.common()->Return(), add, effect_use, start); | 220 Node* ret = t.NewNode(t.common()->Return(), add, effect_use, start); |
| 221 Node* end = t.NewNode(t.common()->End(), ret); | 221 Node* end = t.NewNode(t.common()->End(), ret); |
| 222 USE(end); | 222 USE(end); |
| 223 t.graph()->SetEnd(end); | 223 t.graph()->SetEnd(end); |
| 224 | 224 |
| 225 // Double check the above graph is what we expect, or the test is broken. | 225 // Double check the above graph is what we expect, or the test is broken. |
| 226 CheckEffectInput(effect_in, load); | 226 CheckEffectInput(effect_in, load); |
| 227 CheckEffectInput(load, effect_use); | 227 CheckEffectInput(load, effect_use); |
| 228 | 228 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 { | 294 { |
| 295 FunctionTester T( | 295 FunctionTester T( |
| 296 "(function() { if (false) { var x = 1; } function inc(a)" | 296 "(function() { if (false) { var x = 1; } function inc(a)" |
| 297 " { return a + x; } return inc; })()"); // x is undefined! | 297 " { return a + x; } return inc; })()"); // x is undefined! |
| 298 | 298 |
| 299 CHECK(T.Call(T.Val(0.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); | 299 CHECK(T.Call(T.Val(0.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); |
| 300 CHECK(T.Call(T.Val(2.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); | 300 CHECK(T.Call(T.Val(2.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); |
| 301 CHECK(T.Call(T.Val(-2.1), T.Val(0.0)).ToHandleChecked()->IsNaN()); | 301 CHECK(T.Call(T.Val(-2.1), T.Val(0.0)).ToHandleChecked()->IsNaN()); |
| 302 } | 302 } |
| 303 } | 303 } |
| OLD | NEW |