diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2010-11-09 16:16:48 -0800 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2010-11-15 17:07:50 -0800 |
commit | 3e5fa29ddb82551500b118e9bf37af3966277b70 (patch) | |
tree | a74a16cc186a742dd182289692dfbe9ce1c3c5d4 /src/arm/codegen-arm.cc | |
parent | 5913587db4c6bab03d97bfe44b06289fd6d7270d (diff) | |
download | v8-3e5fa29ddb82551500b118e9bf37af3966277b70.tar.gz |
Update V8 to r5780 as required by WebKit r71558
Change-Id: Ie3936550b99967a13755930d0dac0a59c3562625
Diffstat (limited to 'src/arm/codegen-arm.cc')
-rw-r--r-- | src/arm/codegen-arm.cc | 93 |
1 files changed, 20 insertions, 73 deletions
diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc index 0c060f0f..d7fd9a49 100644 --- a/src/arm/codegen-arm.cc +++ b/src/arm/codegen-arm.cc @@ -3596,6 +3596,12 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) { frame_->CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); } frame_->EmitPush(r0); // save the result + + // Mark all computed expressions that are bound to a key that + // is shadowed by a later occurrence of the same key. For the + // marked expressions, no store code is emitted. + node->CalculateEmitStore(); + for (int i = 0; i < node->properties()->length(); i++) { // At the start of each iteration, the top of stack contains // the newly created object literal. @@ -3612,11 +3618,15 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) { if (key->handle()->IsSymbol()) { Handle<Code> ic(Builtins::builtin(Builtins::StoreIC_Initialize)); Load(value); - frame_->PopToR0(); - // Fetch the object literal. - frame_->SpillAllButCopyTOSToR1(); - __ mov(r2, Operand(key->handle())); - frame_->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); + if (property->emit_store()) { + frame_->PopToR0(); + // Fetch the object literal. + frame_->SpillAllButCopyTOSToR1(); + __ mov(r2, Operand(key->handle())); + frame_->CallCodeObject(ic, RelocInfo::CODE_TARGET, 0); + } else { + frame_->Drop(); + } break; } // else fall through @@ -3624,7 +3634,11 @@ void CodeGenerator::VisitObjectLiteral(ObjectLiteral* node) { frame_->Dup(); Load(key); Load(value); - frame_->CallRuntime(Runtime::kSetProperty, 3); + if (property->emit_store()) { + frame_->CallRuntime(Runtime::kSetProperty, 3); + } else { + frame_->Drop(3); + } break; } case ObjectLiteral::Property::SETTER: { @@ -5482,73 +5496,6 @@ void CodeGenerator::GenerateRegExpConstructResult(ZoneList<Expression*>* args) { } -void CodeGenerator::GenerateRegExpCloneResult(ZoneList<Expression*>* args) { - ASSERT_EQ(1, args->length()); - - Load(args->at(0)); - frame_->PopToR0(); - { - VirtualFrame::SpilledScope spilled_scope(frame_); - - Label done; - Label call_runtime; - __ BranchOnSmi(r0, &done); - - // Load JSRegExp map into r1. Check that argument object has this map. - // Arguments to this function should be results of calling RegExp exec, - // which is either an unmodified JSRegExpResult or null. Anything not having - // the unmodified JSRegExpResult map is returned unmodified. - // This also ensures that elements are fast. - - __ ldr(r1, ContextOperand(cp, Context::GLOBAL_INDEX)); - __ ldr(r1, FieldMemOperand(r1, GlobalObject::kGlobalContextOffset)); - __ ldr(r1, ContextOperand(r1, Context::REGEXP_RESULT_MAP_INDEX)); - __ ldr(ip, FieldMemOperand(r0, HeapObject::kMapOffset)); - __ cmp(r1, Operand(ip)); - __ b(ne, &done); - - if (FLAG_debug_code) { - __ LoadRoot(r2, Heap::kEmptyFixedArrayRootIndex); - __ ldr(ip, FieldMemOperand(r0, JSObject::kPropertiesOffset)); - __ cmp(ip, r2); - __ Check(eq, "JSRegExpResult: default map but non-empty properties."); - } - - // All set, copy the contents to a new object. - __ AllocateInNewSpace(JSRegExpResult::kSize, - r2, - r3, - r4, - &call_runtime, - NO_ALLOCATION_FLAGS); - // Store RegExpResult map as map of allocated object. - ASSERT(JSRegExpResult::kSize == 6 * kPointerSize); - // Copy all fields (map is already in r1) from (untagged) r0 to r2. - // Change map of elements array (ends up in r4) to be a FixedCOWArray. - __ bic(r0, r0, Operand(kHeapObjectTagMask)); - __ ldm(ib, r0, r3.bit() | r4.bit() | r5.bit() | r6.bit() | r7.bit()); - __ stm(ia, r2, - r1.bit() | r3.bit() | r4.bit() | r5.bit() | r6.bit() | r7.bit()); - ASSERT(JSRegExp::kElementsOffset == 2 * kPointerSize); - // Check whether elements array is empty fixed array, and otherwise make - // it copy-on-write (it never should be empty unless someone is messing - // with the arguments to the runtime function). - __ LoadRoot(ip, Heap::kEmptyFixedArrayRootIndex); - __ add(r0, r2, Operand(kHeapObjectTag)); // Tag result and move it to r0. - __ cmp(r4, ip); - __ b(eq, &done); - __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex); - __ str(ip, FieldMemOperand(r4, HeapObject::kMapOffset)); - __ b(&done); - __ bind(&call_runtime); - __ push(r0); - __ CallRuntime(Runtime::kRegExpCloneResult, 1); - __ bind(&done); - } - frame_->EmitPush(r0); -} - - class DeferredSearchCache: public DeferredCode { public: DeferredSearchCache(Register dst, Register cache, Register key) |