| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 "src/compiler.h" | 5 #include "src/compiler.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 | 8 | 
| 9 #include "src/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" | 
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" | 
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 277   return SetLastStatus(GenerateCodeImpl()); | 277   return SetLastStatus(GenerateCodeImpl()); | 
| 278 } | 278 } | 
| 279 | 279 | 
| 280 | 280 | 
| 281 namespace { | 281 namespace { | 
| 282 | 282 | 
| 283 void AddWeakObjectToCodeDependency(Isolate* isolate, Handle<HeapObject> object, | 283 void AddWeakObjectToCodeDependency(Isolate* isolate, Handle<HeapObject> object, | 
| 284                                    Handle<Code> code) { | 284                                    Handle<Code> code) { | 
| 285   Handle<WeakCell> cell = Code::WeakCellFor(code); | 285   Handle<WeakCell> cell = Code::WeakCellFor(code); | 
| 286   Heap* heap = isolate->heap(); | 286   Heap* heap = isolate->heap(); | 
| 287   Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(object)); | 287   if (heap->InNewSpace(*object)) { | 
| 288   dep = DependentCode::InsertWeakCode(dep, DependentCode::kWeakCodeGroup, cell); | 288     heap->AddWeakNewSpaceObjectToCodeDependency(object, cell); | 
| 289   heap->AddWeakObjectToCodeDependency(object, dep); | 289   } else { | 
|  | 290     Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(object)); | 
|  | 291     dep = | 
|  | 292         DependentCode::InsertWeakCode(dep, DependentCode::kWeakCodeGroup, cell); | 
|  | 293     heap->AddWeakObjectToCodeDependency(object, dep); | 
|  | 294   } | 
| 290 } | 295 } | 
| 291 | 296 | 
| 292 }  // namespace | 297 }  // namespace | 
| 293 | 298 | 
| 294 void CompilationJob::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) { | 299 void CompilationJob::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) { | 
| 295   // TODO(turbofan): Move this to pipeline.cc once Crankshaft dies. | 300   // TODO(turbofan): Move this to pipeline.cc once Crankshaft dies. | 
| 296   Isolate* const isolate = code->GetIsolate(); | 301   Isolate* const isolate = code->GetIsolate(); | 
| 297   DCHECK(code->is_optimized_code()); | 302   DCHECK(code->is_optimized_code()); | 
| 298   std::vector<Handle<Map>> maps; | 303   std::vector<Handle<Map>> maps; | 
| 299   std::vector<Handle<HeapObject>> objects; | 304   std::vector<Handle<HeapObject>> objects; | 
| (...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1820     DCHECK(shared->is_compiled()); | 1825     DCHECK(shared->is_compiled()); | 
| 1821     function->set_literals(cached.literals); | 1826     function->set_literals(cached.literals); | 
| 1822   } else if (shared->is_compiled()) { | 1827   } else if (shared->is_compiled()) { | 
| 1823     // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1828     // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 
| 1824     JSFunction::EnsureLiterals(function); | 1829     JSFunction::EnsureLiterals(function); | 
| 1825   } | 1830   } | 
| 1826 } | 1831 } | 
| 1827 | 1832 | 
| 1828 }  // namespace internal | 1833 }  // namespace internal | 
| 1829 }  // namespace v8 | 1834 }  // namespace v8 | 
| OLD | NEW | 
|---|