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

Side by Side Diff: src/compiler/typer.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
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/base/flags.h" 5 #include "src/base/flags.h"
6 #include "src/bootstrapper.h" 6 #include "src/bootstrapper.h"
7 #include "src/compiler/graph-reducer.h" 7 #include "src/compiler/graph-reducer.h"
8 #include "src/compiler/js-operator.h" 8 #include "src/compiler/js-operator.h"
9 #include "src/compiler/node.h" 9 #include "src/compiler/node.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 case Runtime::kInlineMathFloor: 1573 case Runtime::kInlineMathFloor:
1574 case Runtime::kInlineMathSqrt: 1574 case Runtime::kInlineMathSqrt:
1575 case Runtime::kInlineMathAcos: 1575 case Runtime::kInlineMathAcos:
1576 case Runtime::kInlineMathAsin: 1576 case Runtime::kInlineMathAsin:
1577 case Runtime::kInlineMathAtan: 1577 case Runtime::kInlineMathAtan:
1578 case Runtime::kInlineMathAtan2: 1578 case Runtime::kInlineMathAtan2:
1579 return Bounds(Type::None(zone()), Type::Number()); 1579 return Bounds(Type::None(zone()), Type::Number());
1580 case Runtime::kInlineMathClz32: 1580 case Runtime::kInlineMathClz32:
1581 return Bounds(Type::None(), Type::Range(0, 32, zone())); 1581 return Bounds(Type::None(), Type::Range(0, 32, zone()));
1582 case Runtime::kInlineStringGetLength: 1582 case Runtime::kInlineStringGetLength:
1583 // The string::length property is always an unsigned smi. 1583 return Bounds(Type::None(), Type::Range(0, String::kMaxLength, zone()));
1584 return Bounds(Type::None(), Type::Intersect(Type::UnsignedSmall(),
1585 Type::TaggedSigned()));
1586 default: 1584 default:
1587 break; 1585 break;
1588 } 1586 }
1589 return Bounds::Unbounded(zone()); 1587 return Bounds::Unbounded(zone());
1590 } 1588 }
1591 1589
1592 1590
1593 Bounds Typer::Visitor::TypeJSStackCheck(Node* node) { 1591 Bounds Typer::Visitor::TypeJSStackCheck(Node* node) {
1594 return Bounds::Unbounded(zone()); 1592 return Bounds::Unbounded(zone());
1595 } 1593 }
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 TYPED_ARRAYS(TYPED_ARRAY_CASE) 2335 TYPED_ARRAYS(TYPED_ARRAY_CASE)
2338 #undef TYPED_ARRAY_CASE 2336 #undef TYPED_ARRAY_CASE
2339 } 2337 }
2340 } 2338 }
2341 return Type::Constant(value, zone()); 2339 return Type::Constant(value, zone());
2342 } 2340 }
2343 2341
2344 } // namespace compiler 2342 } // namespace compiler
2345 } // namespace internal 2343 } // namespace internal
2346 } // namespace v8 2344 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | test/unittests/compiler/js-intrinsic-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698