| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 void CompilationInfo::CommitDependentMaps(Handle<Code> code) { | 141 void CompilationInfo::CommitDependentMaps(Handle<Code> code) { |
| 142 for (int i = 0; i < DependentCode::kGroupCount; i++) { | 142 for (int i = 0; i < DependentCode::kGroupCount; i++) { |
| 143 ZoneList<Handle<Map> >* group_maps = dependent_maps_[i]; | 143 ZoneList<Handle<Map> >* group_maps = dependent_maps_[i]; |
| 144 if (group_maps == NULL) continue; | 144 if (group_maps == NULL) continue; |
| 145 ASSERT(!object_wrapper_.is_null()); | 145 ASSERT(!object_wrapper_.is_null()); |
| 146 for (int j = 0; j < group_maps->length(); j++) { | 146 for (int j = 0; j < group_maps->length(); j++) { |
| 147 group_maps->at(j)->dependent_code()->UpdateToFinishedCode( | 147 group_maps->at(j)->dependent_code()->UpdateToFinishedCode( |
| 148 static_cast<DependentCode::DependencyGroup>(i), this, *code); | 148 static_cast<DependentCode::DependencyGroup>(i), this, *code); |
| 149 } | 149 } |
| 150 #ifndef DEBUG |
| 150 dependent_maps_[i] = NULL; // Zone-allocated, no need to delete. | 151 dependent_maps_[i] = NULL; // Zone-allocated, no need to delete. |
| 152 #endif |
| 151 } | 153 } |
| 152 } | 154 } |
| 153 | 155 |
| 154 | 156 |
| 155 void CompilationInfo::RollbackDependentMaps() { | 157 void CompilationInfo::RollbackDependentMaps() { |
| 156 // Unregister from all dependent maps if not yet committed. | 158 // Unregister from all dependent maps if not yet committed. |
| 157 for (int i = 0; i < DependentCode::kGroupCount; i++) { | 159 for (int i = 0; i < DependentCode::kGroupCount; i++) { |
| 158 ZoneList<Handle<Map> >* group_maps = dependent_maps_[i]; | 160 ZoneList<Handle<Map> >* group_maps = dependent_maps_[i]; |
| 159 if (group_maps == NULL) continue; | 161 if (group_maps == NULL) continue; |
| 160 for (int j = 0; j < group_maps->length(); j++) { | 162 for (int j = 0; j < group_maps->length(); j++) { |
| 161 group_maps->at(j)->dependent_code()->RemoveCompilationInfo( | 163 group_maps->at(j)->dependent_code()->RemoveCompilationInfo( |
| 162 static_cast<DependentCode::DependencyGroup>(i), this); | 164 static_cast<DependentCode::DependencyGroup>(i), this); |
| 163 } | 165 } |
| 166 #ifndef DEBUG |
| 164 dependent_maps_[i] = NULL; // Zone-allocated, no need to delete. | 167 dependent_maps_[i] = NULL; // Zone-allocated, no need to delete. |
| 168 #endif |
| 165 } | 169 } |
| 170 |
| 171 #ifdef DEBUG |
| 172 // Verify that with sequential recompilation, we don't leave any |
| 173 // compilation wrappers behind. |
| 174 if (!FLAG_parallel_recompilation) { |
| 175 for (int i = 0; i < DependentCode::kGroupCount; i++) { |
| 176 ZoneList<Handle<Map> >* group_maps = dependent_maps_[i]; |
| 177 if (group_maps == NULL) continue; |
| 178 for (int j = 0; j < group_maps->length(); j++) { |
| 179 DependentCode* dependent_code = group_maps->at(j)->dependent_code(); |
| 180 DependentCode::GroupStartIndexes starts(dependent_code); |
| 181 for (int i = 0; i < starts.number_of_entries(); i++) { |
| 182 ASSERT(dependent_code->object_at(i)->IsCode()); |
| 183 } |
| 184 } |
| 185 dependent_maps_[i] = NULL; // Zone-allocated, no need to delete. |
| 186 } |
| 187 } |
| 188 #endif // DEBUG |
| 166 } | 189 } |
| 167 | 190 |
| 168 | 191 |
| 169 int CompilationInfo::num_parameters() const { | 192 int CompilationInfo::num_parameters() const { |
| 170 ASSERT(!IsStub()); | 193 ASSERT(!IsStub()); |
| 171 return scope()->num_parameters(); | 194 return scope()->num_parameters(); |
| 172 } | 195 } |
| 173 | 196 |
| 174 | 197 |
| 175 int CompilationInfo::num_heap_slots() const { | 198 int CompilationInfo::num_heap_slots() const { |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 } | 1224 } |
| 1202 } | 1225 } |
| 1203 | 1226 |
| 1204 GDBJIT(AddCode(Handle<String>(shared->DebugName()), | 1227 GDBJIT(AddCode(Handle<String>(shared->DebugName()), |
| 1205 Handle<Script>(info->script()), | 1228 Handle<Script>(info->script()), |
| 1206 Handle<Code>(info->code()), | 1229 Handle<Code>(info->code()), |
| 1207 info)); | 1230 info)); |
| 1208 } | 1231 } |
| 1209 | 1232 |
| 1210 } } // namespace v8::internal | 1233 } } // namespace v8::internal |
| OLD | NEW |