Index: test/cctest/test-profile-generator.cc |
diff --git a/test/cctest/test-profile-generator.cc b/test/cctest/test-profile-generator.cc |
index 78a8204556b2460c3c5c9caaa9552eb3cf7b00a8..b918eb5a3b9e7af98dbc52c9627988115090946d 100644 |
--- a/test/cctest/test-profile-generator.cc |
+++ b/test/cctest/test-profile-generator.cc |
@@ -27,6 +27,9 @@ |
// |
// Tests of profiles generator and utilities. |
+// TODO(mythria): Remove this define after this flag is turned on globally |
+#define V8_IMMINENT_DEPRECATION_WARNINGS |
+ |
#include "src/v8.h" |
#include "include/v8-profiler.h" |
@@ -577,15 +580,16 @@ TEST(ProfileNodeScriptId) { |
v8::CpuProfiler* profiler = env->GetIsolate()->GetCpuProfiler(); |
i::CpuProfiler* iprofiler = reinterpret_cast<i::CpuProfiler*>(profiler); |
CHECK_EQ(0, iprofiler->GetProfilesCount()); |
- v8::Handle<v8::Script> script_a = v8::Script::Compile(v8::String::NewFromUtf8( |
- env->GetIsolate(), "function a() { startProfiling(); }\n")); |
- script_a->Run(); |
- v8::Handle<v8::Script> script_b = |
- v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), |
- "function b() { a(); }\n" |
- "b();\n" |
- "stopProfiling();\n")); |
- script_b->Run(); |
+ v8::Local<v8::Script> script_a = |
+ v8_compile(v8_str("function a() { startProfiling(); }\n")); |
+ script_a->Run(v8::Isolate::GetCurrent()->GetCurrentContext()) |
+ .ToLocalChecked(); |
+ v8::Local<v8::Script> script_b = |
+ v8_compile(v8_str("function b() { a(); }\n" |
+ "b();\n" |
+ "stopProfiling();\n")); |
+ script_b->Run(v8::Isolate::GetCurrent()->GetCurrentContext()) |
+ .ToLocalChecked(); |
CHECK_EQ(1, iprofiler->GetProfilesCount()); |
const v8::CpuProfile* profile = i::ProfilerExtension::last_profile; |
const v8::CpuProfileNode* current = profile->GetTopDownRoot(); |
@@ -632,9 +636,13 @@ static const char* line_number_test_source_profile_time_functions = |
int GetFunctionLineNumber(LocalContext* env, const char* name) { |
CpuProfiler* profiler = CcTest::i_isolate()->cpu_profiler(); |
CodeMap* code_map = profiler->generator()->code_map(); |
- i::Handle<i::JSFunction> func = v8::Utils::OpenHandle( |
- *v8::Local<v8::Function>::Cast( |
- (*(*env))->Global()->Get(v8_str(name)))); |
+ i::Handle<i::JSFunction> func = |
+ v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast( |
+ (*(*env)) |
+ ->Global() |
+ ->Get(v8::Isolate::GetCurrent()->GetCurrentContext(), |
+ v8_str(name)) |
+ .ToLocalChecked())); |
CodeEntry* func_entry = code_map->FindEntry(func->code()->address()); |
if (!func_entry) |
FATAL(name); |
@@ -679,20 +687,19 @@ TEST(BailoutReason) { |
v8::CpuProfiler* profiler = env->GetIsolate()->GetCpuProfiler(); |
i::CpuProfiler* iprofiler = reinterpret_cast<i::CpuProfiler*>(profiler); |
CHECK_EQ(0, iprofiler->GetProfilesCount()); |
- v8::Handle<v8::Script> script = |
- v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(), |
- "function Debugger() {\n" |
- " debugger;\n" |
- " startProfiling();\n" |
- "}\n" |
- "function TryFinally() {\n" |
- " try {\n" |
- " Debugger();\n" |
- " } finally { };\n" |
- "}\n" |
- "TryFinally();\n" |
- "stopProfiling();")); |
- script->Run(); |
+ v8::Local<v8::Script> script = |
+ v8_compile(v8_str("function Debugger() {\n" |
+ " debugger;\n" |
+ " startProfiling();\n" |
+ "}\n" |
+ "function TryFinally() {\n" |
+ " try {\n" |
+ " Debugger();\n" |
+ " } finally { };\n" |
+ "}\n" |
+ "TryFinally();\n" |
+ "stopProfiling();")); |
+ script->Run(v8::Isolate::GetCurrent()->GetCurrentContext()).ToLocalChecked(); |
CHECK_EQ(1, iprofiler->GetProfilesCount()); |
const v8::CpuProfile* profile = i::ProfilerExtension::last_profile; |
CHECK(profile); |