Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index d4dcc40f05610d940b00cf5403c0cfacfa843aef..a1984d4a91621b09be243de44bb8a02448a21f93 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -740,33 +740,30 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable, |
} |
} else if (prop != NULL) { |
- if (function != NULL || mode == Variable::CONST) { |
- // We are declaring a function or constant that rewrites to a |
- // property. Use (keyed) IC to set the initial value. We |
- // cannot visit the rewrite because it's shared and we risk |
- // recording duplicate AST IDs for bailouts from optimized code. |
- ASSERT(prop->obj()->AsVariableProxy() != NULL); |
- { AccumulatorValueContext for_object(this); |
- EmitVariableLoad(prop->obj()->AsVariableProxy()->var()); |
- } |
- if (function != NULL) { |
- __ push(r0); |
- VisitForAccumulatorValue(function); |
- __ pop(r2); |
- } else { |
- __ mov(r2, r0); |
- __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); |
- } |
- ASSERT(prop->key()->AsLiteral() != NULL && |
- prop->key()->AsLiteral()->handle()->IsSmi()); |
- __ mov(r1, Operand(prop->key()->AsLiteral()->handle())); |
- |
- Handle<Code> ic = is_strict_mode() |
- ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
- : isolate()->builtins()->KeyedStoreIC_Initialize(); |
- EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber); |
- // Value in r0 is ignored (declarations are statements). |
+ ASSERT(mode != Variable::CONST); |
Kevin Millikin (Chromium)
2011/05/24 12:57:27
This needs a comment that a const declaration of a
William Hesse
2011/05/24 14:21:43
Done.
|
+ ASSERT(function != NULL); |
Kevin Millikin (Chromium)
2011/05/24 12:57:27
I think this is wrong:
function f(x) { var x = ar
William Hesse
2011/05/24 14:21:43
Done.
|
+ // We are declaring a function that rewrites to a property. |
+ // Use (keyed) IC to set the initial value. We cannot visit the |
+ // rewrite because it's shared and we risk recording duplicate AST |
+ // IDs for bailouts from optimized code. |
+ ASSERT(prop->obj()->AsVariableProxy() != NULL); |
+ { AccumulatorValueContext for_object(this); |
+ EmitVariableLoad(prop->obj()->AsVariableProxy()->var()); |
} |
+ |
+ __ push(r0); |
+ VisitForAccumulatorValue(function); |
+ __ pop(r2); |
+ |
+ ASSERT(prop->key()->AsLiteral() != NULL && |
+ prop->key()->AsLiteral()->handle()->IsSmi()); |
+ __ mov(r1, Operand(prop->key()->AsLiteral()->handle())); |
+ |
+ Handle<Code> ic = is_strict_mode() |
+ ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() |
+ : isolate()->builtins()->KeyedStoreIC_Initialize(); |
+ EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber); |
+ // Value in r0 is ignored (declarations are statements). |
} |
} |