Revert "Revert "Upgrade to 5.0.71.48"" DO NOT MERGE
This reverts commit f2e3994fa5148cc3d9946666f0b0596290192b0e,
and updates the x64 makefile properly so it doesn't break that
build.
FPIIM-449
Change-Id: Ib83e35bfbae6af627451c926a9650ec57c045605
(cherry picked from commit 109988c7ccb6f3fd1a58574fa3dfb88beaef6632)
diff --git a/test/cctest/profiler-extension.cc b/test/cctest/profiler-extension.cc
index a917932..024cc9c 100644
--- a/test/cctest/profiler-extension.cc
+++ b/test/cctest/profiler-extension.cc
@@ -27,41 +27,35 @@
//
// Tests of profiles generator and utilities.
-#include "src/base/logging.h"
#include "test/cctest/profiler-extension.h"
+#include "test/cctest/cctest.h"
namespace v8 {
namespace internal {
-
v8::CpuProfile* ProfilerExtension::last_profile = NULL;
const char* ProfilerExtension::kSource =
"native function startProfiling();"
- "native function stopProfiling();";
+ "native function stopProfiling();"
+ "native function collectSample();";
v8::Local<v8::FunctionTemplate> ProfilerExtension::GetNativeFunctionTemplate(
v8::Isolate* isolate, v8::Local<v8::String> name) {
v8::Local<v8::Context> context = isolate->GetCurrentContext();
- if (name->Equals(context, v8::String::NewFromUtf8(isolate, "startProfiling",
- v8::NewStringType::kNormal)
- .ToLocalChecked())
- .FromJust()) {
+ if (name->Equals(context, v8_str(isolate, "startProfiling")).FromJust()) {
return v8::FunctionTemplate::New(isolate,
ProfilerExtension::StartProfiling);
- } else if (name->Equals(context,
- v8::String::NewFromUtf8(isolate, "stopProfiling",
- v8::NewStringType::kNormal)
- .ToLocalChecked())
- .FromJust()) {
- return v8::FunctionTemplate::New(isolate,
- ProfilerExtension::StopProfiling);
- } else {
- CHECK(false);
- return v8::Local<v8::FunctionTemplate>();
}
+ if (name->Equals(context, v8_str(isolate, "stopProfiling")).FromJust()) {
+ return v8::FunctionTemplate::New(isolate, ProfilerExtension::StopProfiling);
+ }
+ if (name->Equals(context, v8_str(isolate, "collectSample")).FromJust()) {
+ return v8::FunctionTemplate::New(isolate, ProfilerExtension::CollectSample);
+ }
+ CHECK(false);
+ return v8::Local<v8::FunctionTemplate>();
}
-
void ProfilerExtension::StartProfiling(
const v8::FunctionCallbackInfo<v8::Value>& args) {
last_profile = NULL;
@@ -71,7 +65,6 @@
: v8::String::Empty(args.GetIsolate()));
}
-
void ProfilerExtension::StopProfiling(
const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::CpuProfiler* cpu_profiler = args.GetIsolate()->GetCpuProfiler();
@@ -80,5 +73,10 @@
: v8::String::Empty(args.GetIsolate()));
}
+void ProfilerExtension::CollectSample(
+ const v8::FunctionCallbackInfo<v8::Value>& args) {
+ args.GetIsolate()->GetCpuProfiler()->CollectSample();
+}
+
} // namespace internal
} // namespace v8