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

Unified Diff: src/ast.h

Issue 798873006: First simple implementation of class literals in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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-numbering.cc » ('j') | src/compiler/ast-graph-builder.cc » ('J')
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 d562e91d981042edc30479fe125fe8fb8fda5bfd..33f5f2c0cdf710cd438a2e61d6d57a8e2551611c 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -2660,6 +2660,11 @@ class ClassLiteral FINAL : public Expression {
int start_position() const { return position(); }
int end_position() const { return end_position_; }
+ static int num_ids() { return parent_num_ids() + 3; }
+ BailoutId EntryId() const { return BailoutId(local_id(0)); }
+ BailoutId DeclsId() const { return BailoutId(local_id(1)); }
+ BailoutId ExitId() { return BailoutId(local_id(2)); }
+
protected:
ClassLiteral(Zone* zone, const AstRawString* name, Scope* scope,
VariableProxy* class_variable_proxy, Expression* extends,
@@ -2673,8 +2678,11 @@ class ClassLiteral FINAL : public Expression {
constructor_(constructor),
properties_(properties),
end_position_(end_position) {}
+ static int parent_num_ids() { return Expression::num_ids(); }
private:
+ int local_id(int n) const { return base_id() + parent_num_ids() + n; }
+
const AstRawString* raw_name_;
Scope* scope_;
VariableProxy* class_variable_proxy_;
« no previous file with comments | « no previous file | src/ast-numbering.cc » ('j') | src/compiler/ast-graph-builder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698