~yolanda.robla/ubuntu/trusty/nodejs/add_distribution

« back to all changes in this revision

Viewing changes to deps/v8/src/globals.h

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-08-14 00:16:46 UTC
  • mfrom: (7.1.40 sid)
  • Revision ID: package-import@ubuntu.com-20130814001646-bzlysfh8sd6mukbo
Tags: 0.10.15~dfsg1-4
* Update 2005 patch, adding a handful of tests that can fail on
  slow platforms.
* Add 1004 patch to fix test failures when writing NaN to buffer
  on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2011 the V8 project authors. All rights reserved.
 
1
// Copyright 2012 the V8 project authors. All rights reserved.
2
2
// Redistribution and use in source and binary forms, with or without
3
3
// modification, are permitted provided that the following conditions are
4
4
// met:
136
136
#endif
137
137
#endif
138
138
 
139
 
// Define unaligned read for the target architectures supporting it.
140
 
#if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32)
141
 
#define V8_TARGET_CAN_READ_UNALIGNED 1
142
 
#elif V8_TARGET_ARCH_ARM
143
 
// Some CPU-OS combinations allow unaligned access on ARM. We assume
144
 
// that unaligned accesses are not allowed unless the build system
145
 
// defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero.
146
 
#if CAN_USE_UNALIGNED_ACCESSES
147
 
#define V8_TARGET_CAN_READ_UNALIGNED 1
148
 
#endif
149
 
#elif V8_TARGET_ARCH_MIPS
150
 
#else
151
 
#error Target architecture is not supported by v8
152
 
#endif
153
 
 
154
139
// Support for alternative bool type. This is only enabled if the code is
155
140
// compiled with USE_MYBOOL defined. This catches some nasty type bugs.
156
141
// For instance, 'bool b = "false";' results in b == true! This is a hidden
175
160
// than defining __STDC_CONSTANT_MACROS before including <stdint.h>, and it
176
161
// works on compilers that don't have it (like MSVC).
177
162
#if V8_HOST_ARCH_64_BIT
178
 
#ifdef _MSC_VER
 
163
#if defined(_MSC_VER)
179
164
#define V8_UINT64_C(x)  (x ## UI64)
180
165
#define V8_INT64_C(x)   (x ## I64)
181
166
#define V8_INTPTR_C(x)  (x ## I64)
182
167
#define V8_PTR_PREFIX "ll"
183
 
#else  // _MSC_VER
 
168
#elif defined(__MINGW64__)
 
169
#define V8_UINT64_C(x)  (x ## ULL)
 
170
#define V8_INT64_C(x)   (x ## LL)
 
171
#define V8_INTPTR_C(x)  (x ## LL)
 
172
#define V8_PTR_PREFIX "I64"
 
173
#else
184
174
#define V8_UINT64_C(x)  (x ## UL)
185
175
#define V8_INT64_C(x)   (x ## L)
186
176
#define V8_INTPTR_C(x)  (x ## L)
187
177
#define V8_PTR_PREFIX "l"
188
 
#endif  // _MSC_VER
 
178
#endif
189
179
#else  // V8_HOST_ARCH_64_BIT
190
180
#define V8_INTPTR_C(x)  (x)
191
181
#define V8_PTR_PREFIX ""
198
188
 
199
189
#define V8PRIxPTR V8_PTR_PREFIX "x"
200
190
#define V8PRIdPTR V8_PTR_PREFIX "d"
 
191
#define V8PRIuPTR V8_PTR_PREFIX "u"
201
192
 
202
193
// Fix for Mac OS X defining uintptr_t as "unsigned long":
203
194
#if defined(__APPLE__) && defined(__MACH__)
230
221
 
231
222
const int kDoubleSizeLog2 = 3;
232
223
 
 
224
// Size of the state of a the random number generator.
 
225
const int kRandomStateSize = 2 * kIntSize;
 
226
 
233
227
#if V8_HOST_ARCH_64_BIT
234
228
const int kPointerSizeLog2 = 3;
235
229
const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000);
259
253
// other bits set.
260
254
const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
261
255
 
262
 
// ASCII/UC16 constants
 
256
// ASCII/UTF-16 constants
263
257
// Code-point values in Unicode 4.0 are 21 bits wide.
 
258
// Code units in UTF-16 are 16 bits wide.
264
259
typedef uint16_t uc16;
265
260
typedef int32_t uc32;
266
261
const int kASCIISize    = kCharSize;
291
286
// The USE(x) template is used to silence C++ compiler warnings
292
287
// issued for (yet) unused variables (typically parameters).
293
288
template <typename T>
294
 
static inline void USE(T) { }
 
289
inline void USE(T) { }
295
290
 
296
291
 
297
292
// FUNCTION_ADDR(f) gets the address of a C function f.
336
331
#define INLINE(header) inline __attribute__((always_inline)) header
337
332
#define NO_INLINE(header) __attribute__((noinline)) header
338
333
#endif
 
334
#elif defined(_MSC_VER) && !defined(DEBUG)
 
335
#define INLINE(header) __forceinline header
 
336
#define NO_INLINE(header) header
339
337
#else
340
338
#define INLINE(header) inline header
341
339
#define NO_INLINE(header) header
348
346
#define MUST_USE_RESULT
349
347
#endif
350
348
 
 
349
 
 
350
// Define DISABLE_ASAN macros.
 
351
#if defined(__has_feature)
 
352
#if __has_feature(address_sanitizer)
 
353
#define DISABLE_ASAN __attribute__((no_address_safety_analysis))
 
354
#endif
 
355
#endif
 
356
 
 
357
 
 
358
#ifndef DISABLE_ASAN
 
359
#define DISABLE_ASAN
 
360
#endif
 
361
 
 
362
 
351
363
// -----------------------------------------------------------------------------
352
364
// Forward declarations for frequently used classes
353
365
// (sorted alphabetically)
355
367
class FreeStoreAllocationPolicy;
356
368
template <typename T, class P = FreeStoreAllocationPolicy> class List;
357
369
 
 
370
// -----------------------------------------------------------------------------
 
371
// Declarations for use in both the preparser and the rest of V8.
 
372
 
 
373
// The different language modes that V8 implements. ES5 defines two language
 
374
// modes: an unrestricted mode respectively a strict mode which are indicated by
 
375
// CLASSIC_MODE respectively STRICT_MODE in the enum. The harmony spec drafts
 
376
// for the next ES standard specify a new third mode which is called 'extended
 
377
// mode'. The extended mode is only available if the harmony flag is set. It is
 
378
// based on the 'strict mode' and adds new functionality to it. This means that
 
379
// most of the semantics of these two modes coincide.
 
380
//
 
381
// In the current draft the term 'base code' is used to refer to code that is
 
382
// neither in strict nor extended mode. However, the more distinguishing term
 
383
// 'classic mode' is used in V8 instead to avoid mix-ups.
 
384
 
 
385
enum LanguageMode {
 
386
  CLASSIC_MODE,
 
387
  STRICT_MODE,
 
388
  EXTENDED_MODE
 
389
};
 
390
 
 
391
 
 
392
// The Strict Mode (ECMA-262 5th edition, 4.2.2).
 
393
//
 
394
// This flag is used in the backend to represent the language mode. So far
 
395
// there is no semantic difference between the strict and the extended mode in
 
396
// the backend, so both modes are represented by the kStrictMode value.
 
397
enum StrictModeFlag {
 
398
  kNonStrictMode,
 
399
  kStrictMode
 
400
};
 
401
 
 
402
 
358
403
} }  // namespace v8::internal
359
404
 
360
405
#endif  // V8_GLOBALS_H_