| Index: test/cctest/test-profile-generator.cc
|
| diff --git a/test/cctest/test-profile-generator.cc b/test/cctest/test-profile-generator.cc
|
| index 47146ecc485123511b5b7410f62ef58d9bc97272..fd223c6e0994f3787c3f52cdd2c5e86c3fe326e5 100644
|
| --- a/test/cctest/test-profile-generator.cc
|
| +++ b/test/cctest/test-profile-generator.cc
|
| @@ -556,9 +556,11 @@ const char* ProfilerExtension::kSource =
|
|
|
| v8::Handle<v8::FunctionTemplate> ProfilerExtension::GetNativeFunction(
|
| v8::Handle<v8::String> name) {
|
| - if (name->Equals(v8::String::New("startProfiling"))) {
|
| + if (name->Equals(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
|
| + "startProfiling"))) {
|
| return v8::FunctionTemplate::New(ProfilerExtension::StartProfiling);
|
| - } else if (name->Equals(v8::String::New("stopProfiling"))) {
|
| + } else if (name->Equals(v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
|
| + "stopProfiling"))) {
|
| return v8::FunctionTemplate::New(ProfilerExtension::StopProfiling);
|
| } else {
|
| CHECK(false);
|
| @@ -573,7 +575,8 @@ void ProfilerExtension::StartProfiling(
|
| if (args.Length() > 0)
|
| cpu_profiler->StartCpuProfiling(args[0].As<v8::String>());
|
| else
|
| - cpu_profiler->StartCpuProfiling(v8::String::New(""));
|
| + cpu_profiler->StartCpuProfiling(
|
| + v8::String::NewFromUtf8(args.GetIsolate(), ""));
|
| }
|
|
|
|
|
| @@ -583,7 +586,8 @@ void ProfilerExtension::StopProfiling(
|
| if (args.Length() > 0)
|
| cpu_profiler->StopCpuProfiling(args[0].As<v8::String>());
|
| else
|
| - cpu_profiler->StopCpuProfiling(v8::String::New(""));
|
| + cpu_profiler->StopCpuProfiling(
|
| + v8::String::NewFromUtf8(args.GetIsolate(), ""));
|
| }
|
|
|
|
|
| @@ -673,7 +677,7 @@ static const v8::CpuProfileNode* PickChild(const v8::CpuProfileNode* parent,
|
| const char* name) {
|
| for (int i = 0; i < parent->GetChildrenCount(); ++i) {
|
| const v8::CpuProfileNode* child = parent->GetChild(i);
|
| - v8::String::AsciiValue function_name(child->GetFunctionName());
|
| + v8::String::Utf8Value function_name(child->GetFunctionName());
|
| if (strcmp(*function_name, name) == 0) return child;
|
| }
|
| return NULL;
|
| @@ -692,13 +696,14 @@ TEST(ProfileNodeScriptId) {
|
|
|
| v8::CpuProfiler* profiler = env->GetIsolate()->GetCpuProfiler();
|
| CHECK_EQ(0, profiler->GetProfileCount());
|
| - v8::Handle<v8::Script> script_a = v8::Script::Compile(v8::String::New(
|
| - "function a() { startProfiling(); }\n"));
|
| + 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::New(
|
| - "function b() { a(); }\n"
|
| - "b();\n"
|
| - "stopProfiling();\n"));
|
| + 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();
|
| CHECK_EQ(1, profiler->GetProfileCount());
|
| const v8::CpuProfile* profile = profiler->GetCpuProfile(0);
|
| @@ -793,19 +798,20 @@ TEST(BailoutReason) {
|
|
|
| v8::CpuProfiler* profiler = env->GetIsolate()->GetCpuProfiler();
|
| CHECK_EQ(0, profiler->GetProfileCount());
|
| - v8::Handle<v8::Script> script = v8::Script::Compile(v8::String::New(
|
| - "function TryCatch() {\n"
|
| - " try {\n"
|
| - " startProfiling();\n"
|
| - " } catch (e) { };\n"
|
| - "}\n"
|
| - "function TryFinally() {\n"
|
| - " try {\n"
|
| - " TryCatch();\n"
|
| - " } finally { };\n"
|
| - "}\n"
|
| - "TryFinally();\n"
|
| - "stopProfiling();"));
|
| + v8::Handle<v8::Script> script =
|
| + v8::Script::Compile(v8::String::NewFromUtf8(env->GetIsolate(),
|
| + "function TryCatch() {\n"
|
| + " try {\n"
|
| + " startProfiling();\n"
|
| + " } catch (e) { };\n"
|
| + "}\n"
|
| + "function TryFinally() {\n"
|
| + " try {\n"
|
| + " TryCatch();\n"
|
| + " } finally { };\n"
|
| + "}\n"
|
| + "TryFinally();\n"
|
| + "stopProfiling();"));
|
| script->Run();
|
| CHECK_EQ(1, profiler->GetProfileCount());
|
| const v8::CpuProfile* profile = profiler->GetCpuProfile(0);
|
|
|