| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 if (var->IsContextSlot()) { | 232 if (var->IsContextSlot()) { |
| 233 int parameter_offset = StandardFrameConstants::kCallerSPOffset + | 233 int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
| 234 (num_parameters - 1 - i) * kPointerSize; | 234 (num_parameters - 1 - i) * kPointerSize; |
| 235 // Load parameter from stack. | 235 // Load parameter from stack. |
| 236 __ ldr(r0, MemOperand(fp, parameter_offset)); | 236 __ ldr(r0, MemOperand(fp, parameter_offset)); |
| 237 // Store it in the context. | 237 // Store it in the context. |
| 238 MemOperand target = ContextOperand(cp, var->index()); | 238 MemOperand target = ContextOperand(cp, var->index()); |
| 239 __ str(r0, target); | 239 __ str(r0, target); |
| 240 // Update the write barrier. This clobbers r3 and r0. | 240 // Update the write barrier. This clobbers r3 and r0. |
| 241 __ RecordWriteContextSlot( | 241 __ RecordWriteContextSlot( |
| 242 cp, target.offset(), r0, r3, kLRHasBeenSaved, kSaveFPRegs); | 242 cp, target.offset(), r0, r3, GetLinkRegisterState(), kSaveFPRegs); |
| 243 } | 243 } |
| 244 } | 244 } |
| 245 Comment(";;; End allocate local context"); | 245 Comment(";;; End allocate local context"); |
| 246 } | 246 } |
| 247 | 247 |
| 248 // Trace the call. | 248 // Trace the call. |
| 249 if (FLAG_trace && info()->IsOptimizing()) { | 249 if (FLAG_trace && info()->IsOptimizing()) { |
| 250 __ CallRuntime(Runtime::kTraceEnter, 0); | 250 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 251 } | 251 } |
| 252 return !is_aborted(); | 252 return !is_aborted(); |
| (...skipping 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3067 | 3067 |
| 3068 __ str(value, target); | 3068 __ str(value, target); |
| 3069 if (instr->hydrogen()->NeedsWriteBarrier()) { | 3069 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 3070 HType type = instr->hydrogen()->value()->type(); | 3070 HType type = instr->hydrogen()->value()->type(); |
| 3071 SmiCheck check_needed = | 3071 SmiCheck check_needed = |
| 3072 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 3072 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 3073 __ RecordWriteContextSlot(context, | 3073 __ RecordWriteContextSlot(context, |
| 3074 target.offset(), | 3074 target.offset(), |
| 3075 value, | 3075 value, |
| 3076 scratch, | 3076 scratch, |
| 3077 kLRHasBeenSaved, | 3077 GetLinkRegisterState(), |
| 3078 kSaveFPRegs, | 3078 kSaveFPRegs, |
| 3079 EMIT_REMEMBERED_SET, | 3079 EMIT_REMEMBERED_SET, |
| 3080 check_needed); | 3080 check_needed); |
| 3081 } | 3081 } |
| 3082 | 3082 |
| 3083 __ bind(&skip_assignment); | 3083 __ bind(&skip_assignment); |
| 3084 } | 3084 } |
| 3085 | 3085 |
| 3086 | 3086 |
| 3087 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 3087 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4359 if (!instr->transition().is_null()) { | 4359 if (!instr->transition().is_null()) { |
| 4360 __ mov(scratch, Operand(instr->transition())); | 4360 __ mov(scratch, Operand(instr->transition())); |
| 4361 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 4361 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 4362 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 4362 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
| 4363 Register temp = ToRegister(instr->temp()); | 4363 Register temp = ToRegister(instr->temp()); |
| 4364 // Update the write barrier for the map field. | 4364 // Update the write barrier for the map field. |
| 4365 __ RecordWriteField(object, | 4365 __ RecordWriteField(object, |
| 4366 HeapObject::kMapOffset, | 4366 HeapObject::kMapOffset, |
| 4367 scratch, | 4367 scratch, |
| 4368 temp, | 4368 temp, |
| 4369 kLRHasBeenSaved, | 4369 GetLinkRegisterState(), |
| 4370 kSaveFPRegs, | 4370 kSaveFPRegs, |
| 4371 OMIT_REMEMBERED_SET, | 4371 OMIT_REMEMBERED_SET, |
| 4372 OMIT_SMI_CHECK); | 4372 OMIT_SMI_CHECK); |
| 4373 } | 4373 } |
| 4374 } | 4374 } |
| 4375 | 4375 |
| 4376 // Do the store. | 4376 // Do the store. |
| 4377 HType type = instr->hydrogen()->value()->type(); | 4377 HType type = instr->hydrogen()->value()->type(); |
| 4378 SmiCheck check_needed = | 4378 SmiCheck check_needed = |
| 4379 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4379 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 4380 if (instr->is_in_object()) { | 4380 if (instr->is_in_object()) { |
| 4381 __ str(value, FieldMemOperand(object, offset)); | 4381 __ str(value, FieldMemOperand(object, offset)); |
| 4382 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4382 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 4383 // Update the write barrier for the object for in-object properties. | 4383 // Update the write barrier for the object for in-object properties. |
| 4384 __ RecordWriteField(object, | 4384 __ RecordWriteField(object, |
| 4385 offset, | 4385 offset, |
| 4386 value, | 4386 value, |
| 4387 scratch, | 4387 scratch, |
| 4388 kLRHasBeenSaved, | 4388 GetLinkRegisterState(), |
| 4389 kSaveFPRegs, | 4389 kSaveFPRegs, |
| 4390 EMIT_REMEMBERED_SET, | 4390 EMIT_REMEMBERED_SET, |
| 4391 check_needed); | 4391 check_needed); |
| 4392 } | 4392 } |
| 4393 } else { | 4393 } else { |
| 4394 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 4394 __ ldr(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
| 4395 __ str(value, FieldMemOperand(scratch, offset)); | 4395 __ str(value, FieldMemOperand(scratch, offset)); |
| 4396 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4396 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 4397 // Update the write barrier for the properties array. | 4397 // Update the write barrier for the properties array. |
| 4398 // object is used as a scratch register. | 4398 // object is used as a scratch register. |
| 4399 __ RecordWriteField(scratch, | 4399 __ RecordWriteField(scratch, |
| 4400 offset, | 4400 offset, |
| 4401 value, | 4401 value, |
| 4402 object, | 4402 object, |
| 4403 kLRHasBeenSaved, | 4403 GetLinkRegisterState(), |
| 4404 kSaveFPRegs, | 4404 kSaveFPRegs, |
| 4405 EMIT_REMEMBERED_SET, | 4405 EMIT_REMEMBERED_SET, |
| 4406 check_needed); | 4406 check_needed); |
| 4407 } | 4407 } |
| 4408 } | 4408 } |
| 4409 } | 4409 } |
| 4410 | 4410 |
| 4411 | 4411 |
| 4412 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4412 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
| 4413 ASSERT(ToRegister(instr->object()).is(r1)); | 4413 ASSERT(ToRegister(instr->object()).is(r1)); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4594 | 4594 |
| 4595 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4595 if (instr->hydrogen()->NeedsWriteBarrier()) { |
| 4596 HType type = instr->hydrogen()->value()->type(); | 4596 HType type = instr->hydrogen()->value()->type(); |
| 4597 SmiCheck check_needed = | 4597 SmiCheck check_needed = |
| 4598 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4598 type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
| 4599 // Compute address of modified element and store it into key register. | 4599 // Compute address of modified element and store it into key register. |
| 4600 __ add(key, store_base, Operand(offset - kHeapObjectTag)); | 4600 __ add(key, store_base, Operand(offset - kHeapObjectTag)); |
| 4601 __ RecordWrite(elements, | 4601 __ RecordWrite(elements, |
| 4602 key, | 4602 key, |
| 4603 value, | 4603 value, |
| 4604 kLRHasBeenSaved, | 4604 GetLinkRegisterState(), |
| 4605 kSaveFPRegs, | 4605 kSaveFPRegs, |
| 4606 EMIT_REMEMBERED_SET, | 4606 EMIT_REMEMBERED_SET, |
| 4607 check_needed); | 4607 check_needed); |
| 4608 } | 4608 } |
| 4609 } | 4609 } |
| 4610 | 4610 |
| 4611 | 4611 |
| 4612 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { | 4612 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { |
| 4613 // By cases: external, fast double | 4613 // By cases: external, fast double |
| 4614 if (instr->is_external()) { | 4614 if (instr->is_external()) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4646 __ ldr(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset)); | 4646 __ ldr(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset)); |
| 4647 __ cmp(scratch, Operand(from_map)); | 4647 __ cmp(scratch, Operand(from_map)); |
| 4648 __ b(ne, ¬_applicable); | 4648 __ b(ne, ¬_applicable); |
| 4649 | 4649 |
| 4650 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { | 4650 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { |
| 4651 Register new_map_reg = ToRegister(instr->new_map_temp()); | 4651 Register new_map_reg = ToRegister(instr->new_map_temp()); |
| 4652 __ mov(new_map_reg, Operand(to_map)); | 4652 __ mov(new_map_reg, Operand(to_map)); |
| 4653 __ str(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset)); | 4653 __ str(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset)); |
| 4654 // Write barrier. | 4654 // Write barrier. |
| 4655 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, | 4655 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, |
| 4656 scratch, kLRHasBeenSaved, kDontSaveFPRegs); | 4656 scratch, GetLinkRegisterState(), kDontSaveFPRegs); |
| 4657 } else if (FLAG_compiled_transitions) { | 4657 } else if (FLAG_compiled_transitions) { |
| 4658 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 4658 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
| 4659 __ Move(r0, object_reg); | 4659 __ Move(r0, object_reg); |
| 4660 __ Move(r1, to_map); | 4660 __ Move(r1, to_map); |
| 4661 TransitionElementsKindStub stub(from_kind, to_kind); | 4661 TransitionElementsKindStub stub(from_kind, to_kind); |
| 4662 __ CallStub(&stub); | 4662 __ CallStub(&stub); |
| 4663 RecordSafepointWithRegisters( | 4663 RecordSafepointWithRegisters( |
| 4664 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4664 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
| 4665 } else if (IsFastSmiElementsKind(from_kind) && | 4665 } else if (IsFastSmiElementsKind(from_kind) && |
| 4666 IsFastDoubleElementsKind(to_kind)) { | 4666 IsFastDoubleElementsKind(to_kind)) { |
| (...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6398 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 6398 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 6399 __ ldr(result, FieldMemOperand(scratch, | 6399 __ ldr(result, FieldMemOperand(scratch, |
| 6400 FixedArray::kHeaderSize - kPointerSize)); | 6400 FixedArray::kHeaderSize - kPointerSize)); |
| 6401 __ bind(&done); | 6401 __ bind(&done); |
| 6402 } | 6402 } |
| 6403 | 6403 |
| 6404 | 6404 |
| 6405 #undef __ | 6405 #undef __ |
| 6406 | 6406 |
| 6407 } } // namespace v8::internal | 6407 } } // namespace v8::internal |
| OLD | NEW |