OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 4270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4281 __ Cmp(FieldOperand(object_reg, HeapObject::kMapOffset), from_map); | 4281 __ Cmp(FieldOperand(object_reg, HeapObject::kMapOffset), from_map); |
4282 __ j(not_equal, ¬_applicable); | 4282 __ j(not_equal, ¬_applicable); |
4283 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { | 4283 if (IsSimpleMapChangeTransition(from_kind, to_kind)) { |
4284 Register new_map_reg = ToRegister(instr->new_map_temp()); | 4284 Register new_map_reg = ToRegister(instr->new_map_temp()); |
4285 __ movq(new_map_reg, to_map, RelocInfo::EMBEDDED_OBJECT); | 4285 __ movq(new_map_reg, to_map, RelocInfo::EMBEDDED_OBJECT); |
4286 __ movq(FieldOperand(object_reg, HeapObject::kMapOffset), new_map_reg); | 4286 __ movq(FieldOperand(object_reg, HeapObject::kMapOffset), new_map_reg); |
4287 // Write barrier. | 4287 // Write barrier. |
4288 ASSERT_NE(instr->temp(), NULL); | 4288 ASSERT_NE(instr->temp(), NULL); |
4289 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, | 4289 __ RecordWriteField(object_reg, HeapObject::kMapOffset, new_map_reg, |
4290 ToRegister(instr->temp()), kDontSaveFPRegs); | 4290 ToRegister(instr->temp()), kDontSaveFPRegs); |
4291 } else if (FLAG_compiled_transitions) { | 4291 } else { |
4292 PushSafepointRegistersScope scope(this); | 4292 PushSafepointRegistersScope scope(this); |
4293 if (!object_reg.is(rax)) { | 4293 if (!object_reg.is(rax)) { |
4294 __ movq(rax, object_reg); | 4294 __ movq(rax, object_reg); |
4295 } | 4295 } |
4296 __ Move(rbx, to_map); | 4296 __ Move(rbx, to_map); |
4297 TransitionElementsKindStub stub(from_kind, to_kind); | 4297 TransitionElementsKindStub stub(from_kind, to_kind); |
4298 __ CallStub(&stub); | 4298 __ CallStub(&stub); |
4299 RecordSafepointWithRegisters( | 4299 RecordSafepointWithRegisters( |
4300 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); | 4300 instr->pointer_map(), 0, Safepoint::kNoLazyDeopt); |
4301 } else if (IsFastSmiElementsKind(from_kind) && | |
4302 IsFastDoubleElementsKind(to_kind)) { | |
4303 Register fixed_object_reg = ToRegister(instr->temp()); | |
4304 ASSERT(fixed_object_reg.is(rdx)); | |
4305 Register new_map_reg = ToRegister(instr->new_map_temp()); | |
4306 ASSERT(new_map_reg.is(rbx)); | |
4307 __ movq(new_map_reg, to_map, RelocInfo::EMBEDDED_OBJECT); | |
4308 __ movq(fixed_object_reg, object_reg); | |
4309 CallCode(isolate()->builtins()->TransitionElementsSmiToDouble(), | |
4310 RelocInfo::CODE_TARGET, instr); | |
4311 } else if (IsFastDoubleElementsKind(from_kind) && | |
4312 IsFastObjectElementsKind(to_kind)) { | |
4313 Register fixed_object_reg = ToRegister(instr->temp()); | |
4314 ASSERT(fixed_object_reg.is(rdx)); | |
4315 Register new_map_reg = ToRegister(instr->new_map_temp()); | |
4316 ASSERT(new_map_reg.is(rbx)); | |
4317 __ movq(new_map_reg, to_map, RelocInfo::EMBEDDED_OBJECT); | |
4318 __ movq(fixed_object_reg, object_reg); | |
4319 CallCode(isolate()->builtins()->TransitionElementsDoubleToObject(), | |
4320 RelocInfo::CODE_TARGET, instr); | |
4321 } else { | |
4322 UNREACHABLE(); | |
4323 } | 4301 } |
4324 __ bind(¬_applicable); | 4302 __ bind(¬_applicable); |
4325 } | 4303 } |
4326 | 4304 |
4327 | 4305 |
4328 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { | 4306 void LCodeGen::DoTrapAllocationMemento(LTrapAllocationMemento* instr) { |
4329 Register object = ToRegister(instr->object()); | 4307 Register object = ToRegister(instr->object()); |
4330 Register temp = ToRegister(instr->temp()); | 4308 Register temp = ToRegister(instr->temp()); |
4331 __ TestJSArrayForAllocationMemento(object, temp); | 4309 __ TestJSArrayForAllocationMemento(object, temp); |
4332 DeoptimizeIf(equal, instr->environment()); | 4310 DeoptimizeIf(equal, instr->environment()); |
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5559 FixedArray::kHeaderSize - kPointerSize)); | 5537 FixedArray::kHeaderSize - kPointerSize)); |
5560 __ bind(&done); | 5538 __ bind(&done); |
5561 } | 5539 } |
5562 | 5540 |
5563 | 5541 |
5564 #undef __ | 5542 #undef __ |
5565 | 5543 |
5566 } } // namespace v8::internal | 5544 } } // namespace v8::internal |
5567 | 5545 |
5568 #endif // V8_TARGET_ARCH_X64 | 5546 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |