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

Side by Side Diff: src/asmjs/asm-typer.cc

Issue 2625853003: [wasm] fix asm.js type for param type annotation statements (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698