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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 173 } |
174 | 174 |
175 | 175 |
176 static void AddWeakObjectToCodeDependency(Isolate* isolate, | 176 static void AddWeakObjectToCodeDependency(Isolate* isolate, |
177 Handle<Object> object, | 177 Handle<Object> object, |
178 Handle<Code> code) { | 178 Handle<Code> code) { |
179 Heap* heap = isolate->heap(); | 179 Heap* heap = isolate->heap(); |
180 heap->EnsureWeakObjectToCodeTable(); | 180 heap->EnsureWeakObjectToCodeTable(); |
181 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); | 181 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); |
182 dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code); | 182 dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code); |
183 CALL_HEAP_FUNCTION_VOID(isolate, | 183 heap->AddWeakObjectToCodeDependency(object, dep); |
184 heap->AddWeakObjectToCodeDependency(*object, *dep)); | |
185 } | 184 } |
186 | 185 |
187 | 186 |
188 void LCodeGenBase::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) { | 187 void LCodeGenBase::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) { |
189 ASSERT(code->is_optimized_code()); | 188 ASSERT(code->is_optimized_code()); |
190 ZoneList<Handle<Map> > maps(1, zone()); | 189 ZoneList<Handle<Map> > maps(1, zone()); |
191 ZoneList<Handle<JSObject> > objects(1, zone()); | 190 ZoneList<Handle<JSObject> > objects(1, zone()); |
192 ZoneList<Handle<Cell> > cells(1, zone()); | 191 ZoneList<Handle<Cell> > cells(1, zone()); |
193 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 192 int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
194 RelocInfo::ModeMask(RelocInfo::CELL); | 193 RelocInfo::ModeMask(RelocInfo::CELL); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 for (int i = 0; i < objects.length(); i++) { | 227 for (int i = 0; i < objects.length(); i++) { |
229 AddWeakObjectToCodeDependency(isolate(), objects.at(i), code); | 228 AddWeakObjectToCodeDependency(isolate(), objects.at(i), code); |
230 } | 229 } |
231 for (int i = 0; i < cells.length(); i++) { | 230 for (int i = 0; i < cells.length(); i++) { |
232 AddWeakObjectToCodeDependency(isolate(), cells.at(i), code); | 231 AddWeakObjectToCodeDependency(isolate(), cells.at(i), code); |
233 } | 232 } |
234 } | 233 } |
235 | 234 |
236 | 235 |
237 } } // namespace v8::internal | 236 } } // namespace v8::internal |
OLD | NEW |