| 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/heap/heap.h" | 5 #include "src/heap/heap.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/ast/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1285 } | 1285 } |
| 1286 #endif | 1286 #endif |
| 1287 | 1287 |
| 1288 GCType gc_type = | 1288 GCType gc_type = |
| 1289 collector == MARK_COMPACTOR ? kGCTypeMarkSweepCompact : kGCTypeScavenge; | 1289 collector == MARK_COMPACTOR ? kGCTypeMarkSweepCompact : kGCTypeScavenge; |
| 1290 | 1290 |
| 1291 { | 1291 { |
| 1292 GCCallbacksScope scope(this); | 1292 GCCallbacksScope scope(this); |
| 1293 if (scope.CheckReenter()) { | 1293 if (scope.CheckReenter()) { |
| 1294 AllowHeapAllocation allow_allocation; | 1294 AllowHeapAllocation allow_allocation; |
| 1295 TRACE_GC(tracer(), collector == MARK_COMPACTOR | 1295 TRACE_GC(tracer(), GCTracer::Scope::EXTERNAL_PROLOGUE); |
| 1296 ? GCTracer::Scope::MC_EXTERNAL_PROLOGUE | |
| 1297 : GCTracer::Scope::SCAVENGER_EXTERNAL_PROLOGUE); | |
| 1298 VMState<EXTERNAL> state(isolate_); | 1296 VMState<EXTERNAL> state(isolate_); |
| 1299 HandleScope handle_scope(isolate_); | 1297 HandleScope handle_scope(isolate_); |
| 1300 CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags); | 1298 CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags); |
| 1301 } | 1299 } |
| 1302 } | 1300 } |
| 1303 | 1301 |
| 1304 EnsureFromSpaceIsCommitted(); | 1302 EnsureFromSpaceIsCommitted(); |
| 1305 | 1303 |
| 1306 int start_new_space_size = static_cast<int>(Heap::new_space()->Size()); | 1304 int start_new_space_size = static_cast<int>(Heap::new_space()->Size()); |
| 1307 | 1305 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 SetOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed); | 1354 SetOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed); |
| 1357 } else if (HasLowYoungGenerationAllocationRate() && | 1355 } else if (HasLowYoungGenerationAllocationRate() && |
| 1358 old_generation_size_configured_) { | 1356 old_generation_size_configured_) { |
| 1359 DampenOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed); | 1357 DampenOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed); |
| 1360 } | 1358 } |
| 1361 | 1359 |
| 1362 { | 1360 { |
| 1363 GCCallbacksScope scope(this); | 1361 GCCallbacksScope scope(this); |
| 1364 if (scope.CheckReenter()) { | 1362 if (scope.CheckReenter()) { |
| 1365 AllowHeapAllocation allow_allocation; | 1363 AllowHeapAllocation allow_allocation; |
| 1366 TRACE_GC(tracer(), collector == MARK_COMPACTOR | 1364 TRACE_GC(tracer(), GCTracer::Scope::EXTERNAL_EPILOGUE); |
| 1367 ? GCTracer::Scope::MC_EXTERNAL_EPILOGUE | |
| 1368 : GCTracer::Scope::SCAVENGER_EXTERNAL_EPILOGUE); | |
| 1369 VMState<EXTERNAL> state(isolate_); | 1365 VMState<EXTERNAL> state(isolate_); |
| 1370 HandleScope handle_scope(isolate_); | 1366 HandleScope handle_scope(isolate_); |
| 1371 CallGCEpilogueCallbacks(gc_type, gc_callback_flags); | 1367 CallGCEpilogueCallbacks(gc_type, gc_callback_flags); |
| 1372 } | 1368 } |
| 1373 } | 1369 } |
| 1374 | 1370 |
| 1375 #ifdef VERIFY_HEAP | 1371 #ifdef VERIFY_HEAP |
| 1376 if (FLAG_verify_heap) { | 1372 if (FLAG_verify_heap) { |
| 1377 VerifyStringTable(this); | 1373 VerifyStringTable(this); |
| 1378 } | 1374 } |
| (...skipping 5101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6480 } | 6476 } |
| 6481 | 6477 |
| 6482 | 6478 |
| 6483 // static | 6479 // static |
| 6484 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6480 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6485 return StaticVisitorBase::GetVisitorId(map); | 6481 return StaticVisitorBase::GetVisitorId(map); |
| 6486 } | 6482 } |
| 6487 | 6483 |
| 6488 } // namespace internal | 6484 } // namespace internal |
| 6489 } // namespace v8 | 6485 } // namespace v8 |
| OLD | NEW |