Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: test/cctest/compiler/test-js-context-specialization.cc

Issue 2059173002: Reland of place all remaining Oddball checks with new function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/cctest/heap/test-alloc.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/js-operator.h" 7 #include "src/compiler/js-operator.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 #include "src/compiler/source-position.h" 10 #include "src/compiler/source-position.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 T.CheckCall(-10.5, 1.0, 0.0); 218 T.CheckCall(-10.5, 1.0, 0.0);
219 T.CheckCall(-10.4, 1.1, 0.0); 219 T.CheckCall(-10.4, 1.1, 0.0);
220 } 220 }
221 221
222 222
223 TEST(SpecializeJSFunction_ToConstant_uninit) { 223 TEST(SpecializeJSFunction_ToConstant_uninit) {
224 { 224 {
225 FunctionTester T( 225 FunctionTester T(
226 "(function() { if (false) { var x = 1; } function inc(a)" 226 "(function() { if (false) { var x = 1; } function inc(a)"
227 " { return x; } return inc; })()"); // x is undefined! 227 " { return x; } return inc; })()"); // x is undefined!
228 228 i::Isolate* isolate = CcTest::i_isolate();
229 CHECK(T.Call(T.Val(0.0), T.Val(0.0)).ToHandleChecked()->IsUndefined()); 229 CHECK(
230 CHECK(T.Call(T.Val(2.0), T.Val(0.0)).ToHandleChecked()->IsUndefined()); 230 T.Call(T.Val(0.0), T.Val(0.0)).ToHandleChecked()->IsUndefined(isolate));
231 CHECK(T.Call(T.Val(-2.1), T.Val(0.0)).ToHandleChecked()->IsUndefined()); 231 CHECK(
232 T.Call(T.Val(2.0), T.Val(0.0)).ToHandleChecked()->IsUndefined(isolate));
233 CHECK(T.Call(T.Val(-2.1), T.Val(0.0))
234 .ToHandleChecked()
235 ->IsUndefined(isolate));
232 } 236 }
233 237
234 { 238 {
235 FunctionTester T( 239 FunctionTester T(
236 "(function() { if (false) { var x = 1; } function inc(a)" 240 "(function() { if (false) { var x = 1; } function inc(a)"
237 " { return a + x; } return inc; })()"); // x is undefined! 241 " { return a + x; } return inc; })()"); // x is undefined!
238 242
239 CHECK(T.Call(T.Val(0.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); 243 CHECK(T.Call(T.Val(0.0), T.Val(0.0)).ToHandleChecked()->IsNaN());
240 CHECK(T.Call(T.Val(2.0), T.Val(0.0)).ToHandleChecked()->IsNaN()); 244 CHECK(T.Call(T.Val(2.0), T.Val(0.0)).ToHandleChecked()->IsNaN());
241 CHECK(T.Call(T.Val(-2.1), T.Val(0.0)).ToHandleChecked()->IsNaN()); 245 CHECK(T.Call(T.Val(-2.1), T.Val(0.0)).ToHandleChecked()->IsNaN());
242 } 246 }
243 } 247 }
244 248
245 } // namespace compiler 249 } // namespace compiler
246 } // namespace internal 250 } // namespace internal
247 } // namespace v8 251 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/wasm-module.cc ('k') | test/cctest/heap/test-alloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698