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

Unified Diff: test/cctest/test-api.cc

Issue 128233002: Add Isolate parameter to HandleScope::NumberOfHandles. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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 | « src/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 9e759d2b03cf3e3f3606bde6978c3f41712ad4c1..3e3afeeb909a1bef8857704f525d0d04fa97407f 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -11022,45 +11022,44 @@ THREADED_TEST(CallableObject) {
}
-static int CountHandles() {
- return v8::HandleScope::NumberOfHandles();
-}
-
-
-static int Recurse(int depth, int iterations) {
- v8::HandleScope scope(CcTest::isolate());
- if (depth == 0) return CountHandles();
+static int Recurse(v8::Isolate* isolate, int depth, int iterations) {
+ v8::HandleScope scope(isolate);
+ if (depth == 0) return v8::HandleScope::NumberOfHandles(isolate);
for (int i = 0; i < iterations; i++) {
- Local<v8::Number> n(v8::Integer::New(CcTest::isolate(), 42));
+ Local<v8::Number> n(v8::Integer::New(isolate, 42));
}
- return Recurse(depth - 1, iterations);
+ return Recurse(isolate, depth - 1, iterations);
}
THREADED_TEST(HandleIteration) {
static const int kIterations = 500;
static const int kNesting = 200;
- CHECK_EQ(0, CountHandles());
+ LocalContext context;
+ v8::Isolate* isolate = context->GetIsolate();
+ v8::HandleScope scope0(isolate);
+ CHECK_EQ(0, v8::HandleScope::NumberOfHandles(isolate));
{
- v8::HandleScope scope1(CcTest::isolate());
- CHECK_EQ(0, CountHandles());
+ v8::HandleScope scope1(isolate);
+ CHECK_EQ(0, v8::HandleScope::NumberOfHandles(isolate));
for (int i = 0; i < kIterations; i++) {
Local<v8::Number> n(v8::Integer::New(CcTest::isolate(), 42));
- CHECK_EQ(i + 1, CountHandles());
+ CHECK_EQ(i + 1, v8::HandleScope::NumberOfHandles(isolate));
}
- CHECK_EQ(kIterations, CountHandles());
+ CHECK_EQ(kIterations, v8::HandleScope::NumberOfHandles(isolate));
{
v8::HandleScope scope2(CcTest::isolate());
for (int j = 0; j < kIterations; j++) {
Local<v8::Number> n(v8::Integer::New(CcTest::isolate(), 42));
- CHECK_EQ(j + 1 + kIterations, CountHandles());
+ CHECK_EQ(j + 1 + kIterations,
+ v8::HandleScope::NumberOfHandles(isolate));
}
}
- CHECK_EQ(kIterations, CountHandles());
+ CHECK_EQ(kIterations, v8::HandleScope::NumberOfHandles(isolate));
}
- CHECK_EQ(0, CountHandles());
- CHECK_EQ(kNesting * kIterations, Recurse(kNesting, kIterations));
+ CHECK_EQ(0, v8::HandleScope::NumberOfHandles(isolate));
+ CHECK_EQ(kNesting * kIterations, Recurse(isolate, kNesting, kIterations));
}
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698