OLD | NEW |
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/typing-asm.h" | 5 #include "src/typing-asm.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 return; | 1251 return; |
1252 } | 1252 } |
1253 } else if (expr->op() == Token::MUL && expr->right()->IsLiteral() && | 1253 } else if (expr->op() == Token::MUL && expr->right()->IsLiteral() && |
1254 right_type->Is(cache_.kAsmDouble)) { | 1254 right_type->Is(cache_.kAsmDouble)) { |
1255 // For unary +, expressed as x * 1.0 | 1255 // For unary +, expressed as x * 1.0 |
1256 if (expr->left()->IsCall() && expr->op() == Token::MUL) { | 1256 if (expr->left()->IsCall() && expr->op() == Token::MUL) { |
1257 expr->left()->set_bounds(Bounds(cache_.kAsmDouble)); | 1257 expr->left()->set_bounds(Bounds(cache_.kAsmDouble)); |
1258 } | 1258 } |
1259 IntersectResult(expr, cache_.kAsmDouble); | 1259 IntersectResult(expr, cache_.kAsmDouble); |
1260 return; | 1260 return; |
| 1261 } else if (expr->op() == Token::MUL && left_type->Is(cache_.kAsmDouble) && |
| 1262 expr->right()->IsLiteral() && |
| 1263 !expr->right()->AsLiteral()->raw_value()->ContainsDot() && |
| 1264 expr->right()->AsLiteral()->raw_value()->AsNumber() == -1.0) { |
| 1265 // For unary -, expressed as x * -1 |
| 1266 expr->right()->set_bounds(Bounds(cache_.kAsmDouble)); |
| 1267 IntersectResult(expr, cache_.kAsmDouble); |
| 1268 return; |
1261 } else if (type->Is(cache_.kAsmFloat) && expr->op() != Token::MOD) { | 1269 } else if (type->Is(cache_.kAsmFloat) && expr->op() != Token::MOD) { |
1262 if (left_intish != 0 || right_intish != 0) { | 1270 if (left_intish != 0 || right_intish != 0) { |
1263 FAIL(expr, "float operation before required fround"); | 1271 FAIL(expr, "float operation before required fround"); |
1264 } | 1272 } |
1265 IntersectResult(expr, cache_.kAsmFloat); | 1273 IntersectResult(expr, cache_.kAsmFloat); |
1266 intish_ = 1; | 1274 intish_ = 1; |
1267 return; | 1275 return; |
1268 } else if (type->Is(cache_.kAsmDouble)) { | 1276 } else if (type->Is(cache_.kAsmDouble)) { |
1269 IntersectResult(expr, cache_.kAsmDouble); | 1277 IntersectResult(expr, cache_.kAsmDouble); |
1270 return; | 1278 return; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 } | 1568 } |
1561 | 1569 |
1562 | 1570 |
1563 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { | 1571 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { |
1564 RECURSE(Visit(expr->expression())); | 1572 RECURSE(Visit(expr->expression())); |
1565 } | 1573 } |
1566 | 1574 |
1567 | 1575 |
1568 } // namespace internal | 1576 } // namespace internal |
1569 } // namespace v8 | 1577 } // namespace v8 |
OLD | NEW |