| 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 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "src/asmjs/asm-js.h" | 10 #include "src/asmjs/asm-js.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 heap->AddWeakObjectToCodeDependency(object, dep); | 226 heap->AddWeakObjectToCodeDependency(object, dep); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace | 230 } // namespace |
| 231 | 231 |
| 232 void CompilationJob::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) { | 232 void CompilationJob::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) { |
| 233 // TODO(turbofan): Move this to pipeline.cc once Crankshaft dies. | 233 // TODO(turbofan): Move this to pipeline.cc once Crankshaft dies. |
| 234 Isolate* const isolate = code->GetIsolate(); | 234 Isolate* const isolate = code->GetIsolate(); |
| 235 DCHECK(code->is_optimized_code()); | 235 DCHECK(code->is_optimized_code()); |
| 236 std::vector<Handle<Map>> maps; | 236 MapHandles maps; |
| 237 std::vector<Handle<HeapObject>> objects; | 237 std::vector<Handle<HeapObject>> objects; |
| 238 { | 238 { |
| 239 DisallowHeapAllocation no_gc; | 239 DisallowHeapAllocation no_gc; |
| 240 int const mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | | 240 int const mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | |
| 241 RelocInfo::ModeMask(RelocInfo::CELL); | 241 RelocInfo::ModeMask(RelocInfo::CELL); |
| 242 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { | 242 for (RelocIterator it(*code, mode_mask); !it.done(); it.next()) { |
| 243 RelocInfo::Mode mode = it.rinfo()->rmode(); | 243 RelocInfo::Mode mode = it.rinfo()->rmode(); |
| 244 if (mode == RelocInfo::CELL && | 244 if (mode == RelocInfo::CELL && |
| 245 code->IsWeakObjectInOptimizedCode(it.rinfo()->target_cell())) { | 245 code->IsWeakObjectInOptimizedCode(it.rinfo()->target_cell())) { |
| 246 objects.push_back(handle(it.rinfo()->target_cell(), isolate)); | 246 objects.push_back(handle(it.rinfo()->target_cell(), isolate)); |
| (...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 } | 1888 } |
| 1889 | 1889 |
| 1890 if (shared->is_compiled()) { | 1890 if (shared->is_compiled()) { |
| 1891 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. | 1891 // TODO(mvstanton): pass pretenure flag to EnsureLiterals. |
| 1892 JSFunction::EnsureLiterals(function); | 1892 JSFunction::EnsureLiterals(function); |
| 1893 } | 1893 } |
| 1894 } | 1894 } |
| 1895 | 1895 |
| 1896 } // namespace internal | 1896 } // namespace internal |
| 1897 } // namespace v8 | 1897 } // namespace v8 |
| OLD | NEW |