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/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 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1150 if (val.type != kAstEnd) { | 1150 if (val.type != kAstEnd) { |
1151 error(pc_, val.pc, "%s[%d] expected type %s, found %s of type %s", | 1151 error(pc_, val.pc, "%s[%d] expected type %s, found %s of type %s", |
1152 SafeOpcodeNameAt(pc_), index, WasmOpcodes::TypeName(expected), | 1152 SafeOpcodeNameAt(pc_), index, WasmOpcodes::TypeName(expected), |
1153 SafeOpcodeNameAt(val.pc), WasmOpcodes::TypeName(val.type)); | 1153 SafeOpcodeNameAt(val.pc), WasmOpcodes::TypeName(val.type)); |
1154 } | 1154 } |
1155 } | 1155 } |
1156 return val; | 1156 return val; |
1157 } | 1157 } |
1158 | 1158 |
1159 Value Pop() { | 1159 Value Pop() { |
1160 if (stack_.empty()) { | 1160 size_t limit = control_.empty() ? 0 : control_.back().stack_depth; |
ahaas
2016/05/09 09:55:43
Could you add a comment at the declaration of cont
titzer
2016/05/09 09:57:20
Done.
| |
1161 if (stack_.size() <= limit) { | |
1161 Value val = {pc_, nullptr, kAstStmt}; | 1162 Value val = {pc_, nullptr, kAstStmt}; |
1162 error(pc_, pc_, "%s found empty stack", SafeOpcodeNameAt(pc_)); | 1163 error(pc_, pc_, "%s found empty stack", SafeOpcodeNameAt(pc_)); |
1163 return val; | 1164 return val; |
1164 } | 1165 } |
1165 Value val = stack_.back(); | 1166 Value val = stack_.back(); |
1166 stack_.pop_back(); | 1167 stack_.pop_back(); |
1167 return val; | 1168 return val; |
1168 } | 1169 } |
1169 | 1170 |
1170 Value PopUpTo(int stack_depth) { | 1171 Value PopUpTo(int stack_depth) { |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1647 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, | 1648 BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals, |
1648 const byte* start, const byte* end) { | 1649 const byte* start, const byte* end) { |
1649 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; | 1650 FunctionBody body = {nullptr, nullptr, nullptr, start, end}; |
1650 SR_WasmDecoder decoder(zone, nullptr, body); | 1651 SR_WasmDecoder decoder(zone, nullptr, body); |
1651 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); | 1652 return decoder.AnalyzeLoopAssignmentForTesting(start, num_locals); |
1652 } | 1653 } |
1653 | 1654 |
1654 } // namespace wasm | 1655 } // namespace wasm |
1655 } // namespace internal | 1656 } // namespace internal |
1656 } // namespace v8 | 1657 } // namespace v8 |
OLD | NEW |