Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: src/compiler.cc

Issue 2045263002: [heap] Avoid the use of cells to point from code to new-space objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: The IsSmi check in mov(HeapObject) lets some tests fail. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/arm64/macro-assembler-arm64.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698