Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 42a605c7e9c350b57feb4555507d7cd65e105666..9bb63f076a96c7c133e33c2360f13d9fff0d5d75 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -2003,7 +2003,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
EmitNamedPropertyAssignment(expr); |
break; |
case NAMED_SUPER_PROPERTY: |
- EmitNamedSuperPropertyAssignment(expr); |
+ EmitNamedSuperPropertyStore(property); |
+ context()->Plug(r0); |
break; |
case KEYED_PROPERTY: |
EmitKeyedPropertyAssignment(expr); |
@@ -2634,11 +2635,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { |
} |
-void FullCodeGenerator::EmitNamedSuperPropertyAssignment(Assignment* expr) { |
+void FullCodeGenerator::EmitNamedSuperPropertyStore(Property* prop) { |
// Assignment to named property of super. |
// r0 : value |
// stack : receiver ('this'), home_object |
- Property* prop = expr->target()->AsProperty(); |
DCHECK(prop != NULL); |
Literal* key = prop->key()->AsLiteral(); |
DCHECK(key != NULL); |
@@ -2648,7 +2648,6 @@ void FullCodeGenerator::EmitNamedSuperPropertyAssignment(Assignment* expr) { |
__ CallRuntime((strict_mode() == STRICT ? Runtime::kStoreToSuper_Strict |
: Runtime::kStoreToSuper_Sloppy), |
4); |
- context()->Plug(r0); |
} |
@@ -4374,19 +4373,21 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
// Expression can only be a property, a global or a (parameter or local) |
// slot. |
- enum LhsKind { VARIABLE, NAMED_PROPERTY, KEYED_PROPERTY }; |
+ enum LhsKind { |
+ VARIABLE, |
+ NAMED_PROPERTY, |
+ KEYED_PROPERTY, |
+ NAMED_SUPER_PROPERTY |
+ }; |
LhsKind assign_type = VARIABLE; |
Property* prop = expr->expression()->AsProperty(); |
// In case of a property we use the uninitialized expression context |
// of the key to detect a named property. |
if (prop != NULL) { |
assign_type = |
- (prop->key()->IsPropertyName()) ? NAMED_PROPERTY : KEYED_PROPERTY; |
- if (prop->IsSuperAccess()) { |
- // throw exception. |
- VisitSuperReference(prop->obj()->AsSuperReference()); |
- return; |
- } |
+ (prop->key()->IsPropertyName()) |
+ ? (prop->IsSuperAccess() ? NAMED_SUPER_PROPERTY : NAMED_PROPERTY) |
+ : KEYED_PROPERTY; |
} |
// Evaluate expression and get value. |
@@ -4405,6 +4406,15 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
VisitForStackValue(prop->obj()); |
__ ldr(LoadDescriptor::ReceiverRegister(), MemOperand(sp, 0)); |
EmitNamedPropertyLoad(prop); |
+ } else if (assign_type == NAMED_SUPER_PROPERTY) { |
+ VisitForStackValue(prop->obj()->AsSuperReference()->this_var()); |
+ EmitLoadHomeObject(prop->obj()->AsSuperReference()); |
+ __ Push(result_register()); |
+ const Register scratch = r1; |
+ __ ldr(scratch, MemOperand(sp, kPointerSize)); |
+ __ Push(scratch); |
+ __ Push(result_register()); |
+ EmitNamedSuperPropertyLoad(prop); |
} else { |
VisitForStackValue(prop->obj()); |
VisitForStackValue(prop->key()); |
@@ -4445,6 +4455,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
case NAMED_PROPERTY: |
__ str(r0, MemOperand(sp, kPointerSize)); |
break; |
+ case NAMED_SUPER_PROPERTY: |
+ __ str(r0, MemOperand(sp, 2 * kPointerSize)); |
+ break; |
case KEYED_PROPERTY: |
__ str(r0, MemOperand(sp, 2 * kPointerSize)); |
break; |
@@ -4475,6 +4488,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
case NAMED_PROPERTY: |
__ str(r0, MemOperand(sp, kPointerSize)); |
break; |
+ case NAMED_SUPER_PROPERTY: |
+ __ str(r0, MemOperand(sp, 2 * kPointerSize)); |
+ break; |
case KEYED_PROPERTY: |
__ str(r0, MemOperand(sp, 2 * kPointerSize)); |
break; |
@@ -4533,6 +4549,17 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
} |
break; |
} |
+ case NAMED_SUPER_PROPERTY: { |
+ EmitNamedSuperPropertyStore(prop); |
+ if (expr->is_postfix()) { |
+ if (!context()->IsEffect()) { |
+ context()->PlugTOS(); |
+ } |
+ } else { |
+ context()->Plug(r0); |
+ } |
+ break; |
+ } |
case KEYED_PROPERTY: { |
__ Pop(StoreDescriptor::ReceiverRegister(), |
StoreDescriptor::NameRegister()); |