Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index d1f25def57ad3eedf0906bbae0c3c7e7401ccd64..7fc80b3a914ca823e88d642ec4e01ee7e8e130c6 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -19545,15 +19545,15 @@ class InitDefaultIsolateThread : public v8::internal::Thread { |
break; |
case SetCounterFunction: |
- v8::V8::SetCounterFunction(NULL); |
+ CcTest::isolate()->SetCounterFunction(NULL); |
break; |
case SetCreateHistogramFunction: |
- v8::V8::SetCreateHistogramFunction(NULL); |
+ CcTest::isolate()->SetCreateHistogramFunction(NULL); |
break; |
case SetAddHistogramSampleFunction: |
- v8::V8::SetAddHistogramSampleFunction(NULL); |
+ CcTest::isolate()->SetAddHistogramSampleFunction(NULL); |
break; |
} |
isolate->Exit(); |
@@ -20904,6 +20904,7 @@ TEST(RunMicrotasksWithoutEnteringContext) { |
} |
+#ifdef DEBUG |
static int probes_counter = 0; |
static int misses_counter = 0; |
static int updates_counter = 0; |
@@ -20933,11 +20934,10 @@ static const char* kMegamorphicTestProgram = |
" fooify(a);" |
" fooify(b);" |
"}"; |
+#endif |
static void StubCacheHelper(bool primary) { |
- V8::SetCounterFunction(LookupCounter); |
- USE(kMegamorphicTestProgram); |
#ifdef DEBUG |
i::FLAG_native_code_counters = true; |
if (primary) { |
@@ -20947,6 +20947,7 @@ static void StubCacheHelper(bool primary) { |
} |
i::FLAG_crankshaft = false; |
LocalContext env; |
+ env->GetIsolate()->SetCounterFunction(LookupCounter); |
v8::HandleScope scope(env->GetIsolate()); |
int initial_probes = probes_counter; |
int initial_misses = misses_counter; |
@@ -20976,6 +20977,7 @@ TEST(PrimaryStubCache) { |
} |
+#ifdef DEBUG |
static int cow_arrays_created_runtime = 0; |
@@ -20985,13 +20987,14 @@ static int* LookupCounterCOWArrays(const char* name) { |
} |
return NULL; |
} |
+#endif |
TEST(CheckCOWArraysCreatedRuntimeCounter) { |
- V8::SetCounterFunction(LookupCounterCOWArrays); |
#ifdef DEBUG |
i::FLAG_native_code_counters = true; |
LocalContext env; |
+ env->GetIsolate()->SetCounterFunction(LookupCounterCOWArrays); |
v8::HandleScope scope(env->GetIsolate()); |
int initial_cow_arrays = cow_arrays_created_runtime; |
CompileRun("var o = [1, 2, 3];"); |