| 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 LChunkBuilder::Abort(const char* reason) { | 107 void LChunkBuilder::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 3868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3969 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 3982 } else if (FLAG_track_double_fields && representation.IsDouble()) { |
| 3970 ASSERT(transition.is_null()); | 3983 ASSERT(transition.is_null()); |
| 3971 ASSERT(access.IsInobject()); | 3984 ASSERT(access.IsInobject()); |
| 3972 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); | 3985 ASSERT(!instr->hydrogen()->NeedsWriteBarrier()); |
| 3973 DoubleRegister value = ToDoubleRegister(instr->value()); | 3986 DoubleRegister value = ToDoubleRegister(instr->value()); |
| 3974 __ sdc1(value, FieldMemOperand(object, offset)); | 3987 __ sdc1(value, FieldMemOperand(object, offset)); |
| 3975 return; | 3988 return; |
| 3976 } | 3989 } |
| 3977 | 3990 |
| 3978 if (!transition.is_null()) { | 3991 if (!transition.is_null()) { |
| 3992 if (transition->CanBeDeprecated()) { |
| 3993 transition_maps_.Add(transition, info()->zone()); |
| 3994 } |
| 3979 __ li(scratch, Operand(transition)); | 3995 __ li(scratch, Operand(transition)); |
| 3980 __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); | 3996 __ sw(scratch, FieldMemOperand(object, HeapObject::kMapOffset)); |
| 3981 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { | 3997 if (instr->hydrogen()->NeedsWriteBarrierForMap()) { |
| 3982 Register temp = ToRegister(instr->temp()); | 3998 Register temp = ToRegister(instr->temp()); |
| 3983 // Update the write barrier for the map field. | 3999 // Update the write barrier for the map field. |
| 3984 __ RecordWriteField(object, | 4000 __ RecordWriteField(object, |
| 3985 HeapObject::kMapOffset, | 4001 HeapObject::kMapOffset, |
| 3986 scratch, | 4002 scratch, |
| 3987 temp, | 4003 temp, |
| 3988 GetRAState(), | 4004 GetRAState(), |
| (...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5119 | 5135 |
| 5120 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5136 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
| 5121 Register prototype_reg = ToRegister(instr->temp()); | 5137 Register prototype_reg = ToRegister(instr->temp()); |
| 5122 Register map_reg = ToRegister(instr->temp2()); | 5138 Register map_reg = ToRegister(instr->temp2()); |
| 5123 | 5139 |
| 5124 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5140 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
| 5125 ZoneList<Handle<Map> >* maps = instr->maps(); | 5141 ZoneList<Handle<Map> >* maps = instr->maps(); |
| 5126 | 5142 |
| 5127 ASSERT(prototypes->length() == maps->length()); | 5143 ASSERT(prototypes->length() == maps->length()); |
| 5128 | 5144 |
| 5129 if (!instr->hydrogen()->CanOmitPrototypeChecks()) { | 5145 if (instr->hydrogen()->CanOmitPrototypeChecks()) { |
| 5146 for (int i = 0; i < maps->length(); i++) { |
| 5147 prototype_maps_.Add(maps->at(i), info()->zone()); |
| 5148 } |
| 5149 } else { |
| 5130 for (int i = 0; i < prototypes->length(); i++) { | 5150 for (int i = 0; i < prototypes->length(); i++) { |
| 5131 __ LoadHeapObject(prototype_reg, prototypes->at(i)); | 5151 __ LoadHeapObject(prototype_reg, prototypes->at(i)); |
| 5132 __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); | 5152 __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
| 5133 DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); | 5153 DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); |
| 5134 } | 5154 } |
| 5135 } | 5155 } |
| 5136 } | 5156 } |
| 5137 | 5157 |
| 5138 | 5158 |
| 5139 void LCodeGen::DoAllocate(LAllocate* instr) { | 5159 void LCodeGen::DoAllocate(LAllocate* instr) { |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5691 __ Subu(scratch, result, scratch); | 5711 __ Subu(scratch, result, scratch); |
| 5692 __ lw(result, FieldMemOperand(scratch, | 5712 __ lw(result, FieldMemOperand(scratch, |
| 5693 FixedArray::kHeaderSize - kPointerSize)); | 5713 FixedArray::kHeaderSize - kPointerSize)); |
| 5694 __ bind(&done); | 5714 __ bind(&done); |
| 5695 } | 5715 } |
| 5696 | 5716 |
| 5697 | 5717 |
| 5698 #undef __ | 5718 #undef __ |
| 5699 | 5719 |
| 5700 } } // namespace v8::internal | 5720 } } // namespace v8::internal |
| OLD | NEW |