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

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

Issue 2561193003: [wasm][asm.js] Allow true/false in int binary ops. (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 | src/asmjs/asm-wasm-builder.cc » ('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 2236 matching lines...) Expand 10 before | Expand all | Expand 10 after
2247 2247
2248 // 6.8.15 BitwiseORExpression 2248 // 6.8.15 BitwiseORExpression
2249 AsmType* AsmTyper::ValidateBitwiseORExpression(BinaryOperation* binop) { 2249 AsmType* AsmTyper::ValidateBitwiseORExpression(BinaryOperation* binop) {
2250 auto* left = binop->left(); 2250 auto* left = binop->left();
2251 if (IsIntAnnotation(binop)) { 2251 if (IsIntAnnotation(binop)) {
2252 if (auto* left_as_call = left->AsCall()) { 2252 if (auto* left_as_call = left->AsCall()) {
2253 AsmType* type; 2253 AsmType* type;
2254 RECURSE(type = ValidateCall(AsmType::Signed(), left_as_call)); 2254 RECURSE(type = ValidateCall(AsmType::Signed(), left_as_call));
2255 return type; 2255 return type;
2256 } 2256 }
2257 2257 AsmType* left_type;
2258 // TODO(jpp): at this point we know that binop is expr|0. We could sinply 2258 RECURSE(left_type = ValidateExpression(left));
2259 // 2259 if (!left_type->IsA(AsmType::Intish())) {
2260 // RECURSE(t = ValidateExpression(left)); 2260 FAIL(left, "Left side of |0 annotation must be intish.");
2261 // FAIL_IF(t->IsNotA(Intish)); 2261 }
2262 // return Signed; 2262 return AsmType::Signed();
2263 } 2263 }
2264 2264
2265 auto* right = binop->right(); 2265 auto* right = binop->right();
2266 AsmType* left_type; 2266 AsmType* left_type;
2267 AsmType* right_type; 2267 AsmType* right_type;
2268 RECURSE(left_type = ValidateExpression(left)); 2268 RECURSE(left_type = ValidateExpression(left));
2269 RECURSE(right_type = ValidateExpression(right)); 2269 RECURSE(right_type = ValidateExpression(right));
2270 2270
2271 if (binop->op() != Token::BIT_OR) { 2271 if (binop->op() != Token::BIT_OR) {
2272 FAIL(binop, "Invalid | expression."); 2272 FAIL(binop, "Invalid | expression.");
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
2907 return true; 2907 return true;
2908 } 2908 }
2909 2909
2910 *error_message = typer.error_message(); 2910 *error_message = typer.error_message();
2911 return false; 2911 return false;
2912 } 2912 }
2913 2913
2914 } // namespace wasm 2914 } // namespace wasm
2915 } // namespace internal 2915 } // namespace internal
2916 } // namespace v8 2916 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/asmjs/asm-wasm-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698