OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 4059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4070 } | 4070 } |
4071 | 4071 |
4072 if (instr->hydrogen()->has_transition()) { | 4072 if (instr->hydrogen()->has_transition()) { |
4073 Handle<Map> transition = instr->hydrogen()->transition_map(); | 4073 Handle<Map> transition = instr->hydrogen()->transition_map(); |
4074 AddDeprecationDependency(transition); | 4074 AddDeprecationDependency(transition); |
4075 __ li(scratch, Operand(transition)); | 4075 __ li(scratch, Operand(transition)); |
4076 __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 4076 __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
4077 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 4077 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
4078 Register temp = ToRegister(instr->temp()); | 4078 Register temp = ToRegister(instr->temp()); |
4079 // Update the write barrier for the map field. | 4079 // Update the write barrier for the map field. |
4080 __ RecordWriteField(object, | 4080 __ RecordWriteForMap(object, |
4081 HeapObject::kMapOffset, | 4081 scratch, |
4082 scratch, | 4082 temp, |
4083 temp, | 4083 GetRAState(), |
4084 GetRAState(), | 4084 kSaveFPRegs); |
4085 kSaveFPRegs, | |
4086 OMIT_REMEMBERED_SET, | |
4087 OMIT_SMI_CHECK); | |
4088 } | 4085 } |
4089 } | 4086 } |
4090 | 4087 |
4091 // Do the store. | 4088 // Do the store. |
4092 Register value = ToRegister(instr->value()); | 4089 Register value = ToRegister(instr->value()); |
4093 if (access.IsInobject()) { | 4090 if (access.IsInobject()) { |
4094 MemOperand operand = FieldMemOperand(object, offset); | 4091 MemOperand operand = FieldMemOperand(object, offset); |
4095 __ Store(value, operand, representation); | 4092 __ Store(value, operand, representation); |
4096 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4093 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4097 // Update the write barrier for the object for in-object properties. | 4094 // Update the write barrier for the object for in-object properties. |
4098 __ RecordWriteField(object, | 4095 __ RecordWriteField(object, |
4099 offset, | 4096 offset, |
4100 value, | 4097 value, |
4101 scratch, | 4098 scratch, |
4102 GetRAState(), | 4099 GetRAState(), |
4103 kSaveFPRegs, | 4100 kSaveFPRegs, |
4104 EMIT_REMEMBERED_SET, | 4101 EMIT_REMEMBERED_SET, |
4105 instr->hydrogen()->SmiCheckForWriteBarrier()); | 4102 instr->hydrogen()->SmiCheckForWriteBarrier(), |
| 4103 instr->hydrogen()->PointersToHereCheckForValue()); |
4106 } | 4104 } |
4107 } else { | 4105 } else { |
4108 __ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 4106 __ lw(scratch, FieldMemOperand(object, JSObject::kPropertiesOffset)); |
4109 MemOperand operand = FieldMemOperand(scratch, offset); | 4107 MemOperand operand = FieldMemOperand(scratch, offset); |
4110 __ Store(value, operand, representation); | 4108 __ Store(value, operand, representation); |
4111 if (instr->hydrogen()->NeedsWriteBarrier()) { | 4109 if (instr->hydrogen()->NeedsWriteBarrier()) { |
4112 // Update the write barrier for the properties array. | 4110 // Update the write barrier for the properties array. |
4113 // object is used as a scratch register. | 4111 // object is used as a scratch register. |
4114 __ RecordWriteField(scratch, | 4112 __ RecordWriteField(scratch, |
4115 offset, | 4113 offset, |
4116 value, | 4114 value, |
4117 object, | 4115 object, |
4118 GetRAState(), | 4116 GetRAState(), |
4119 kSaveFPRegs, | 4117 kSaveFPRegs, |
4120 EMIT_REMEMBERED_SET, | 4118 EMIT_REMEMBERED_SET, |
4121 instr->hydrogen()->SmiCheckForWriteBarrier()); | 4119 instr->hydrogen()->SmiCheckForWriteBarrier(), |
| 4120 instr->hydrogen()->PointersToHereCheckForValue()); |
4122 } | 4121 } |
4123 } | 4122 } |
4124 } | 4123 } |
4125 | 4124 |
4126 | 4125 |
4127 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4126 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { |
4128 ASSERT(ToRegister(instr->context()).is(cp)); | 4127 ASSERT(ToRegister(instr->context()).is(cp)); |
4129 ASSERT(ToRegister(instr->object()).is(a1)); | 4128 ASSERT(ToRegister(instr->object()).is(a1)); |
4130 ASSERT(ToRegister(instr->value()).is(a0)); | 4129 ASSERT(ToRegister(instr->value()).is(a0)); |
4131 | 4130 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4331 instr->hydrogen()->value()->type().IsHeapObject() | 4330 instr->hydrogen()->value()->type().IsHeapObject() |
4332 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 4331 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
4333 // Compute address of modified element and store it into key register. | 4332 // Compute address of modified element and store it into key register. |
4334 __ Addu(key, store_base, Operand(offset)); | 4333 __ Addu(key, store_base, Operand(offset)); |
4335 __ RecordWrite(elements, | 4334 __ RecordWrite(elements, |
4336 key, | 4335 key, |
4337 value, | 4336 value, |
4338 GetRAState(), | 4337 GetRAState(), |
4339 kSaveFPRegs, | 4338 kSaveFPRegs, |
4340 EMIT_REMEMBERED_SET, | 4339 EMIT_REMEMBERED_SET, |
4341 check_needed); | 4340 check_needed, |
| 4341 instr->hydrogen()->PointersToHereCheckForValue()); |
4342 } | 4342 } |
4343 } | 4343 } |
4344 | 4344 |
4345 | 4345 |
4346 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { | 4346 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { |
4347 // By cases: external, fast double | 4347 // By cases: external, fast double |
4348 if (instr->is_typed_elements()) { | 4348 if (instr->is_typed_elements()) { |
4349 DoStoreKeyedExternalArray(instr); | 4349 DoStoreKeyedExternalArray(instr); |
4350 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4350 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
4351 DoStoreKeyedFixedDoubleArray(instr); | 4351 DoStoreKeyedFixedDoubleArray(instr); |
(...skipping 27 matching lines...) Expand all Loading... |
4379 | 4379 |
4380 Label not_applicable; | 4380 Label not_applicable; |
4381 __ lw(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset)); | 4381 __ lw(scratch, FieldMemOperand(object_reg, HeapObject::kMapOffset)); |
4382 __ Branch(¬_applicable, ne, scratch, Operand(from_map)); | 4382 __ Branch(¬_applicable, ne, scratch, Operand(from_map)); |
4383 | 4383 |
4384 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { | 4384 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { |
4385 Register new_map_reg = ToRegister(instr->new_map_temp()); | 4385 Register new_map_reg = ToRegister(instr->new_map_temp()); |
4386 __ li(new_map_reg, Operand(to_map)); | 4386 __ li(new_map_reg, Operand(to_map)); |
4387 __ sw(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset)); | 4387 __ sw(new_map_reg, FieldMemOperand(object_reg, HeapObject::kMapOffset)); |
4388 // Write barrier. | 4388 // Write barrier. |
4389 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, | 4389 __ RecordWriteForMap(object_reg, |
4390 scratch, GetRAState(), kDontSaveFPRegs); | 4390 new_map_reg, |
| 4391 scratch, |
| 4392 GetRAState(), |
| 4393 kDontSaveFPRegs); |
4391 } else { | 4394 } else { |
4392 ASSERT(object_reg.is(a0)); | 4395 ASSERT(object_reg.is(a0)); |
4393 ASSERT(ToRegister(instr->context()).is(cp)); | 4396 ASSERT(ToRegister(instr->context()).is(cp)); |
4394 PushSafepointRegistersScope scope( | 4397 PushSafepointRegistersScope scope( |
4395 this, Safepoint::kWithRegistersAndDoubles); | 4398 this, Safepoint::kWithRegistersAndDoubles); |
4396 __ li(a1, Operand(to_map)); | 4399 __ li(a1, Operand(to_map)); |
4397 bool is_js_array = from_map->instance_type() == JS_ARRAY_TYPE; | 4400 bool is_js_array = from_map->instance_type() == JS_ARRAY_TYPE; |
4398 TransitionElementsKindStub stub(isolate(), from_kind, to_kind, is_js_array); | 4401 TransitionElementsKindStub stub(isolate(), from_kind, to_kind, is_js_array); |
4399 __ CallStub(&stub); | 4402 __ CallStub(&stub); |
4400 RecordSafepointWithRegistersAndDoubles( | 4403 RecordSafepointWithRegistersAndDoubles( |
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5867 __ lw(result, FieldMemOperand(scratch, | 5870 __ lw(result, FieldMemOperand(scratch, |
5868 FixedArray::kHeaderSize - kPointerSize)); | 5871 FixedArray::kHeaderSize - kPointerSize)); |
5869 __ bind(deferred->exit()); | 5872 __ bind(deferred->exit()); |
5870 __ bind(&done); | 5873 __ bind(&done); |
5871 } | 5874 } |
5872 | 5875 |
5873 | 5876 |
5874 #undef __ | 5877 #undef __ |
5875 | 5878 |
5876 } } // namespace v8::internal | 5879 } } // namespace v8::internal |
OLD | NEW |