OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 next_gc_likely_to_collect_more = | 508 next_gc_likely_to_collect_more = |
509 PerformGarbageCollection(collector, &tracer); | 509 PerformGarbageCollection(collector, &tracer); |
510 rate->Stop(); | 510 rate->Stop(); |
511 | 511 |
512 GarbageCollectionEpilogue(); | 512 GarbageCollectionEpilogue(); |
513 } | 513 } |
514 | 514 |
515 | 515 |
516 #ifdef ENABLE_LOGGING_AND_PROFILING | 516 #ifdef ENABLE_LOGGING_AND_PROFILING |
517 if (FLAG_log_gc) HeapProfiler::WriteSample(); | 517 if (FLAG_log_gc) HeapProfiler::WriteSample(); |
518 if (CpuProfiler::is_profiling()) CpuProfiler::ProcessMovedFunctions(); | |
519 #endif | 518 #endif |
520 | 519 |
521 return next_gc_likely_to_collect_more; | 520 return next_gc_likely_to_collect_more; |
522 } | 521 } |
523 | 522 |
524 | 523 |
525 void Heap::PerformScavenge() { | 524 void Heap::PerformScavenge() { |
526 GCTracer tracer; | 525 GCTracer tracer; |
527 PerformGarbageCollection(SCAVENGER, &tracer); | 526 PerformGarbageCollection(SCAVENGER, &tracer); |
528 } | 527 } |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 // Set the forwarding address. | 1342 // Set the forwarding address. |
1344 source->set_map_word(MapWord::FromForwardingAddress(target)); | 1343 source->set_map_word(MapWord::FromForwardingAddress(target)); |
1345 | 1344 |
1346 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) | 1345 #if defined(DEBUG) || defined(ENABLE_LOGGING_AND_PROFILING) |
1347 // Update NewSpace stats if necessary. | 1346 // Update NewSpace stats if necessary. |
1348 RecordCopiedObject(target); | 1347 RecordCopiedObject(target); |
1349 #endif | 1348 #endif |
1350 HEAP_PROFILE(ObjectMoveEvent(source->address(), target->address())); | 1349 HEAP_PROFILE(ObjectMoveEvent(source->address(), target->address())); |
1351 #if defined(ENABLE_LOGGING_AND_PROFILING) | 1350 #if defined(ENABLE_LOGGING_AND_PROFILING) |
1352 if (Logger::is_logging() || CpuProfiler::is_profiling()) { | 1351 if (Logger::is_logging() || CpuProfiler::is_profiling()) { |
1353 if (target->IsJSFunction()) { | 1352 if (target->IsSharedFunctionInfo()) { |
1354 PROFILE(FunctionMoveEvent(source->address(), target->address())); | 1353 PROFILE(SFIMoveEvent(source->address(), target->address())); |
1355 PROFILE(FunctionCreateEventFromMove(JSFunction::cast(target))); | |
1356 } | 1354 } |
1357 } | 1355 } |
1358 #endif | 1356 #endif |
1359 return target; | 1357 return target; |
1360 } | 1358 } |
1361 | 1359 |
1362 | 1360 |
1363 template<ObjectContents object_contents, SizeRestriction size_restriction> | 1361 template<ObjectContents object_contents, SizeRestriction size_restriction> |
1364 static inline void EvacuateObject(Map* map, | 1362 static inline void EvacuateObject(Map* map, |
1365 HeapObject** slot, | 1363 HeapObject** slot, |
(...skipping 4242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5608 void ExternalStringTable::TearDown() { | 5606 void ExternalStringTable::TearDown() { |
5609 new_space_strings_.Free(); | 5607 new_space_strings_.Free(); |
5610 old_space_strings_.Free(); | 5608 old_space_strings_.Free(); |
5611 } | 5609 } |
5612 | 5610 |
5613 | 5611 |
5614 List<Object*> ExternalStringTable::new_space_strings_; | 5612 List<Object*> ExternalStringTable::new_space_strings_; |
5615 List<Object*> ExternalStringTable::old_space_strings_; | 5613 List<Object*> ExternalStringTable::old_space_strings_; |
5616 | 5614 |
5617 } } // namespace v8::internal | 5615 } } // namespace v8::internal |
OLD | NEW |