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 for (int i = 0 ; i < prototype_maps_.length(); i++) { | 90 info()->CommitDependentMaps(code); |
91 prototype_maps_.at(i)->AddDependentCode( | 91 |
92 DependentCode::kPrototypeCheckGroup, code); | |
93 } | |
94 for (int i = 0 ; i < transition_maps_.length(); i++) { | 92 for (int i = 0 ; i < transition_maps_.length(); i++) { |
95 transition_maps_.at(i)->AddDependentCode( | 93 transition_maps_.at(i)->AddDependentCode( |
96 DependentCode::kTransitionGroup, code); | 94 DependentCode::kTransitionGroup, code); |
97 } | 95 } |
98 if (graph()->depends_on_empty_array_proto_elements()) { | 96 if (graph()->depends_on_empty_array_proto_elements()) { |
99 isolate()->initial_object_prototype()->map()->AddDependentCode( | 97 isolate()->initial_object_prototype()->map()->AddDependentCode( |
100 DependentCode::kElementsCantBeAddedGroup, code); | 98 DependentCode::kElementsCantBeAddedGroup, code); |
101 isolate()->initial_array_prototype()->map()->AddDependentCode( | 99 isolate()->initial_array_prototype()->map()->AddDependentCode( |
102 DependentCode::kElementsCantBeAddedGroup, code); | 100 DependentCode::kElementsCantBeAddedGroup, code); |
103 } | 101 } |
(...skipping 5016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5120 | 5118 |
5121 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { | 5119 void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
5122 Register prototype_reg = ToRegister(instr->temp()); | 5120 Register prototype_reg = ToRegister(instr->temp()); |
5123 Register map_reg = ToRegister(instr->temp2()); | 5121 Register map_reg = ToRegister(instr->temp2()); |
5124 | 5122 |
5125 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); | 5123 ZoneList<Handle<JSObject> >* prototypes = instr->prototypes(); |
5126 ZoneList<Handle<Map> >* maps = instr->maps(); | 5124 ZoneList<Handle<Map> >* maps = instr->maps(); |
5127 | 5125 |
5128 ASSERT(prototypes->length() == maps->length()); | 5126 ASSERT(prototypes->length() == maps->length()); |
5129 | 5127 |
5130 if (instr->hydrogen()->CanOmitPrototypeChecks()) { | 5128 if (!instr->hydrogen()->CanOmitPrototypeChecks()) { |
5131 for (int i = 0; i < maps->length(); i++) { | |
5132 prototype_maps_.Add(maps->at(i), info()->zone()); | |
5133 } | |
5134 } else { | |
5135 for (int i = 0; i < prototypes->length(); i++) { | 5129 for (int i = 0; i < prototypes->length(); i++) { |
5136 __ LoadHeapObject(prototype_reg, prototypes->at(i)); | 5130 __ LoadHeapObject(prototype_reg, prototypes->at(i)); |
5137 __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); | 5131 __ lw(map_reg, FieldMemOperand(prototype_reg, HeapObject::kMapOffset)); |
5138 DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); | 5132 DoCheckMapCommon(map_reg, maps->at(i), instr->environment()); |
5139 } | 5133 } |
5140 } | 5134 } |
5141 } | 5135 } |
5142 | 5136 |
5143 | 5137 |
5144 void LCodeGen::DoAllocate(LAllocate* instr) { | 5138 void LCodeGen::DoAllocate(LAllocate* instr) { |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5696 __ Subu(scratch, result, scratch); | 5690 __ Subu(scratch, result, scratch); |
5697 __ lw(result, FieldMemOperand(scratch, | 5691 __ lw(result, FieldMemOperand(scratch, |
5698 FixedArray::kHeaderSize - kPointerSize)); | 5692 FixedArray::kHeaderSize - kPointerSize)); |
5699 __ bind(&done); | 5693 __ bind(&done); |
5700 } | 5694 } |
5701 | 5695 |
5702 | 5696 |
5703 #undef __ | 5697 #undef __ |
5704 | 5698 |
5705 } } // namespace v8::internal | 5699 } } // namespace v8::internal |
OLD | NEW |