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

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

Issue 2306583002: [turbofan] Fix typing rule for Math.sign. (Closed)
Patch Set: Created 4 years, 3 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/type-cache.h ('k') | test/mjsunit/compiler/regress-math-sign-nan-type.js » ('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 <iomanip> 7 #include <iomanip>
8 8
9 #include "src/base/flags.h" 9 #include "src/base/flags.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 case kMathFround: 1317 case kMathFround:
1318 case kMathLog: 1318 case kMathLog:
1319 case kMathLog1p: 1319 case kMathLog1p:
1320 case kMathLog10: 1320 case kMathLog10:
1321 case kMathLog2: 1321 case kMathLog2:
1322 case kMathSin: 1322 case kMathSin:
1323 case kMathSqrt: 1323 case kMathSqrt:
1324 case kMathTan: 1324 case kMathTan:
1325 return Type::Number(); 1325 return Type::Number();
1326 case kMathSign: 1326 case kMathSign:
1327 return t->cache_.kMinusOneToOne; 1327 return t->cache_.kMinusOneToOneOrMinusZeroOrNaN;
1328 // Binary math functions. 1328 // Binary math functions.
1329 case kMathAtan2: 1329 case kMathAtan2:
1330 case kMathPow: 1330 case kMathPow:
1331 case kMathMax: 1331 case kMathMax:
1332 case kMathMin: 1332 case kMathMin:
1333 return Type::Number(); 1333 return Type::Number();
1334 case kMathImul: 1334 case kMathImul:
1335 return Type::Signed32(); 1335 return Type::Signed32();
1336 case kMathClz32: 1336 case kMathClz32:
1337 return t->cache_.kZeroToThirtyTwo; 1337 return t->cache_.kZeroToThirtyTwo;
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1719 Type* Typer::Visitor::TypeConstant(Handle<Object> value) { 1719 Type* Typer::Visitor::TypeConstant(Handle<Object> value) {
1720 if (Type::IsInteger(*value)) { 1720 if (Type::IsInteger(*value)) {
1721 return Type::Range(value->Number(), value->Number(), zone()); 1721 return Type::Range(value->Number(), value->Number(), zone());
1722 } 1722 }
1723 return Type::Constant(value, zone()); 1723 return Type::Constant(value, zone());
1724 } 1724 }
1725 1725
1726 } // namespace compiler 1726 } // namespace compiler
1727 } // namespace internal 1727 } // namespace internal
1728 } // namespace v8 1728 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/type-cache.h ('k') | test/mjsunit/compiler/regress-math-sign-nan-type.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698