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: test/cctest/test-heap.cc

Issue 1213203007: Create a internal, global native context used only for generated code stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 6229670da848efbbf75c6d50e3605d0e052180a7..a780e837ec3ffa2bc28a7763e8ec2fd1827ab11d 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -1523,7 +1523,8 @@ int CountNativeContexts() {
count++;
object = Context::cast(object)->get(Context::NEXT_CONTEXT_LINK);
}
- return count;
+ // Subtract one to compensate for the code stub context that is always present
+ return count - 1;
}
@@ -1661,7 +1662,8 @@ static int CountNativeContextsWithGC(Isolate* isolate, int n) {
Handle<Object>(Context::cast(*object)->get(Context::NEXT_CONTEXT_LINK),
isolate);
}
- return count;
+ // Subtract one to compensate for the code stub context that is always present
+ return count - 1;
}
@@ -2238,7 +2240,10 @@ static int NumberOfGlobalObjects() {
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
if (obj->IsGlobalObject()) count++;
}
- return count;
+ // Subtract two to compensate for the two global objects (not global
+ // JSObjects, of which there would only be one) that are part of the code stub
+ // context, which is always present.
+ return count - 2;
}
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698