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

Unified Diff: src/ast.cc

Issue 298143004: Minor cleanups & trivial refactoring related to Ast. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 7 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/ast.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 303c442f8434301165ec8afd2106637cc410e8ac..e6bcec210ddce73eb3ac6c18baad25933d71ffce 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -34,17 +34,17 @@ AST_NODE_LIST(DECL_ACCEPT)
bool Expression::IsSmiLiteral() const {
- return AsLiteral() != NULL && AsLiteral()->value()->IsSmi();
+ return IsLiteral() && AsLiteral()->value()->IsSmi();
}
bool Expression::IsStringLiteral() const {
- return AsLiteral() != NULL && AsLiteral()->value()->IsString();
+ return IsLiteral() && AsLiteral()->value()->IsString();
}
bool Expression::IsNullLiteral() const {
- return AsLiteral() != NULL && AsLiteral()->value()->IsNull();
+ return IsLiteral() && AsLiteral()->value()->IsNull();
}
@@ -192,7 +192,7 @@ ObjectLiteralProperty::ObjectLiteralProperty(
kind_ = PROTOTYPE;
} else if (value_->AsMaterializedLiteral() != NULL) {
kind_ = MATERIALIZED_LITERAL;
- } else if (value_->AsLiteral() != NULL) {
+ } else if (value_->IsLiteral()) {
kind_ = CONSTANT;
} else {
kind_ = COMPUTED;
@@ -390,7 +390,7 @@ void ArrayLiteral::BuildConstantElements(Isolate* isolate) {
Handle<Object> MaterializedLiteral::GetBoilerplateValue(Expression* expression,
Isolate* isolate) {
- if (expression->AsLiteral() != NULL) {
+ if (expression->IsLiteral()) {
return expression->AsLiteral()->value();
}
if (CompileTimeValue::IsCompileTimeValue(expression)) {
@@ -499,7 +499,7 @@ static bool IsVoidOfLiteral(Expression* expr) {
UnaryOperation* maybe_unary = expr->AsUnaryOperation();
return maybe_unary != NULL &&
maybe_unary->op() == Token::VOID &&
- maybe_unary->expression()->AsLiteral() != NULL;
+ maybe_unary->expression()->IsLiteral();
}
« no previous file with comments | « src/ast.h ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698