tools/profiler/v8-support.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/profiler/v8-support.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/* This contains stubs and infrastructure to support code from v8 */
    1.10 +
    1.11 +#ifndef V8_SUPPORT_H_
    1.12 +#define V8_SUPPORT_H_
    1.13 +
    1.14 +#if defined(_M_X64) || defined(__x86_64__)
    1.15 +#define V8_HOST_ARCH_X64 1
    1.16 +#elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
    1.17 +#define V8_HOST_ARCH_IA32 1
    1.18 +#elif defined(__ARMEL__)
    1.19 +#define V8_HOST_ARCH_ARM 1
    1.20 +#else
    1.21 +#warning Please add support for your architecture in chromium_types.h
    1.22 +#endif
    1.23 +
    1.24 +typedef int32_t Atomic32;
    1.25 +
    1.26 +#if defined(V8_HOST_ARCH_X64) || defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM)
    1.27 +inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
    1.28 +  *ptr = value;
    1.29 +}
    1.30 +#endif
    1.31 +
    1.32 +
    1.33 +const int kMaxInt = 0x7FFFFFFF;
    1.34 +const int kMinInt = -kMaxInt - 1;
    1.35 +
    1.36 +// A macro to disallow the evil copy constructor and operator= functions
    1.37 +// This should be used in the private: declarations for a class
    1.38 +#define DISALLOW_COPY_AND_ASSIGN(TypeName)      \
    1.39 +  TypeName(const TypeName&);                    \
    1.40 +  void operator=(const TypeName&)
    1.41 +
    1.42 +
    1.43 +// The USE(x) template is used to silence C++ compiler warnings
    1.44 +// issued for (yet) unused variables (typically parameters).
    1.45 +template <typename T>
    1.46 +static inline void USE(T) { }
    1.47 +
    1.48 +class Malloced {
    1.49 +};
    1.50 +
    1.51 +#endif // V8_SUPPORT_H_

mercurial