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

Side by Side Diff: test/unittests/compiler/js-intrinsic-lowering-unittest.cc

Issue 1057813002: Fixed the range information for string lengths. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/compiler/typer.cc ('k') | test/unittests/compiler/js-typed-lowering-unittest.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/diamond.h" 6 #include "src/compiler/diamond.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/js-intrinsic-lowering.h" 8 #include "src/compiler/js-intrinsic-lowering.h"
9 #include "src/compiler/js-operator.h" 9 #include "src/compiler/js-operator.h"
10 #include "test/unittests/compiler/graph-unittest.h" 10 #include "test/unittests/compiler/graph-unittest.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 309
310 TEST_F(JSIntrinsicLoweringTest, InlineStringGetLength) { 310 TEST_F(JSIntrinsicLoweringTest, InlineStringGetLength) {
311 Node* const input = Parameter(0); 311 Node* const input = Parameter(0);
312 Node* const context = Parameter(1); 312 Node* const context = Parameter(1);
313 Node* const effect = graph()->start(); 313 Node* const effect = graph()->start();
314 Node* const control = graph()->start(); 314 Node* const control = graph()->start();
315 Reduction const r = Reduce(graph()->NewNode( 315 Reduction const r = Reduce(graph()->NewNode(
316 javascript()->CallRuntime(Runtime::kInlineStringGetLength, 1), input, 316 javascript()->CallRuntime(Runtime::kInlineStringGetLength, 1), input,
317 context, effect, control)); 317 context, effect, control));
318 ASSERT_TRUE(r.Changed()); 318 ASSERT_TRUE(r.Changed());
319 EXPECT_THAT(r.replacement(), IsLoadField(AccessBuilder::ForStringLength(), 319 EXPECT_THAT(r.replacement(),
320 input, effect, control)); 320 IsLoadField(AccessBuilder::ForStringLength(zone()), input, effect,
321 control));
321 } 322 }
322 323
323 324
324 // ----------------------------------------------------------------------------- 325 // -----------------------------------------------------------------------------
325 // %_MathClz32 326 // %_MathClz32
326 327
327 328
328 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) { 329 TEST_F(JSIntrinsicLoweringTest, InlineMathClz32) {
329 Node* const input = Parameter(0); 330 Node* const input = Parameter(0);
330 Node* const context = Parameter(1); 331 Node* const context = Parameter(1);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 CaptureEq(&if_false0)))))), 401 CaptureEq(&if_false0)))))),
401 IsMerge( 402 IsMerge(
402 IsIfTrue(AllOf(CaptureEq(&branch0), 403 IsIfTrue(AllOf(CaptureEq(&branch0),
403 IsBranch(IsObjectIsSmi(input), control))), 404 IsBranch(IsObjectIsSmi(input), control))),
404 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0)))))); 405 AllOf(CaptureEq(&if_false0), IsIfFalse(CaptureEq(&branch0))))));
405 } 406 }
406 407
407 } // namespace compiler 408 } // namespace compiler
408 } // namespace internal 409 } // namespace internal
409 } // namespace v8 410 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/typer.cc ('k') | test/unittests/compiler/js-typed-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698