| Index: src/globals.h
|
| diff --git a/src/globals.h b/src/globals.h
|
| index b36b64cb956cf7a582fdb2190255e8752725fc6b..c7f359874b4f857b11296dd8779d2deaf87d6aeb 100644
|
| --- a/src/globals.h
|
| +++ b/src/globals.h
|
| @@ -162,6 +162,21 @@ namespace internal {
|
| #endif
|
| #endif
|
|
|
| +// Determine architecture endiannes (we only support little-endian).
|
| +#if defined(V8_TARGET_ARCH_IA32)
|
| +#define V8_TARGET_LITTLE_ENDIAN 1
|
| +#elif defined(V8_TARGET_ARCH_X64)
|
| +#define V8_TARGET_LITTLE_ENDIAN 1
|
| +#elif defined(V8_TARGET_ARCH_ARM)
|
| +#define V8_TARGET_LITTLE_ENDIAN 1
|
| +#elif defined(V8_TARGET_ARCH_A64)
|
| +#define V8_TARGET_LITTLE_ENDIAN 1
|
| +#elif defined(V8_TARGET_ARCH_MIPS)
|
| +#define V8_TARGET_LITTLE_ENDIAN 1
|
| +#else
|
| +#error Unknown target architecture endiannes
|
| +#endif
|
| +
|
| // Support for alternative bool type. This is only enabled if the code is
|
| // compiled with USE_MYBOOL defined. This catches some nasty type bugs.
|
| // For instance, 'bool b = "false";' results in b == true! This is a hidden
|
| @@ -413,6 +428,18 @@ enum LanguageMode {
|
| };
|
|
|
|
|
| +// A simple Maybe type, that can be passed by value.
|
| +template<class T>
|
| +struct Maybe {
|
| + Maybe() : has_value(false) {}
|
| + explicit Maybe(T t) : has_value(true), value(t) {}
|
| + Maybe(bool has, T t) : has_value(has), value(t) {}
|
| +
|
| + bool has_value;
|
| + T value;
|
| +};
|
| +
|
| +
|
| // The Strict Mode (ECMA-262 5th edition, 4.2.2).
|
| //
|
| // This flag is used in the backend to represent the language mode. So far
|
|
|