| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/asmjs/asm-typer.h" | 5 #include "src/asmjs/asm-typer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 if (!ValidAsmIdentifier(proxy->name())) { | 1156 if (!ValidAsmIdentifier(proxy->name())) { |
| 1157 FAIL(proxy, "Invalid asm.js identifier in parameter name."); | 1157 FAIL(proxy, "Invalid asm.js identifier in parameter name."); |
| 1158 } | 1158 } |
| 1159 | 1159 |
| 1160 if (!AddLocal(param, param_info)) { | 1160 if (!AddLocal(param, param_info)) { |
| 1161 FAIL(proxy, "Redeclared parameter."); | 1161 FAIL(proxy, "Redeclared parameter."); |
| 1162 } | 1162 } |
| 1163 parameter_types.push_back(type); | 1163 parameter_types.push_back(type); |
| 1164 SetTypeOf(proxy, type); | 1164 SetTypeOf(proxy, type); |
| 1165 SetTypeOf(expr, type); | 1165 SetTypeOf(expr, type); |
| 1166 SetTypeOf(expr->value(), type); |
| 1166 } | 1167 } |
| 1167 | 1168 |
| 1168 if (static_cast<int>(annotated_parameters) != fun->parameter_count()) { | 1169 if (static_cast<int>(annotated_parameters) != fun->parameter_count()) { |
| 1169 FAIL(fun_decl, "Incorrect parameter type annotations."); | 1170 FAIL(fun_decl, "Incorrect parameter type annotations."); |
| 1170 } | 1171 } |
| 1171 | 1172 |
| 1172 // 5.3 Function type annotations | 1173 // 5.3 Function type annotations |
| 1173 // * locals | 1174 // * locals |
| 1174 for (; current; current = iter.Next()) { | 1175 for (; current; current = iter.Next()) { |
| 1175 auto* initializer = ExtractInitializerExpression(current); | 1176 auto* initializer = ExtractInitializerExpression(current); |
| (...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2933 "Heap view creation parameter should be the module's heap parameter."); | 2934 "Heap view creation parameter should be the module's heap parameter."); |
| 2934 } | 2935 } |
| 2935 | 2936 |
| 2936 DCHECK(heap_view_info->type()->IsA(AsmType::Heap())); | 2937 DCHECK(heap_view_info->type()->IsA(AsmType::Heap())); |
| 2937 return heap_view_info->type(); | 2938 return heap_view_info->type(); |
| 2938 } | 2939 } |
| 2939 | 2940 |
| 2940 } // namespace wasm | 2941 } // namespace wasm |
| 2941 } // namespace internal | 2942 } // namespace internal |
| 2942 } // namespace v8 | 2943 } // namespace v8 |
| OLD | NEW |