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

Side by Side Diff: src/heap.cc

Issue 19845007: wrap gc callbacks in handlescopes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/global-handles.cc ('k') | no next file » | 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 // 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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 VerifyStringTable(); 913 VerifyStringTable();
914 } 914 }
915 #endif 915 #endif
916 916
917 GCType gc_type = 917 GCType gc_type =
918 collector == MARK_COMPACTOR ? kGCTypeMarkSweepCompact : kGCTypeScavenge; 918 collector == MARK_COMPACTOR ? kGCTypeMarkSweepCompact : kGCTypeScavenge;
919 919
920 { 920 {
921 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); 921 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
922 VMState<EXTERNAL> state(isolate_); 922 VMState<EXTERNAL> state(isolate_);
923 HandleScope handle_scope(isolate_);
923 CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags); 924 CallGCPrologueCallbacks(gc_type, kNoGCCallbackFlags);
924 } 925 }
925 926
926 EnsureFromSpaceIsCommitted(); 927 EnsureFromSpaceIsCommitted();
927 928
928 int start_new_space_size = Heap::new_space()->SizeAsInt(); 929 int start_new_space_size = Heap::new_space()->SizeAsInt();
929 930
930 if (IsHighSurvivalRate()) { 931 if (IsHighSurvivalRate()) {
931 // We speed up the incremental marker if it is running so that it 932 // We speed up the incremental marker if it is running so that it
932 // does not fall behind the rate of promotion, which would cause a 933 // does not fall behind the rate of promotion, which would cause a
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 1019
1019 if (collector == MARK_COMPACTOR) { 1020 if (collector == MARK_COMPACTOR) {
1020 // Register the amount of external allocated memory. 1021 // Register the amount of external allocated memory.
1021 amount_of_external_allocated_memory_at_last_global_gc_ = 1022 amount_of_external_allocated_memory_at_last_global_gc_ =
1022 amount_of_external_allocated_memory_; 1023 amount_of_external_allocated_memory_;
1023 } 1024 }
1024 1025
1025 { 1026 {
1026 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); 1027 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
1027 VMState<EXTERNAL> state(isolate_); 1028 VMState<EXTERNAL> state(isolate_);
1029 HandleScope handle_scope(isolate_);
1028 CallGCEpilogueCallbacks(gc_type); 1030 CallGCEpilogueCallbacks(gc_type);
1029 } 1031 }
1030 1032
1031 #ifdef VERIFY_HEAP 1033 #ifdef VERIFY_HEAP
1032 if (FLAG_verify_heap) { 1034 if (FLAG_verify_heap) {
1033 VerifyStringTable(); 1035 VerifyStringTable();
1034 } 1036 }
1035 #endif 1037 #endif
1036 1038
1037 return next_gc_likely_to_collect_more; 1039 return next_gc_likely_to_collect_more;
(...skipping 6986 matching lines...) Expand 10 before | Expand all | Expand 10 after
8024 if (FLAG_parallel_recompilation) { 8026 if (FLAG_parallel_recompilation) {
8025 heap_->relocation_mutex_->Lock(); 8027 heap_->relocation_mutex_->Lock();
8026 #ifdef DEBUG 8028 #ifdef DEBUG
8027 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8029 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8028 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8030 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8029 #endif // DEBUG 8031 #endif // DEBUG
8030 } 8032 }
8031 } 8033 }
8032 8034
8033 } } // namespace v8::internal 8035 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/global-handles.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698