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

Unified Diff: src/typing-asm.cc

Issue 1804243003: Fix conversion to float32, typing issue, split apart asm-wasm tests. (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 | src/wasm/asm-wasm-builder.cc » ('j') | src/wasm/asm-wasm-builder.cc » ('J')
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 986926f5a794c7c2d8bd245402529e24db88636e..af67a9e0c2200d2ccea803f3e25d4a6b6bbdbd42 100644
--- a/src/typing-asm.cc
+++ b/src/typing-asm.cc
@@ -988,8 +988,16 @@ void AsmTyper::VisitCall(Call* expr) {
}
}
// Handle polymorphic stdlib functions specially.
- if (standard_member == kMathCeil || standard_member == kMathFloor ||
- standard_member == kMathSqrt) {
+ if (standard_member == kMathFround) {
+ if (!args->at(0)->bounds().upper->Is(cache_.kAsmFloat) &&
titzer 2016/03/21 07:59:44 Cache args->at(0)->bounds().upper?
bradn 2016/03/21 20:31:08 Done.
+ !args->at(0)->bounds().upper->Is(cache_.kAsmDouble) &&
+ !args->at(0)->bounds().upper->Is(cache_.kAsmSigned) &&
+ !args->at(0)->bounds().upper->Is(cache_.kAsmUnsigned)) {
+ FAIL(expr, "illegal function argument type");
+ }
+ } else if (standard_member == kMathCeil ||
+ standard_member == kMathFloor ||
+ standard_member == kMathSqrt) {
if (!args->at(0)->bounds().upper->Is(cache_.kAsmFloat) &&
!args->at(0)->bounds().upper->Is(cache_.kAsmDouble)) {
FAIL(expr, "illegal function argument type");
@@ -1156,13 +1164,16 @@ void AsmTyper::VisitBinaryOperation(BinaryOperation* expr) {
FAIL(expr, "illegal logical operator");
case Token::BIT_OR: {
// BIT_OR allows Any since it is used as a type coercion.
- VisitIntegerBitwiseOperator(expr, Type::Any(), cache_.kAsmIntQ,
- cache_.kAsmSigned, true);
+ RECURSE(VisitIntegerBitwiseOperator(expr, Type::Any(), cache_.kAsmIntQ,
+ cache_.kAsmSigned, true));
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));
}
+ if (in_function_ && !expr->left()->bounds().upper->Is(cache_.kAsmIntQ)) {
+ FAIL(expr->left(), "intish required");
+ }
return;
}
case Token::BIT_XOR: {
@@ -1180,20 +1191,20 @@ void AsmTyper::VisitBinaryOperation(BinaryOperation* expr) {
}
}
// BIT_XOR allows Any since it is used as a type coercion (via ~~).
- VisitIntegerBitwiseOperator(expr, Type::Any(), cache_.kAsmIntQ,
- cache_.kAsmSigned, true);
+ RECURSE(VisitIntegerBitwiseOperator(expr, Type::Any(), cache_.kAsmIntQ,
+ cache_.kAsmSigned, true));
return;
}
case Token::SHR: {
- VisitIntegerBitwiseOperator(expr, cache_.kAsmIntQ, cache_.kAsmIntQ,
- cache_.kAsmUnsigned, false);
+ RECURSE(VisitIntegerBitwiseOperator(
+ expr, cache_.kAsmIntQ, cache_.kAsmIntQ, cache_.kAsmUnsigned, false));
return;
}
case Token::SHL:
case Token::SAR:
case Token::BIT_AND: {
- VisitIntegerBitwiseOperator(expr, cache_.kAsmIntQ, cache_.kAsmIntQ,
- cache_.kAsmSigned, false);
+ RECURSE(VisitIntegerBitwiseOperator(
+ expr, cache_.kAsmIntQ, cache_.kAsmIntQ, cache_.kAsmSigned, false));
return;
}
case Token::ADD:
« no previous file with comments | « no previous file | src/wasm/asm-wasm-builder.cc » ('j') | src/wasm/asm-wasm-builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698