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

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

Issue 2558813004: [wasm][asm.js] Fail sooner if eval is present. (Closed)
Patch Set: Created 4 years 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 | test/mjsunit/asm/regress-672045.js » ('j') | 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 struct { 576 struct {
577 StandardMember standard_member; 577 StandardMember standard_member;
578 } kModuleParamInfo[3] = { 578 } kModuleParamInfo[3] = {
579 {kStdlib}, {kFFI}, {kHeap}, 579 {kStdlib}, {kFFI}, {kHeap},
580 }; 580 };
581 581
582 for (int ii = 0; ii < scope->num_parameters(); ++ii) { 582 for (int ii = 0; ii < scope->num_parameters(); ++ii) {
583 Variable* param = scope->parameter(ii); 583 Variable* param = scope->parameter(ii);
584 DCHECK(param); 584 DCHECK(param);
585 585
586 if (param->location() != VariableLocation::PARAMETER) {
titzer 2016/12/08 10:39:54 I don't think this is the check you want. There ar
bradn 2016/12/08 10:53:24 Done.
587 FAIL(fun, "Invalid asm.js module using eval.");
588 }
589
586 if (!ValidAsmIdentifier(param->name())) { 590 if (!ValidAsmIdentifier(param->name())) {
587 FAIL(fun, "Invalid asm.js identifier in module parameter."); 591 FAIL(fun, "Invalid asm.js identifier in module parameter.");
588 } 592 }
589 593
590 auto* param_info = VariableInfo::ForSpecialSymbol( 594 auto* param_info = VariableInfo::ForSpecialSymbol(
591 zone_, kModuleParamInfo[ii].standard_member); 595 zone_, kModuleParamInfo[ii].standard_member);
592 596
593 if (!AddGlobal(param, param_info)) { 597 if (!AddGlobal(param, param_info)) {
594 FAIL(fun, "Redeclared identifier in module parameter."); 598 FAIL(fun, "Redeclared identifier in module parameter.");
595 } 599 }
(...skipping 2283 matching lines...) Expand 10 before | Expand all | Expand 10 after
2879 return true; 2883 return true;
2880 } 2884 }
2881 2885
2882 *error_message = typer.error_message(); 2886 *error_message = typer.error_message();
2883 return false; 2887 return false;
2884 } 2888 }
2885 2889
2886 } // namespace wasm 2890 } // namespace wasm
2887 } // namespace internal 2891 } // namespace internal
2888 } // namespace v8 2892 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/asm/regress-672045.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698