tools/profiler/v8-support.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /* This contains stubs and infrastructure to support code from v8 */
michael@0 7
michael@0 8 #ifndef V8_SUPPORT_H_
michael@0 9 #define V8_SUPPORT_H_
michael@0 10
michael@0 11 #if defined(_M_X64) || defined(__x86_64__)
michael@0 12 #define V8_HOST_ARCH_X64 1
michael@0 13 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
michael@0 14 #define V8_HOST_ARCH_IA32 1
michael@0 15 #elif defined(__ARMEL__)
michael@0 16 #define V8_HOST_ARCH_ARM 1
michael@0 17 #else
michael@0 18 #warning Please add support for your architecture in chromium_types.h
michael@0 19 #endif
michael@0 20
michael@0 21 typedef int32_t Atomic32;
michael@0 22
michael@0 23 #if defined(V8_HOST_ARCH_X64) || defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM)
michael@0 24 inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) {
michael@0 25 *ptr = value;
michael@0 26 }
michael@0 27 #endif
michael@0 28
michael@0 29
michael@0 30 const int kMaxInt = 0x7FFFFFFF;
michael@0 31 const int kMinInt = -kMaxInt - 1;
michael@0 32
michael@0 33 // A macro to disallow the evil copy constructor and operator= functions
michael@0 34 // This should be used in the private: declarations for a class
michael@0 35 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
michael@0 36 TypeName(const TypeName&); \
michael@0 37 void operator=(const TypeName&)
michael@0 38
michael@0 39
michael@0 40 // The USE(x) template is used to silence C++ compiler warnings
michael@0 41 // issued for (yet) unused variables (typically parameters).
michael@0 42 template <typename T>
michael@0 43 static inline void USE(T) { }
michael@0 44
michael@0 45 class Malloced {
michael@0 46 };
michael@0 47
michael@0 48 #endif // V8_SUPPORT_H_

mercurial