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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 | 86 |
87 void LCodeGen::FinishCode(Handle<Code> code) { | 87 void LCodeGen::FinishCode(Handle<Code> code) { |
88 ASSERT(is_done()); | 88 ASSERT(is_done()); |
89 code->set_stack_slots(GetStackSlotCount()); | 89 code->set_stack_slots(GetStackSlotCount()); |
90 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 90 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
91 if (FLAG_weak_embedded_maps_in_optimized_code) { | 91 if (FLAG_weak_embedded_maps_in_optimized_code) { |
92 RegisterDependentCodeForEmbeddedMaps(code); | 92 RegisterDependentCodeForEmbeddedMaps(code); |
93 } | 93 } |
94 PopulateDeoptimizationData(code); | 94 PopulateDeoptimizationData(code); |
95 info()->CommitDependentMaps(code); | 95 for (int i = 0 ; i < prototype_maps_.length(); i++) { |
| 96 prototype_maps_.at(i)->AddDependentCode( |
| 97 DependentCode::kPrototypeCheckGroup, code); |
| 98 } |
| 99 for (int i = 0 ; i < transition_maps_.length(); i++) { |
| 100 transition_maps_.at(i)->AddDependentCode( |
| 101 DependentCode::kTransitionGroup, code); |
| 102 } |
| 103 if (graph()->depends_on_empty_array_proto_elements()) { |
| 104 isolate()->initial_object_prototype()->map()->AddDependentCode( |
| 105 DependentCode::kElementsCantBeAddedGroup, code); |
| 106 isolate()->initial_array_prototype()->map()->AddDependentCode( |
| 107 DependentCode::kElementsCantBeAddedGroup, code); |
| 108 } |
96 } | 109 } |
97 | 110 |
98 | 111 |
99 void LChunkBuilder::Abort(const char* reason) { | 112 void LChunkBuilder::Abort(const char* reason) { |
100 info()->set_bailout_reason(reason); | 113 info()->set_bailout_reason(reason); |
101 status_ = ABORTED; | 114 status_ = ABORTED; |
102 } | 115 } |
103 | 116 |
104 | 117 |
105 void LCodeGen::Comment(const char* format, ...) { | 118 void LCodeGen::Comment(const char* format, ...) { |
(...skipping 3882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3988 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 4001 } else if (FLAG_track_double_fields && representation.IsDouble()) { |
3989 ASSERT(transition.is_null()); | 4002 ASSERT(transition.is_null()); |
3990 ASSERT(access.IsInobject()); | 4003 ASSERT(access.IsInobject()); |
3991 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4004 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
3992 XMMRegister value = ToDoubleRegister(instr->value()); | 4005 XMMRegister value = ToDoubleRegister(instr->value()); |
3993 __ movsd(FieldOperand(object, offset), value); | 4006 __ movsd(FieldOperand(object, offset), value); |
3994 return; | 4007 return; |
3995 } | 4008 } |
3996 | 4009 |
3997 if (!transition.is_null()) { | 4010 if (!transition.is_null()) { |
| 4011 if (transition->CanBeDeprecated()) { |
| 4012 transition_maps_.Add(transition, info()->zone()); |
| 4013 } |
3998 if (!instr->hydrogen()->NeedsWriteBarrierForMap()) { | 4014 if (!instr->hydrogen()->NeedsWriteBarrierForMap()) { |
3999 __ Move(FieldOperand(object, HeapObject::kMapOffset), transition); | 4015 __ Move(FieldOperand(object, HeapObject::kMapOffset), transition); |
4000 } else { | 4016 } else { |
4001 Register temp = ToRegister(instr->temp()); | 4017 Register temp = ToRegister(instr->temp()); |
4002 __ Move(kScratchRegister, transition); | 4018 __ Move(kScratchRegister, transition); |
4003 __ movq(FieldOperand(object, HeapObject::kMapOffset), kScratchRegister); | 4019 __ movq(FieldOperand(object, HeapObject::kMapOffset), kScratchRegister); |
4004 // Update the write barrier for the map field. | 4020 // Update the write barrier for the map field. |
4005 __ RecordWriteField(object, | 4021 __ RecordWriteField(object, |
4006 HeapObject::kMapOffset, | 4022 HeapObject::kMapOffset, |
4007 kScratchRegister, | 4023 kScratchRegister, |
(...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5060 | 5076 |
5061 | 5077 |
5062 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5078 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
5063 Register reg = ToRegister(instr->temp()); | 5079 Register reg = ToRegister(instr->temp()); |
5064 | 5080 |
5065 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5081 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
5066 ZoneList<Handle<Map> >* maps = instr->maps(); | 5082 ZoneList<Handle<Map> >* maps = instr->maps(); |
5067 | 5083 |
5068 ASSERT(prototypes->length() == maps->length()); | 5084 ASSERT(prototypes->length() == maps->length()); |
5069 | 5085 |
5070 if (!instr->hydrogen()->CanOmitPrototypeChecks()) { | 5086 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
| 5087 for (int i = 0; i < maps->length(); i++) { |
| 5088 prototype_maps_.Add(maps->at(i), info()->zone()); |
| 5089 } |
| 5090 } else { |
5071 for (int i = 0; i < prototypes->length(); i++) { | 5091 for (int i = 0; i < prototypes->length(); i++) { |
5072 __ LoadHeapObject(reg, prototypes->at(i)); | 5092 __ LoadHeapObject(reg, prototypes->at(i)); |
5073 DoCheckMapCommon(reg, maps->at(i), instr); | 5093 DoCheckMapCommon(reg, maps->at(i), instr); |
5074 } | 5094 } |
5075 } | 5095 } |
5076 } | 5096 } |
5077 | 5097 |
5078 | 5098 |
5079 void LCodeGen::DoAllocate(LAllocate* instr) { | 5099 void LCodeGen::DoAllocate(LAllocate* instr) { |
5080 class DeferredAllocate: public LDeferredCode { | 5100 class DeferredAllocate: public LDeferredCode { |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5597 FixedArray::kHeaderSize - kPointerSize)); | 5617 FixedArray::kHeaderSize - kPointerSize)); |
5598 __ bind(&done); | 5618 __ bind(&done); |
5599 } | 5619 } |
5600 | 5620 |
5601 | 5621 |
5602 #undef __ | 5622 #undef __ |
5603 | 5623 |
5604 } } // namespace v8::internal | 5624 } } // namespace v8::internal |
5605 | 5625 |
5606 #endif // V8_TARGET_ARCH_X64 | 5626 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |