OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_RUNTIME_RUNTIME_H_ | 5 #ifndef V8_RUNTIME_RUNTIME_H_ |
6 #define V8_RUNTIME_RUNTIME_H_ | 6 #define V8_RUNTIME_RUNTIME_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 #include "src/unicode.h" | 10 #include "src/unicode.h" |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1227 class AllocateTargetSpace : public BitField<AllocationSpace, 1, 3> {}; | 1227 class AllocateTargetSpace : public BitField<AllocationSpace, 1, 3> {}; |
1228 | 1228 |
1229 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; | 1229 class DeclareGlobalsEvalFlag : public BitField<bool, 0, 1> {}; |
1230 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; | 1230 class DeclareGlobalsNativeFlag : public BitField<bool, 1, 1> {}; |
1231 STATIC_ASSERT(LANGUAGE_END == 3); | 1231 STATIC_ASSERT(LANGUAGE_END == 3); |
1232 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 2> {}; | 1232 class DeclareGlobalsLanguageMode : public BitField<LanguageMode, 2, 2> {}; |
1233 | 1233 |
1234 //--------------------------------------------------------------------------- | 1234 //--------------------------------------------------------------------------- |
1235 // Inline functions | 1235 // Inline functions |
1236 | 1236 |
1237 // Assume that 32-bit architectures don't have 64-bit atomic ops. | |
1238 // TODO(binji): can we do better here? | |
1239 #if V8_TARGET_ARCH_64_BIT && V8_HOST_ARCH_64_BIT | |
1240 | |
1241 #define ATOMICS_REQUIRE_LOCK_64_BIT 0 | |
1242 | |
1243 inline bool Runtime::AtomicIsLockFree(uint32_t size) { | |
1244 return size == 1 || size == 2 || size == 4 || size == 8; | |
1245 } | |
1246 | |
1247 #else | |
1248 | |
1249 #define ATOMICS_REQUIRE_LOCK_64_BIT 1 | |
1250 | |
1251 inline bool Runtime::AtomicIsLockFree(uint32_t size) { | 1237 inline bool Runtime::AtomicIsLockFree(uint32_t size) { |
1252 return size == 1 || size == 2 || size == 4; | 1238 return size == 1 || size == 2 || size == 4; |
1253 } | 1239 } |
1254 | 1240 |
1255 #endif | |
1256 | |
1257 } // namespace internal | 1241 } // namespace internal |
1258 } // namespace v8 | 1242 } // namespace v8 |
1259 | 1243 |
1260 #endif // V8_RUNTIME_RUNTIME_H_ | 1244 #endif // V8_RUNTIME_RUNTIME_H_ |
OLD | NEW |