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

Side by Side Diff: src/token.h

Issue 3195028: Add inlining of binary smi operations in the full codegens on IA32... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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 | Annotate | Revision Log
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/x64/full-codegen-x64.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 242
243 static bool IsUnaryOp(Value op) { 243 static bool IsUnaryOp(Value op) {
244 return (NOT <= op && op <= VOID) || op == ADD || op == SUB; 244 return (NOT <= op && op <= VOID) || op == ADD || op == SUB;
245 } 245 }
246 246
247 static bool IsCountOp(Value op) { 247 static bool IsCountOp(Value op) {
248 return op == INC || op == DEC; 248 return op == INC || op == DEC;
249 } 249 }
250 250
251 static bool IsShiftOp(Value op) {
252 return (SHL <= op) && (op <= SHR);
253 }
254
251 // Returns a string corresponding to the JS token string 255 // Returns a string corresponding to the JS token string
252 // (.e., "<" for the token LT) or NULL if the token doesn't 256 // (.e., "<" for the token LT) or NULL if the token doesn't
253 // have a (unique) string (e.g. an IDENTIFIER). 257 // have a (unique) string (e.g. an IDENTIFIER).
254 static const char* String(Value tok) { 258 static const char* String(Value tok) {
255 ASSERT(0 <= tok && tok < NUM_TOKENS); 259 ASSERT(0 <= tok && tok < NUM_TOKENS);
256 return string_[tok]; 260 return string_[tok];
257 } 261 }
258 262
259 // Returns the precedence > 0 for binary and compare 263 // Returns the precedence > 0 for binary and compare
260 // operators; returns 0 otherwise. 264 // operators; returns 0 otherwise.
261 static int Precedence(Value tok) { 265 static int Precedence(Value tok) {
262 ASSERT(0 <= tok && tok < NUM_TOKENS); 266 ASSERT(0 <= tok && tok < NUM_TOKENS);
263 return precedence_[tok]; 267 return precedence_[tok];
264 } 268 }
265 269
266 private: 270 private:
267 static const char* name_[NUM_TOKENS]; 271 static const char* name_[NUM_TOKENS];
268 static const char* string_[NUM_TOKENS]; 272 static const char* string_[NUM_TOKENS];
269 static int8_t precedence_[NUM_TOKENS]; 273 static int8_t precedence_[NUM_TOKENS];
270 static const char token_type[NUM_TOKENS]; 274 static const char token_type[NUM_TOKENS];
271 }; 275 };
272 276
273 } } // namespace v8::internal 277 } } // namespace v8::internal
274 278
275 #endif // V8_TOKEN_H_ 279 #endif // V8_TOKEN_H_
OLDNEW
« no previous file with comments | « src/ia32/full-codegen-ia32.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698