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

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

Issue 10440099: Adding unary op optimizations. missing assembly operations/ (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/token.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 #include "vm/token.h" 5 #include "vm/token.h"
6 6
7 #include "vm/object.h" 7 #include "vm/object.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 case '>' : return name.CharAt(1) == '>' ? Token::kSHR : Token::kILLEGAL; 59 case '>' : return name.CharAt(1) == '>' ? Token::kSHR : Token::kILLEGAL;
60 case '~' : 60 case '~' :
61 return name.CharAt(1) == '/' ? Token::kTRUNCDIV : Token::kILLEGAL; 61 return name.CharAt(1) == '/' ? Token::kTRUNCDIV : Token::kILLEGAL;
62 default: return Token::kILLEGAL; // Not a binary operation. 62 default: return Token::kILLEGAL; // Not a binary operation.
63 } 63 }
64 } 64 }
65 return Token::kILLEGAL; 65 return Token::kILLEGAL;
66 } 66 }
67 67
68 68
69 Token::Kind Token::GetUnaryOp(const String& name) {
70 if (name.Equals(Str(Token::kNEGATE))) {
71 return Token::kNEGATE;
72 }
73 if ((name.Length() == 1) && (name.CharAt(0) == '~')) {
74 return Token::kBIT_NOT;
75 }
76 return Token::kILLEGAL;
77 }
78
79
69 } // namespace dart 80 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/token.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698