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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 | 81 |
82 void LCodeGen::FinishCode(Handle<Code> code) { | 82 void LCodeGen::FinishCode(Handle<Code> code) { |
83 ASSERT(is_done()); | 83 ASSERT(is_done()); |
84 code->set_stack_slots(GetStackSlotCount()); | 84 code->set_stack_slots(GetStackSlotCount()); |
85 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); | 85 code->set_safepoint_table_offset(safepoints_.GetCodeOffset()); |
86 if (FLAG_weak_embedded_maps_in_optimized_code) { | 86 if (FLAG_weak_embedded_maps_in_optimized_code) { |
87 RegisterDependentCodeForEmbeddedMaps(code); | 87 RegisterDependentCodeForEmbeddedMaps(code); |
88 } | 88 } |
89 PopulateDeoptimizationData(code); | 89 PopulateDeoptimizationData(code); |
90 info()->CommitDependentMaps(code); | 90 for (int i = 0 ; i < prototype_maps_.length(); i++) { |
| 91 prototype_maps_.at(i)->AddDependentCode( |
| 92 DependentCode::kPrototypeCheckGroup, code); |
| 93 } |
| 94 for (int i = 0 ; i < transition_maps_.length(); i++) { |
| 95 transition_maps_.at(i)->AddDependentCode( |
| 96 DependentCode::kTransitionGroup, code); |
| 97 } |
| 98 if (graph()->depends_on_empty_array_proto_elements()) { |
| 99 isolate()->initial_object_prototype()->map()->AddDependentCode( |
| 100 DependentCode::kElementsCantBeAddedGroup, code); |
| 101 isolate()->initial_array_prototype()->map()->AddDependentCode( |
| 102 DependentCode::kElementsCantBeAddedGroup, code); |
| 103 } |
91 } | 104 } |
92 | 105 |
93 | 106 |
94 void LCodeGen::Abort(const char* reason) { | 107 void LCodeGen::Abort(const char* reason) { |
95 info()->set_bailout_reason(reason); | 108 info()->set_bailout_reason(reason); |
96 status_ = ABORTED; | 109 status_ = ABORTED; |
97 } | 110 } |
98 | 111 |
99 | 112 |
100 void LCodeGen::Comment(const char* format, ...) { | 113 void LCodeGen::Comment(const char* format, ...) { |
(...skipping 4132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4233 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 4246 } else if (FLAG_track_double_fields && representation.IsDouble()) { |
4234 ASSERT(transition.is_null()); | 4247 ASSERT(transition.is_null()); |
4235 ASSERT(access.IsInobject()); | 4248 ASSERT(access.IsInobject()); |
4236 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 4249 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
4237 DwVfpRegister value = ToDoubleRegister(instr->value()); | 4250 DwVfpRegister value = ToDoubleRegister(instr->value()); |
4238 __ vstr(value, FieldMemOperand(object, offset)); | 4251 __ vstr(value, FieldMemOperand(object, offset)); |
4239 return; | 4252 return; |
4240 } | 4253 } |
4241 | 4254 |
4242 if (!transition.is_null()) { | 4255 if (!transition.is_null()) { |
| 4256 if (transition->CanBeDeprecated()) { |
| 4257 transition_maps_.Add(transition, info()->zone()); |
| 4258 } |
4243 __ mov(scratch, Operand(transition)); | 4259 __ mov(scratch, Operand(transition)); |
4244 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 4260 __ str(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
4245 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 4261 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
4246 Register temp = ToRegister(instr->temp()); | 4262 Register temp = ToRegister(instr->temp()); |
4247 // Update the write barrier for the map field. | 4263 // Update the write barrier for the map field. |
4248 __ RecordWriteField(object, | 4264 __ RecordWriteField(object, |
4249 HeapObject::kMapOffset, | 4265 HeapObject::kMapOffset, |
4250 scratch, | 4266 scratch, |
4251 temp, | 4267 temp, |
4252 GetLinkRegisterState(), | 4268 GetLinkRegisterState(), |
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5345 | 5361 |
5346 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5362 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
5347 Register prototype_reg = ToRegister(instr->temp()); | 5363 Register prototype_reg = ToRegister(instr->temp()); |
5348 Register map_reg = ToRegister(instr->temp2()); | 5364 Register map_reg = ToRegister(instr->temp2()); |
5349 | 5365 |
5350 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5366 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
5351 ZoneList<Handle<Map> >* maps = instr->maps(); | 5367 ZoneList<Handle<Map> >* maps = instr->maps(); |
5352 | 5368 |
5353 ASSERT(prototypes->length() == maps->length()); | 5369 ASSERT(prototypes->length() == maps->length()); |
5354 | 5370 |
5355 if (!instr->hydrogen()->CanOmitPrototypeChecks()) { | 5371 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
| 5372 for (int i = 0; i < maps->length(); i++) { |
| 5373 prototype_maps_.Add(maps->at(i), info()->zone()); |
| 5374 } |
| 5375 } else { |
5356 for (int i = 0; i < prototypes->length(); i++) { | 5376 for (int i = 0; i < prototypes->length(); i++) { |
5357 __ LoadHeapObject(prototype_reg, prototypes->at(i)); | 5377 __ LoadHeapObject(prototype_reg, prototypes->at(i)); |
5358 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); | 5378 __ ldr(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
5359 DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); | 5379 DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); |
5360 } | 5380 } |
5361 } | 5381 } |
5362 } | 5382 } |
5363 | 5383 |
5364 | 5384 |
5365 void LCodeGen::DoAllocate(LAllocate* instr) { | 5385 void LCodeGen::DoAllocate(LAllocate* instr) { |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5877 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5897 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5878 __ ldr(result, FieldMemOperand(scratch, | 5898 __ ldr(result, FieldMemOperand(scratch, |
5879 FixedArray::kHeaderSize - kPointerSize)); | 5899 FixedArray::kHeaderSize - kPointerSize)); |
5880 __ bind(&done); | 5900 __ bind(&done); |
5881 } | 5901 } |
5882 | 5902 |
5883 | 5903 |
5884 #undef __ | 5904 #undef __ |
5885 | 5905 |
5886 } } // namespace v8::internal | 5906 } } // namespace v8::internal |
OLD | NEW |