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

Side by Side Diff: runtime/vm/token.h

Issue 2487873003: Speculate on bitwise operators. (Closed)
Patch Set: git cl format Created 4 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_TOKEN_H_ 5 #ifndef RUNTIME_VM_TOKEN_H_
6 #define RUNTIME_VM_TOKEN_H_ 6 #define RUNTIME_VM_TOKEN_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 10
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 (tok == Token::kINTERPOL_VAR) || (tok == Token::kERROR) || 282 (tok == Token::kINTERPOL_VAR) || (tok == Token::kERROR) ||
283 (tok == Token::kDOUBLE)); 283 (tok == Token::kDOUBLE));
284 } 284 }
285 285
286 static bool IsBinaryOperator(Token::Kind token); 286 static bool IsBinaryOperator(Token::Kind token);
287 static bool IsUnaryOperator(Token::Kind token); 287 static bool IsUnaryOperator(Token::Kind token);
288 288
289 static bool IsBinaryArithmeticOperator(Token::Kind token); 289 static bool IsBinaryArithmeticOperator(Token::Kind token);
290 static bool IsUnaryArithmeticOperator(Token::Kind token); 290 static bool IsUnaryArithmeticOperator(Token::Kind token);
291 291
292 static bool IsBinaryBitwiseOperator(Token::Kind token);
293
292 // For a comparison operation return an operation for the negated comparison: 294 // For a comparison operation return an operation for the negated comparison:
293 // !(a (op) b) === a (op') b 295 // !(a (op) b) === a (op') b
294 static Token::Kind NegateComparison(Token::Kind op) { 296 static Token::Kind NegateComparison(Token::Kind op) {
295 switch (op) { 297 switch (op) {
296 case Token::kEQ: 298 case Token::kEQ:
297 return Token::kNE; 299 return Token::kNE;
298 case Token::kNE: 300 case Token::kNE:
299 return Token::kEQ; 301 return Token::kEQ;
300 case Token::kLT: 302 case Token::kLT:
301 return Token::kGTE; 303 return Token::kGTE;
(...skipping 20 matching lines...) Expand all
322 private: 324 private:
323 static const char* name_[]; 325 static const char* name_[];
324 static const char* tok_str_[]; 326 static const char* tok_str_[];
325 static const uint8_t precedence_[]; 327 static const uint8_t precedence_[];
326 static const Attribute attributes_[]; 328 static const Attribute attributes_[];
327 }; 329 };
328 330
329 } // namespace dart 331 } // namespace dart
330 332
331 #endif // RUNTIME_VM_TOKEN_H_ 333 #endif // RUNTIME_VM_TOKEN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698