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

Unified Diff: src/typing-asm.cc

Issue 1794303002: Fixing +fround(x) in asm typer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typing-asm.cc
diff --git a/src/typing-asm.cc b/src/typing-asm.cc
index ed5b02ef0f9aa8edb43531cd91e59bb7ee2ed150..12659f28b8f544c9f90167fc7129f08a781927df 100644
--- a/src/typing-asm.cc
+++ b/src/typing-asm.cc
@@ -1159,7 +1159,9 @@ void AsmTyper::VisitBinaryOperation(BinaryOperation* expr) {
// BIT_OR allows Any since it is used as a type coercion.
VisitIntegerBitwiseOperator(expr, Type::Any(), cache_.kAsmIntQ,
cache_.kAsmSigned, true);
- if (expr->left()->IsCall() && expr->op() == Token::BIT_OR) {
+ if (expr->left()->IsCall() && expr->op() == Token::BIT_OR &&
+ Type::Number()->Is(expr->left()->bounds().upper)) {
+ // Force the return types of foreign functions.
expr->left()->set_bounds(Bounds(cache_.kAsmSigned));
}
return;
@@ -1253,7 +1255,9 @@ void AsmTyper::VisitBinaryOperation(BinaryOperation* expr) {
} else if (expr->op() == Token::MUL && expr->right()->IsLiteral() &&
right_type->Is(cache_.kAsmDouble)) {
// For unary +, expressed as x * 1.0
- if (expr->left()->IsCall() && expr->op() == Token::MUL) {
+ if (expr->left()->IsCall() && expr->op() == Token::MUL &&
+ Type::Number()->Is(expr->left()->bounds().upper)) {
+ // Force the return types of foreign functions.
expr->left()->set_bounds(Bounds(cache_.kAsmDouble));
}
IntersectResult(expr, cache_.kAsmDouble);
« no previous file with comments | « no previous file | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698