Index: src/full-codegen.h |
diff --git a/src/full-codegen.h b/src/full-codegen.h |
index 4c53c158b189b5bac6eb08841f244a52ed0ba51a..8c2835a86dfe5820b958087c266e4cfa7460617c 100644 |
--- a/src/full-codegen.h |
+++ b/src/full-codegen.h |
@@ -518,6 +518,24 @@ class FullCodeGenerator: public AstVisitor { |
// Platform-specific support for compiling assignments. |
+ // Left-hand side can only be a property, a global or a (parameter or local) |
+ // slot. |
+ enum LhsKind { |
Igor Sheludko
2014/10/09 11:07:20
Since we make the enum "public" maybe "LvalueKind"
|
+ VARIABLE, |
+ NAMED_PROPERTY, |
+ KEYED_PROPERTY, |
+ NAMED_SUPER_PROPERTY, |
+ KEYED_SUPER_PROPERTY |
+ }; |
+ |
+ static LhsKind GetAssignType(Property* property) { |
+ if (property == NULL) return VARIABLE; |
+ bool super_access = property->IsSuperAccess(); |
+ return (property->key()->IsPropertyName()) |
+ ? (super_access ? NAMED_SUPER_PROPERTY : NAMED_PROPERTY) |
+ : (super_access ? KEYED_SUPER_PROPERTY : KEYED_PROPERTY); |
+ } |
+ |
// Load a value from a named property. |
// The receiver is left on the stack by the IC. |
void EmitNamedPropertyLoad(Property* expr); |
@@ -569,6 +587,10 @@ class FullCodeGenerator: public AstVisitor { |
// is expected in accumulator. |
void EmitNamedSuperPropertyStore(Property* prop); |
+ // Complete a super named property assignment. The right-hand-side value |
+ // is expected in accumulator. |
+ void EmitKeyedSuperPropertyStore(Property* prop); |
+ |
// Complete a keyed property assignment. The receiver and key are |
// expected on top of the stack and the right-hand-side value in the |
// accumulator. |