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

Unified Diff: src/interpreter/bytecode-generator.h

Issue 1689573004: [interpreter] Support for ES6 super keyword. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 10 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
Index: src/interpreter/bytecode-generator.h
diff --git a/src/interpreter/bytecode-generator.h b/src/interpreter/bytecode-generator.h
index 190160b7d1952b350f0c4c63cfb75127607a54f5..7bb5c2725b31faadc5f286ebc3096b6e441741be 100644
--- a/src/interpreter/bytecode-generator.h
+++ b/src/interpreter/bytecode-generator.h
@@ -42,6 +42,7 @@ class BytecodeGenerator final : public AstVisitor {
class AccumulatorResultScope;
class RegisterResultScope;
class RegisterAllocationScope;
+ class SuperPropertyArguments;
void MakeBytecodeBody();
@@ -65,6 +66,20 @@ class BytecodeGenerator final : public AstVisitor {
// Helper visitors which perform common operations.
Register VisitArguments(ZoneList<Expression*>* arguments);
+ // Visit a keyed super property load. The optional
+ // |opt_receiver_out| register will have the receiver stored to it
+ // if it's a valid register. The loaded value is placed in the
+ // accumulator.
+ void VisitKeyedSuperPropertyLoad(Property* property,
+ Register opt_receiver_out);
+
+ // Visit a named super property load. The optional
+ // |opt_receiver_out| register will have the receiver stored to it
+ // if it's a valid register. The loaded value is placed in the
+ // accumulator.
+ void VisitNamedSuperPropertyLoad(Property* property,
+ Register opt_receiver_out);
+
void VisitPropertyLoad(Register obj, Property* expr);
void VisitPropertyLoadForAccumulator(Register obj, Property* expr);
@@ -79,6 +94,19 @@ class BytecodeGenerator final : public AstVisitor {
void VisitVariableAssignment(Variable* variable, Token::Value op,
FeedbackVectorSlot slot);
+ void PrepareNamedSuperPropertyArguments(
+ SuperPropertyReference* super_property, Handle<Name> name,
+ SuperPropertyArguments* super_property_args);
+ void PrepareKeyedSuperPropertyArguments(
+ SuperPropertyReference* super_property, Expression* key,
+ SuperPropertyArguments* super_property_args);
+ void BuildNamedSuperPropertyLoad(SuperPropertyArguments* super_property_args);
+ void BuildKeyedSuperPropertyLoad(SuperPropertyArguments* super_property_args);
+ void BuildNamedSuperPropertyStore(
+ SuperPropertyArguments* super_property_args);
+ void BuildKeyedSuperPropertyStore(
+ SuperPropertyArguments* super_property_args);
+
void BuildThrowIfHole(Handle<String> name);
void BuildThrowIfNotHole(Handle<String> name);
void BuildThrowReassignConstant(Handle<String> name);
@@ -88,6 +116,7 @@ class BytecodeGenerator final : public AstVisitor {
void VisitArgumentsObject(Variable* variable);
void VisitRestArgumentsArray(Variable* rest);
+ void VisitCallSuper(Call* call);
void VisitClassLiteralContents(ClassLiteral* expr);
void VisitClassLiteralForRuntimeDefinition(ClassLiteral* expr);
void VisitClassLiteralProperties(ClassLiteral* expr, Register literal,
@@ -130,6 +159,10 @@ class BytecodeGenerator final : public AstVisitor {
bool IsInsideTryCatch() const { return try_catch_nesting_level_ > 0; }
bool IsInsideTryFinally() const { return try_finally_nesting_level_ > 0; }
+ // Initialize an array of temporary registers with consecutive registers.
+ template <size_t N>
+ void InitializeWithConsecutiveRegisters(Register (&registers)[N]);
+
inline void set_builder(BytecodeArrayBuilder* builder) { builder_ = builder; }
inline BytecodeArrayBuilder* builder() const { return builder_; }

Powered by Google App Engine
This is Rietveld 408576698