Bug 698002. Add v8-support.h for using v8 code. r=bgirard
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 28 Oct 2011 16:43:02 -0400
changeset 81884 24b7e2efa35c4db51e424ee1c57e7d20dd5e86a7
parent 81883 169cad8b9e52ca12eaec326929dac9b53ea3fa40
child 81885 c7763db2a4daac64c18fea352dddcff7b757c701
push idunknown
push userunknown
push dateunknown
reviewersbgirard
bugs698002
milestone11.0a1
Bug 698002. Add v8-support.h for using v8 code. r=bgirard As a first step this adds a dummy implementation of the Malloced class used by the Linux implementation.
tools/profiler/sps/platform-linux.cc
tools/profiler/sps/v8-support.h
--- a/tools/profiler/sps/platform-linux.cc
+++ b/tools/profiler/sps/platform-linux.cc
@@ -29,16 +29,17 @@
 #include <fcntl.h>      // open
 #include <unistd.h>     // sysconf
 #ifdef __GLIBC__
 #include <execinfo.h>   // backtrace, backtrace_symbols
 #endif  // def __GLIBC__
 #include <strings.h>    // index
 #include <errno.h>
 #include <stdarg.h>
+#include "v8-support.h"
 #include "platform.h"
 
 #include <string.h>
 #include <stdio.h>
 
 // Real time signals are not supported on android.
 // This behaves as a standard signal.
 #define SIGNAL_SAVE_PROFILE 42
@@ -182,18 +183,17 @@ static void ProfilerSignalHandler(int si
 #endif
   sActiveSampler->Tick(sample);
 }
 
 void tgkill(pid_t tgid, pid_t tid, int signalno) {
   syscall(SYS_tgkill, tgid, tid, signalno);
 }
 
-//class Sampler::PlatformData : public Malloced {
-class Sampler::PlatformData {
+class Sampler::PlatformData : public Malloced {
  public:
   explicit PlatformData(Sampler* sampler)
       : sampler_(sampler),
         signal_handler_installed_(false),
         vm_tgid_(getpid()),
         // Glibc doesn't provide a wrapper for gettid(2).
         vm_tid_(gettid()),
         signal_sender_launched_(false) {
new file mode 100644
--- /dev/null
+++ b/tools/profiler/sps/v8-support.h
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Jeff Muizelaar <jmuizelaar@mozilla.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/* This contains stubs and infrastructure to support code from v8 */
+
+class Malloced {
+};