OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "lithium-codegen.h" | 7 #include "lithium-codegen.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 #include "ia32/lithium-ia32.h" | 10 #include "ia32/lithium-ia32.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 return -1; | 149 return -1; |
150 } | 150 } |
151 | 151 |
152 | 152 |
153 static void AddWeakObjectToCodeDependency(Isolate* isolate, | 153 static void AddWeakObjectToCodeDependency(Isolate* isolate, |
154 Handle<Object> object, | 154 Handle<Object> object, |
155 Handle<Code> code) { | 155 Handle<Code> code) { |
156 Heap* heap = isolate->heap(); | 156 Heap* heap = isolate->heap(); |
157 heap->EnsureWeakObjectToCodeTable(); | 157 heap->EnsureWeakObjectToCodeTable(); |
158 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); | 158 Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(object)); |
159 dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code); | 159 dep = DependentCode::Insert(dep, DependentCode::kWeakCodeGroup, code); |
160 heap->AddWeakObjectToCodeDependency(object, dep); | 160 heap->AddWeakObjectToCodeDependency(object, dep); |
161 } | 161 } |
162 | 162 |
163 | 163 |
164 void LCodeGenBase::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) { | 164 void LCodeGenBase::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) { |
165 ASSERT(code->is_optimized_code()); | 165 ASSERT(code->is_optimized_code()); |
166 ZoneList<Handle<Map> > maps(1, zone()); | 166 ZoneList<Handle<Map> > maps(1, zone()); |
167 ZoneList<Handle<JSObject> > objects(1, zone()); | 167 ZoneList<Handle<JSObject> > objects(1, zone()); |
168 ZoneList<Handle<Cell> > cells(1, zone()); | 168 ZoneList<Handle<Cell> > cells(1, zone()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 for (int i = 0; i < objects.length(); i++) { | 204 for (int i = 0; i < objects.length(); i++) { |
205 AddWeakObjectToCodeDependency(isolate(), objects.at(i), code); | 205 AddWeakObjectToCodeDependency(isolate(), objects.at(i), code); |
206 } | 206 } |
207 for (int i = 0; i < cells.length(); i++) { | 207 for (int i = 0; i < cells.length(); i++) { |
208 AddWeakObjectToCodeDependency(isolate(), cells.at(i), code); | 208 AddWeakObjectToCodeDependency(isolate(), cells.at(i), code); |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 | 212 |
213 } } // namespace v8::internal | 213 } } // namespace v8::internal |
OLD | NEW |