| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 5810ab156a86564f9ea08749bb770bb8a7dc47e0..67bbebf2f4b9a101b35791617920f3a9e24e6ad9 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -711,33 +711,29 @@ 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());
|
| - }
|
| + ASSERT(mode != Variable::CONST);
|
| + ASSERT(function != NULL);
|
| + // 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());
|
| + }
|
|
|
| - if (function != NULL) {
|
| - __ push(eax);
|
| - VisitForAccumulatorValue(function);
|
| - __ pop(edx);
|
| - } else {
|
| - __ mov(edx, eax);
|
| - __ mov(eax, isolate()->factory()->the_hole_value());
|
| - }
|
| - ASSERT(prop->key()->AsLiteral() != NULL &&
|
| - prop->key()->AsLiteral()->handle()->IsSmi());
|
| - __ SafeSet(ecx, Immediate(prop->key()->AsLiteral()->handle()));
|
| + __ push(eax);
|
| + VisitForAccumulatorValue(function);
|
| + __ pop(edx);
|
|
|
| - Handle<Code> ic = is_strict_mode()
|
| - ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict()
|
| - : isolate()->builtins()->KeyedStoreIC_Initialize();
|
| - EmitCallIC(ic, RelocInfo::CODE_TARGET, AstNode::kNoNumber);
|
| - }
|
| + ASSERT(prop->key()->AsLiteral() != NULL &&
|
| + prop->key()->AsLiteral()->handle()->IsSmi());
|
| + __ SafeSet(ecx, Immediate(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);
|
| }
|
| }
|
|
|
|
|