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

Side by Side Diff: src/compiler/typer.cc

Issue 1701673002: [turbofan] Assign better types to various String builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | src/objects.h » ('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/typer.h" 5 #include "src/compiler/typer.h"
6 6
7 #include "src/base/flags.h" 7 #include "src/base/flags.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/compilation-dependencies.h" 9 #include "src/compilation-dependencies.h"
10 #include "src/compiler/common-operator.h" 10 #include "src/compiler/common-operator.h"
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 case kMathAtan2: 1522 case kMathAtan2:
1523 case kMathPow: 1523 case kMathPow:
1524 case kMathMax: 1524 case kMathMax:
1525 case kMathMin: 1525 case kMathMin:
1526 return Type::Number(); 1526 return Type::Number();
1527 case kMathImul: 1527 case kMathImul:
1528 return Type::Signed32(); 1528 return Type::Signed32();
1529 case kMathClz32: 1529 case kMathClz32:
1530 return t->cache_.kZeroToThirtyTwo; 1530 return t->cache_.kZeroToThirtyTwo;
1531 // String functions. 1531 // String functions.
1532 case kStringCharCodeAt:
1533 return Type::Union(Type::Range(0, kMaxUInt16, t->zone()), Type::NaN(),
1534 t->zone());
1532 case kStringCharAt: 1535 case kStringCharAt:
1536 case kStringConcat:
1533 case kStringFromCharCode: 1537 case kStringFromCharCode:
1538 case kStringToLowerCase:
1539 case kStringToUpperCase:
1534 return Type::String(); 1540 return Type::String();
1535 // Array functions. 1541 // Array functions.
1536 case kArrayIndexOf: 1542 case kArrayIndexOf:
1537 case kArrayLastIndexOf: 1543 case kArrayLastIndexOf:
1538 return Type::Number(); 1544 return Type::Number();
1539 default: 1545 default:
1540 break; 1546 break;
1541 } 1547 }
1542 } 1548 }
1543 } 1549 }
(...skipping 29 matching lines...) Expand all
1573 case Runtime::kInlineMathAsin: 1579 case Runtime::kInlineMathAsin:
1574 case Runtime::kInlineMathAtan: 1580 case Runtime::kInlineMathAtan:
1575 case Runtime::kInlineMathAtan2: 1581 case Runtime::kInlineMathAtan2:
1576 return Type::Number(); 1582 return Type::Number();
1577 case Runtime::kInlineMathClz32: 1583 case Runtime::kInlineMathClz32:
1578 return Type::Range(0, 32, zone()); 1584 return Type::Range(0, 32, zone());
1579 case Runtime::kInlineCreateIterResultObject: 1585 case Runtime::kInlineCreateIterResultObject:
1580 case Runtime::kInlineRegExpConstructResult: 1586 case Runtime::kInlineRegExpConstructResult:
1581 return Type::OtherObject(); 1587 return Type::OtherObject();
1582 case Runtime::kInlineSubString: 1588 case Runtime::kInlineSubString:
1589 case Runtime::kInlineStringCharFromCode:
1583 return Type::String(); 1590 return Type::String();
1584 case Runtime::kInlineToInteger: 1591 case Runtime::kInlineToInteger:
1585 return TypeUnaryOp(node, ToInteger); 1592 return TypeUnaryOp(node, ToInteger);
1586 case Runtime::kInlineToLength: 1593 case Runtime::kInlineToLength:
1587 return TypeUnaryOp(node, ToLength); 1594 return TypeUnaryOp(node, ToLength);
1588 case Runtime::kInlineToName: 1595 case Runtime::kInlineToName:
1589 return TypeUnaryOp(node, ToName); 1596 return TypeUnaryOp(node, ToName);
1590 case Runtime::kInlineToNumber: 1597 case Runtime::kInlineToNumber:
1591 return TypeUnaryOp(node, ToNumber); 1598 return TypeUnaryOp(node, ToNumber);
1592 case Runtime::kInlineToObject: 1599 case Runtime::kInlineToObject:
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
2423 } 2430 }
2424 if (Type::IsInteger(*value)) { 2431 if (Type::IsInteger(*value)) {
2425 return Type::Range(value->Number(), value->Number(), zone()); 2432 return Type::Range(value->Number(), value->Number(), zone());
2426 } 2433 }
2427 return Type::Constant(value, zone()); 2434 return Type::Constant(value, zone());
2428 } 2435 }
2429 2436
2430 } // namespace compiler 2437 } // namespace compiler
2431 } // namespace internal 2438 } // namespace internal
2432 } // namespace v8 2439 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698