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

Unified Diff: src/ast.h

Issue 480543002: Parse 'super' keyword. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Patch for landing (minor fix for tests in release mode) Created 6 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index e18fdc79c71ffad36d3af96e65389775b039b6c9..2b4d0f144ef8da284d4073dc6948c30d41b5f897 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -94,6 +94,7 @@ namespace internal {
V(BinaryOperation) \
V(CompareOperation) \
V(ThisFunction) \
+ V(SuperReference) \
V(CaseClause)
#define AST_NODE_LIST(V) \
@@ -1710,6 +1711,10 @@ class Property V8_FINAL : public Expression, public FeedbackSlotInterface {
void mark_for_call() { is_for_call_ = true; }
bool IsForCall() { return is_for_call_; }
+ bool IsSuperAccess() {
+ return obj()->IsSuperReference();
+ }
+
TypeFeedbackId PropertyFeedbackId() { return reuse(id()); }
virtual int ComputeFeedbackSlotCount() { return FLAG_vector_ics ? 1 : 0; }
@@ -2554,6 +2559,25 @@ class ThisFunction V8_FINAL : public Expression {
explicit ThisFunction(Zone* zone, int pos): Expression(zone, pos) {}
};
+
+class SuperReference V8_FINAL : public Expression {
+ public:
+ DECLARE_NODE_TYPE(SuperReference)
+
+ VariableProxy* this_var() const { return this_var_; }
+
+ TypeFeedbackId HomeObjectFeedbackId() { return reuse(id()); }
+
+ protected:
+ explicit SuperReference(Zone* zone, VariableProxy* this_var, int pos)
+ : Expression(zone, pos), this_var_(this_var) {
+ DCHECK(this_var->is_this());
+ }
+
+ VariableProxy* this_var_;
+};
+
+
#undef DECLARE_NODE_TYPE
@@ -3472,6 +3496,11 @@ class AstNodeFactory V8_FINAL BASE_EMBEDDED {
VISIT_AND_RETURN(ThisFunction, fun)
}
+ SuperReference* NewSuperReference(VariableProxy* this_var, int pos) {
+ SuperReference* super = new (zone_) SuperReference(zone_, this_var, pos);
+ VISIT_AND_RETURN(SuperReference, super);
+ }
+
#undef VISIT_AND_RETURN
private:
« no previous file with comments | « no previous file | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698