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

Side by Side Diff: src/wasm/ast-decoder.cc

Issue 2319213003: [wasm] Do not produce code for br_if if its condition does not validate. (Closed)
Patch Set: Created 4 years, 3 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 | test/mjsunit/wasm/regression-644682.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 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/signature.h" 5 #include "src/signature.h"
6 6
7 #include "src/bit-vector.h" 7 #include "src/bit-vector.h"
8 #include "src/flags.h" 8 #include "src/flags.h"
9 #include "src/handles.h" 9 #include "src/handles.h"
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 } 1016 }
1017 len = 1 + operand.length; 1017 len = 1 + operand.length;
1018 Push(kAstEnd, nullptr); 1018 Push(kAstEnd, nullptr);
1019 break; 1019 break;
1020 } 1020 }
1021 case kExprBrIf: { 1021 case kExprBrIf: {
1022 BreakDepthOperand operand(this, pc_); 1022 BreakDepthOperand operand(this, pc_);
1023 Value cond = Pop(operand.arity, kAstI32); 1023 Value cond = Pop(operand.arity, kAstI32);
1024 Value val = {pc_, nullptr, kAstStmt}; 1024 Value val = {pc_, nullptr, kAstStmt};
1025 if (operand.arity == 1) val = Pop(); 1025 if (operand.arity == 1) val = Pop();
1026 if (Validate(pc_, operand, control_)) { 1026 if (ok() && Validate(pc_, operand, control_)) {
1027 SsaEnv* fenv = ssa_env_; 1027 SsaEnv* fenv = ssa_env_;
1028 SsaEnv* tenv = Split(fenv); 1028 SsaEnv* tenv = Split(fenv);
1029 fenv->SetNotMerged(); 1029 fenv->SetNotMerged();
1030 BUILD(Branch, cond.node, &tenv->control, &fenv->control); 1030 BUILD(Branch, cond.node, &tenv->control, &fenv->control);
1031 ssa_env_ = tenv; 1031 ssa_env_ = tenv;
1032 BreakTo(operand, val); 1032 BreakTo(operand, val);
1033 ssa_env_ = fenv; 1033 ssa_env_ = fenv;
1034 } 1034 }
1035 len = 1 + operand.length; 1035 len = 1 + operand.length;
1036 Push(kAstStmt, nullptr); 1036 Push(kAstStmt, nullptr);
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
2074 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, 2074 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals,
2075 const byte* start, const byte* end) { 2075 const byte* start, const byte* end) {
2076 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; 2076 FunctionBody body = {nullptr, nullptr, nullptr, start, end};
2077 WasmFullDecoder decoder(zone, nullptr, body); 2077 WasmFullDecoder decoder(zone, nullptr, body);
2078 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); 2078 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals);
2079 } 2079 }
2080 2080
2081 } // namespace wasm 2081 } // namespace wasm
2082 } // namespace internal 2082 } // namespace internal
2083 } // namespace v8 2083 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/wasm/regression-644682.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698