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

Unified Diff: runtime/vm/heap.cc

Issue 1284713003: Refactor VMTagScope to Thread* rather than Isolate*. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 6897af855dca5ad0601c1bf042e8735316386458..cf53c7b196840d96b24e86ec78fc4ae837d27477 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -312,11 +312,12 @@ RawObject* Heap::FindObject(FindObjectVisitor* visitor) const {
void Heap::CollectGarbage(Space space,
ApiCallbacks api_callbacks,
GCReason reason) {
+ Thread* thread = Thread::Current();
TIMERSCOPE(isolate(), time_gc);
bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
switch (space) {
case kNew: {
- VMTagScope tagScope(isolate(), VMTag::kGCNewSpaceTagId);
+ VMTagScope tagScope(thread, VMTag::kGCNewSpaceTagId);
TimelineDurationScope tds(isolate(),
isolate()->GetGCStream(),
"CollectNewGeneration");
@@ -335,7 +336,7 @@ void Heap::CollectGarbage(Space space,
}
case kOld:
case kCode: {
- VMTagScope tagScope(isolate(), VMTag::kGCOldSpaceTagId);
+ VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId);
TimelineDurationScope tds(isolate(),
isolate()->GetGCStream(),
"CollectOldGeneration");
@@ -373,9 +374,10 @@ void Heap::CollectGarbage(Space space) {
void Heap::CollectAllGarbage() {
+ Thread* thread = Thread::Current();
TIMERSCOPE(isolate(), time_gc);
{
- VMTagScope tagScope(isolate(), VMTag::kGCNewSpaceTagId);
+ VMTagScope tagScope(thread, VMTag::kGCNewSpaceTagId);
TimelineDurationScope tds(isolate(),
isolate()->GetGCStream(),
"CollectNewGeneration");
@@ -388,7 +390,7 @@ void Heap::CollectAllGarbage() {
PrintStats();
}
{
- VMTagScope tagScope(isolate(), VMTag::kGCOldSpaceTagId);
+ VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId);
TimelineDurationScope tds(isolate(),
isolate()->GetGCStream(),
"CollectOldGeneration");
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698