Commit 83744a4b authored by bradnelson's avatar bradnelson Committed by Commit bot

Switching foreign function to be marked as functions at call sites.

On further reflection, marking the variable proxy at call sites
for foreign functions as a function is ok. Switching this.

Fixed a few IntersectResults that probably should be an explicit set_bounds.

BUG= https://code.google.com/p/v8/issues/detail?id=4203
TEST=test-asm-validator
R=aseemgarg@chromium.org,titzer@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/1656493002

Cr-Commit-Position: refs/heads/master@{#33623}
parent 43be9698
......@@ -1000,6 +1000,7 @@ void AsmTyper::VisitCall(Call* expr) {
}
}
intish_ = kMaxUncombinedAdditiveSteps;
expr->expression()->set_bounds(Bounds(Type::Function(zone())));
IntersectResult(expr, expected_type);
} else {
FAIL(expr, "invalid callee");
......@@ -1135,7 +1136,7 @@ void AsmTyper::VisitBinaryOperation(BinaryOperation* expr) {
VisitIntegerBitwiseOperator(expr, Type::Any(zone()), cache_.kAsmInt,
cache_.kAsmSigned, true);
if (expr->left()->IsCall() && expr->op() == Token::BIT_OR) {
IntersectResult(expr->left(), cache_.kAsmSigned);
expr->left()->set_bounds(Bounds(cache_.kAsmSigned));
}
return;
}
......@@ -1224,7 +1225,7 @@ void AsmTyper::VisitBinaryOperation(BinaryOperation* expr) {
right_type->Is(cache_.kAsmDouble)) {
// For unary +, expressed as x * 1.0
if (expr->left()->IsCall() && expr->op() == Token::MUL) {
IntersectResult(expr->left(), cache_.kAsmDouble);
expr->left()->set_bounds(Bounds(cache_.kAsmDouble));
}
IntersectResult(expr, cache_.kAsmDouble);
return;
......
......@@ -16,6 +16,7 @@
#include "test/cctest/expression-type-collector-macros.h"
// Macros for function types.
#define FUNC_BARE_TYPE Bounds(Type::Function(zone))
#define FUNC_V_TYPE Bounds(Type::Function(Type::Undefined(zone), zone))
#define FUNC_I_TYPE Bounds(Type::Function(cache.kAsmSigned, zone))
#define FUNC_F_TYPE Bounds(Type::Function(cache.kAsmFloat, zone))
......@@ -1727,7 +1728,7 @@ TEST(ForeignFunction) {
CHECK_EXPR(FunctionLiteral, FUNC_I_TYPE) {
CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) {
CHECK_EXPR(Call, Bounds(cache.kAsmSigned)) {
CHECK_VAR(baz, Bounds(Type::Any(zone)));
CHECK_VAR(baz, FUNC_BARE_TYPE);
CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
}
......@@ -2128,7 +2129,7 @@ TEST(Imports) {
CHECK_EXPR(FunctionLiteral, FUNC_I_TYPE) {
CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) {
CHECK_EXPR(Call, Bounds(cache.kAsmSigned)) {
CHECK_VAR(ffunc, Bounds(Type::Any(zone)));
CHECK_VAR(ffunc, FUNC_BARE_TYPE);
CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) {
CHECK_VAR(fint, Bounds(cache.kAsmInt));
CHECK_EXPR(Literal, Bounds(cache.kAsmFixnum));
......@@ -2142,7 +2143,7 @@ TEST(Imports) {
CHECK_EXPR(FunctionLiteral, FUNC_D_TYPE) {
CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmDouble)) {
CHECK_EXPR(Call, Bounds(cache.kAsmDouble)) {
CHECK_VAR(ffunc, Bounds(Type::Any(zone)));
CHECK_VAR(ffunc, FUNC_BARE_TYPE);
CHECK_VAR(fdouble, Bounds(cache.kAsmDouble));
CHECK_EXPR(BinaryOperation, Bounds(cache.kAsmSigned)) {
CHECK_VAR(fint, Bounds(cache.kAsmInt));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment