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

Unified Diff: src/ia32/full-codegen-ia32.cc

Issue 639243003: Support for super assignments in for..in. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 6 years, 2 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 | « src/arm64/full-codegen-arm64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index 62cf71203b457710f084100d54c263e8f16f5b9c..60f2cbc708cda65a5ee410ab82c9e4ed5351728f 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -2430,16 +2430,8 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr,
void FullCodeGenerator::EmitAssignment(Expression* expr) {
DCHECK(expr->IsValidReferenceExpression());
- // Left-hand side can only be a property, a global or a (parameter or local)
- // slot.
- enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY };
- LhsKind assign_type = VARIABLE;
Property* prop = expr->AsProperty();
- if (prop != NULL) {
- assign_type = (prop->key()->IsPropertyName())
- ? NAMED_PROPERTY
- : KEYED_PROPERTY;
- }
+ LhsKind assign_type = GetAssignType(prop);
switch (assign_type) {
case VARIABLE: {
@@ -2458,6 +2450,42 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
CallStoreIC();
break;
}
+ case NAMED_SUPER_PROPERTY: {
+ __ push(eax);
+ VisitForStackValue(prop->obj()->AsSuperReference()->this_var());
+ EmitLoadHomeObject(prop->obj()->AsSuperReference());
+ // stack: value, this; eax: home_object
+ Register scratch = ecx;
+ Register scratch2 = edx;
+ __ mov(scratch, result_register()); // home_object
+ __ mov(eax, MemOperand(esp, kPointerSize)); // value
+ __ mov(scratch2, MemOperand(esp, 0)); // this
+ __ mov(MemOperand(esp, kPointerSize), scratch2); // this
+ __ mov(MemOperand(esp, 0), scratch); // home_object
+ // stack: this, home_object. eax: value
+ EmitNamedSuperPropertyStore(prop);
+ break;
+ }
+ case KEYED_SUPER_PROPERTY: {
+ __ push(eax);
+ VisitForStackValue(prop->obj()->AsSuperReference()->this_var());
+ EmitLoadHomeObject(prop->obj()->AsSuperReference());
+ __ push(result_register());
+ VisitForAccumulatorValue(prop->key());
+ Register scratch = ecx;
+ Register scratch2 = edx;
+ __ mov(scratch2, MemOperand(esp, 2 * kPointerSize)); // value
+ // stack: value, this, home_object; eax: key, edx: value
+ __ mov(scratch, MemOperand(esp, kPointerSize)); // this
+ __ mov(MemOperand(esp, 2 * kPointerSize), scratch);
+ __ mov(scratch, MemOperand(esp, 0)); // home_object
+ __ mov(MemOperand(esp, kPointerSize), scratch);
+ __ mov(MemOperand(esp, 0), eax);
+ __ mov(eax, scratch2);
+ // stack: this, home_object, key; eax: value.
+ EmitKeyedSuperPropertyStore(prop);
+ break;
+ }
case KEYED_PROPERTY: {
__ push(eax); // Preserve value.
VisitForStackValue(prop->obj());
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698