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 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 } | 949 } |
950 if (proxy == NULL && !expr->expression()->IsProperty()) { | 950 if (proxy == NULL && !expr->expression()->IsProperty()) { |
951 FAIL(expr, "calls must be to bound variables or function tables"); | 951 FAIL(expr, "calls must be to bound variables or function tables"); |
952 } | 952 } |
953 if (computed_type_->IsFunction()) { | 953 if (computed_type_->IsFunction()) { |
954 FunctionType* fun_type = computed_type_->AsFunction(); | 954 FunctionType* fun_type = computed_type_->AsFunction(); |
955 Type* result_type = fun_type->Result(); | 955 Type* result_type = fun_type->Result(); |
956 ZoneList<Expression*>* args = expr->arguments(); | 956 ZoneList<Expression*>* args = expr->arguments(); |
957 if (Type::Any()->Is(result_type)) { | 957 if (Type::Any()->Is(result_type)) { |
958 // For foreign calls. | 958 // For foreign calls. |
959 ZoneList<Expression*>* args = expr->arguments(); | |
960 for (int i = 0; i < args->length(); ++i) { | 959 for (int i = 0; i < args->length(); ++i) { |
961 Expression* arg = args->at(i); | 960 Expression* arg = args->at(i); |
962 RECURSE(VisitWithExpectation( | 961 RECURSE(VisitWithExpectation( |
963 arg, Type::Any(), "foreign call argument expected to be any")); | 962 arg, Type::Any(), "foreign call argument expected to be any")); |
964 // Checking for asm extern types explicitly, as the type system | 963 // Checking for asm extern types explicitly, as the type system |
965 // doesn't correctly check their inheritance relationship. | 964 // doesn't correctly check their inheritance relationship. |
966 if (!computed_type_->Is(cache_.kAsmSigned) && | 965 if (!computed_type_->Is(cache_.kAsmSigned) && |
967 !computed_type_->Is(cache_.kAsmFixnum) && | 966 !computed_type_->Is(cache_.kAsmFixnum) && |
968 !computed_type_->Is(cache_.kAsmDouble)) { | 967 !computed_type_->Is(cache_.kAsmDouble)) { |
969 FAIL(arg, | 968 FAIL(arg, |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 } | 1567 } |
1569 | 1568 |
1570 | 1569 |
1571 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { | 1570 void AsmTyper::VisitRewritableExpression(RewritableExpression* expr) { |
1572 RECURSE(Visit(expr->expression())); | 1571 RECURSE(Visit(expr->expression())); |
1573 } | 1572 } |
1574 | 1573 |
1575 | 1574 |
1576 } // namespace internal | 1575 } // namespace internal |
1577 } // namespace v8 | 1576 } // namespace v8 |
OLD | NEW |