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

Unified Diff: src/ast/ast.h

Issue 2225423002: Make the AstValueFactory more efficient and less memory hungry (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Undo union since windows Created 4 years, 4 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 | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 898927d57acf0a3ad9b2f44a218841b1a2a513a5..ebb32208010177a511b6432bd23c96489e7e884e 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -314,10 +314,7 @@ class Expression : public AstNode {
// Symbols that cannot be parsed as array indices are considered property
// names. We do not treat symbols that can be array indexes as property
// names because [] for string objects is handled only by keyed ICs.
- // Produces the same result whether |deref_mode| is kAllowed or kDisallowed,
- // although may be faster with kAllowed.
- bool IsPropertyName(
- HandleDereferenceMode deref_mode = HandleDereferenceMode::kAllowed) const;
+ bool IsPropertyName() const;
// True iff the expression is a class or function expression without
// a syntactic name.
@@ -1196,15 +1193,11 @@ class SloppyBlockFunctionStatement final : public Statement {
class Literal final : public Expression {
public:
// Returns true if literal represents a property name (i.e. cannot be parsed
- // as array indices). Produces the same result whether |deref_mode| is
- // kAllowed or kDisallowed, although may be faster with kAllowed.
- bool IsPropertyName(HandleDereferenceMode deref_mode =
- HandleDereferenceMode::kAllowed) const {
- return value_->IsPropertyName(deref_mode);
- }
+ // as array indices).
+ bool IsPropertyName() const { return value_->IsPropertyName(); }
Handle<String> AsPropertyName() {
- DCHECK(IsPropertyName(HandleDereferenceMode::kDisallowed));
+ DCHECK(IsPropertyName());
return Handle<String>::cast(value());
}
@@ -1744,15 +1737,13 @@ class Property final : public Expression {
return property_feedback_slot_;
}
- // Returns the properties assign type. Produces the same result whether
- // |deref_mode| is kAllowed or kDisallowed, although may be faster with
- // kAllowed.
+ // Returns the properties assign type.
static LhsKind GetAssignType(
Property* property,
HandleDereferenceMode deref_mode = HandleDereferenceMode::kAllowed) {
if (property == NULL) return VARIABLE;
bool super_access = property->IsSuperAccess();
- return (property->key()->IsPropertyName(deref_mode))
+ return (property->key()->IsPropertyName())
? (super_access ? NAMED_SUPER_PROPERTY : NAMED_PROPERTY)
: (super_access ? KEYED_SUPER_PROPERTY : KEYED_PROPERTY);
}
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698