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

Unified Diff: src/ast.h

Issue 418143007: FYI Implementing 'super' keyword (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use private own symbol for [[HomeObject]] 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 | « include/v8.h ('k') | 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..80075d90ab482e372b5489c53ac81567f841a73b 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -73,27 +73,28 @@ namespace internal {
V(TryFinallyStatement) \
V(DebuggerStatement)
-#define EXPRESSION_NODE_LIST(V) \
- V(FunctionLiteral) \
- V(NativeFunctionLiteral) \
- V(Conditional) \
- V(VariableProxy) \
- V(Literal) \
- V(RegExpLiteral) \
- V(ObjectLiteral) \
- V(ArrayLiteral) \
- V(Assignment) \
- V(Yield) \
- V(Throw) \
- V(Property) \
- V(Call) \
- V(CallNew) \
- V(CallRuntime) \
- V(UnaryOperation) \
- V(CountOperation) \
- V(BinaryOperation) \
- V(CompareOperation) \
- V(ThisFunction) \
+#define EXPRESSION_NODE_LIST(V) \
+ V(FunctionLiteral) \
+ V(NativeFunctionLiteral) \
+ V(Conditional) \
+ V(VariableProxy) \
+ V(Literal) \
+ V(RegExpLiteral) \
+ V(ObjectLiteral) \
+ V(ArrayLiteral) \
+ V(Assignment) \
+ V(Yield) \
+ V(Throw) \
+ V(Property) \
+ V(Call) \
+ V(CallNew) \
+ V(CallRuntime) \
+ V(UnaryOperation) \
+ V(CountOperation) \
+ 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,24 @@ 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 +3495,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 | « include/v8.h ('k') | src/ast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698