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

Unified Diff: src/ast/ast.h

Issue 2223523002: [Interpreter] Avoid dereferencing handles on BytecodeGenerator for AST operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_const_array
Patch Set: 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') | src/ast/ast-value-factory.cc » ('J')
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 ad02c960f840d66ff44ecaa1d5d89fdb40bdc284..ed345cacec2754e434f178970b41f5645e5f5539 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -318,7 +318,9 @@ 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.
- bool IsPropertyName() const;
+ bool IsPropertyName(
marja 2016/08/08 08:20:13 For all calls, the guarantee you want to give is t
rmcilroy 2016/08/08 13:05:56 For GetCallType yes this is the case. For IsProper
+ HandleDereferenceMode deref_mode =
+ HandleDereferenceMode::kHandleDereferenceAllowed) const;
// True iff the expression is a class or function expression without
// a syntactic name.
@@ -1241,10 +1243,14 @@ class Literal final : public Expression {
public:
DECLARE_NODE_TYPE(Literal)
- bool IsPropertyName() const { return value_->IsPropertyName(); }
+ bool IsPropertyName(
+ HandleDereferenceMode deref_mode =
+ HandleDereferenceMode::kHandleDereferenceAllowed) const {
+ return value_->IsPropertyName(deref_mode);
+ }
Handle<String> AsPropertyName() {
- DCHECK(IsPropertyName());
+ DCHECK(IsPropertyName(HandleDereferenceMode::kHandleDereferenceDisallowed));
return Handle<String>::cast(value());
}
@@ -1253,8 +1259,8 @@ class Literal final : public Expression {
return value_->AsString();
}
- bool ToBooleanIsTrue() const { return value()->BooleanValue(); }
- bool ToBooleanIsFalse() const { return !value()->BooleanValue(); }
+ bool ToBooleanIsTrue() const { return raw_value()->BooleanValue(); }
+ bool ToBooleanIsFalse() const { return !raw_value()->BooleanValue(); }
Handle<Object> value() const { return value_->value(); }
const AstValue* raw_value() const { return value_; }
@@ -1411,7 +1417,7 @@ class ObjectLiteral final : public MaterializedLiteral {
Handle<FixedArray> constant_properties() const {
return constant_properties_;
}
- int properties_count() const { return constant_properties_->length() / 2; }
+ int properties_count() const { return boilerplate_properties_; }
ZoneList<Property*>* properties() const { return properties_; }
bool fast_elements() const { return fast_elements_; }
bool may_store_doubles() const { return may_store_doubles_; }
@@ -1786,10 +1792,13 @@ class Property final : public Expression {
return property_feedback_slot_;
}
- static LhsKind GetAssignType(Property* property) {
+ static LhsKind GetAssignType(
+ Property* property,
+ HandleDereferenceMode deref_mode =
+ HandleDereferenceMode::kHandleDereferenceAllowed) {
if (property == NULL) return VARIABLE;
bool super_access = property->IsSuperAccess();
- return (property->key()->IsPropertyName())
+ return (property->key()->IsPropertyName(deref_mode))
? (super_access ? NAMED_SUPER_PROPERTY : NAMED_PROPERTY)
: (super_access ? KEYED_SUPER_PROPERTY : KEYED_PROPERTY);
}
@@ -1904,9 +1913,18 @@ class Call final : public Expression {
};
// Helpers to determine how to handle the call.
- CallType GetCallType(Isolate* isolate) const;
- bool IsUsingCallFeedbackSlot(Isolate* isolate) const;
- bool IsUsingCallFeedbackICSlot(Isolate* isolate) const;
+ CallType GetCallType(
+ Isolate* isolate,
+ HandleDereferenceMode deref_mode =
+ HandleDereferenceMode::kHandleDereferenceAllowed) const;
+ bool IsUsingCallFeedbackSlot(
+ Isolate* isolate,
+ HandleDereferenceMode deref_mode =
+ HandleDereferenceMode::kHandleDereferenceAllowed) const;
+ bool IsUsingCallFeedbackICSlot(
+ Isolate* isolate,
+ HandleDereferenceMode deref_mode =
+ HandleDereferenceMode::kHandleDereferenceAllowed) const;
#ifdef DEBUG
// Used to assert that the FullCodeGenerator records the return site.
« no previous file with comments | « no previous file | src/ast/ast.cc » ('j') | src/ast/ast-value-factory.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698