1 // Copyright (c) 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "../../../include/v8.h"
11 void XDKInitializeForV8(v8::internal::Isolate* isolate) {
12 if (!internal::XDKAgent::instance().setUp(isolate)) return;
14 XDKLog("xdk: XDKInitializeForV8\n");
16 // The --prof flag is requred for now to enable the CPU ticks collection.
17 // This flag will be removed once xdk agent implements own sampler.
18 const char* flags = "--prof";
19 v8::V8::SetFlagsFromString(flags, static_cast<int>(strlen(flags)));
21 v8::V8::SetJitCodeEventHandler(v8::kJitCodeEventDefault,
22 xdk::internal::EventHandler);
24 internal::XDKAgent::instance().Start();
28 bool XDKIsAgentAlive() {
29 return internal::XDKAgent::instance().isAlive();