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

Unified Diff: src/parsing/token.h

Issue 1594443003: [parsing] Move EvalComparison out of the assembler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-source-position
Patch Set: Drop one more include. Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/x87/lithium-codegen-x87.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/token.h
diff --git a/src/parsing/token.h b/src/parsing/token.h
index fee1f7e85aa3a02ef9b3aa56d666ce203a4166f9..7a62b4d9153a399ac546df9496ed5d921d863ed3 100644
--- a/src/parsing/token.h
+++ b/src/parsing/token.h
@@ -280,6 +280,22 @@ class Token {
}
}
+ static bool EvalComparison(Value op, double op1, double op2) {
+ DCHECK(IsArithmeticCompareOp(op));
+ switch (op) {
+ case Token::EQ:
+ case Token::EQ_STRICT: return (op1 == op2);
+ case Token::NE: return (op1 != op2);
+ case Token::LT: return (op1 < op2);
+ case Token::GT: return (op1 > op2);
+ case Token::LTE: return (op1 <= op2);
+ case Token::GTE: return (op1 >= op2);
+ default:
+ UNREACHABLE();
+ return false;
+ }
+ }
+
static bool IsBitOp(Value op) {
return (BIT_OR <= op && op <= SHR) || op == BIT_NOT;
}
« no previous file with comments | « src/crankshaft/x87/lithium-codegen-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698