| 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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 bool is_external, void* data, | 1161 bool is_external, void* data, |
| 1162 size_t allocated_length, | 1162 size_t allocated_length, |
| 1163 SharedFlag shared = SharedFlag::kNotShared); | 1163 SharedFlag shared = SharedFlag::kNotShared); |
| 1164 | 1164 |
| 1165 static bool SetupArrayBufferAllocatingData( | 1165 static bool SetupArrayBufferAllocatingData( |
| 1166 Isolate* isolate, Handle<JSArrayBuffer> array_buffer, | 1166 Isolate* isolate, Handle<JSArrayBuffer> array_buffer, |
| 1167 size_t allocated_length, bool initialize = true, | 1167 size_t allocated_length, bool initialize = true, |
| 1168 SharedFlag shared = SharedFlag::kNotShared); | 1168 SharedFlag shared = SharedFlag::kNotShared); |
| 1169 | 1169 |
| 1170 enum TypedArrayId { | 1170 enum TypedArrayId { |
| 1171 // arrayIds below should be synchromized with typedarray.js natives. | 1171 // arrayIds below should be synchronized with typedarray.js natives. |
| 1172 ARRAY_ID_UINT8 = 1, | 1172 ARRAY_ID_UINT8 = 1, |
| 1173 ARRAY_ID_INT8 = 2, | 1173 ARRAY_ID_INT8 = 2, |
| 1174 ARRAY_ID_UINT16 = 3, | 1174 ARRAY_ID_UINT16 = 3, |
| 1175 ARRAY_ID_INT16 = 4, | 1175 ARRAY_ID_INT16 = 4, |
| 1176 ARRAY_ID_UINT32 = 5, | 1176 ARRAY_ID_UINT32 = 5, |
| 1177 ARRAY_ID_INT32 = 6, | 1177 ARRAY_ID_INT32 = 6, |
| 1178 ARRAY_ID_FLOAT32 = 7, | 1178 ARRAY_ID_FLOAT32 = 7, |
| 1179 ARRAY_ID_FLOAT64 = 8, | 1179 ARRAY_ID_FLOAT64 = 8, |
| 1180 ARRAY_ID_UINT8_CLAMPED = 9, | 1180 ARRAY_ID_UINT8_CLAMPED = 9, |
| 1181 ARRAY_ID_FIRST = ARRAY_ID_UINT8, | 1181 ARRAY_ID_FIRST = ARRAY_ID_UINT8, |
| 1182 ARRAY_ID_LAST = ARRAY_ID_UINT8_CLAMPED | 1182 ARRAY_ID_LAST = ARRAY_ID_UINT8_CLAMPED |
| 1183 }; | 1183 }; |
| 1184 | 1184 |
| 1185 static void ArrayIdToTypeAndSize(int array_id, ExternalArrayType* type, | 1185 static void ArrayIdToTypeAndSize(int array_id, ExternalArrayType* type, |
| 1186 ElementsKind* fixed_elements_kind, | 1186 ElementsKind* fixed_elements_kind, |
| 1187 size_t* element_size); | 1187 size_t* element_size); |
| 1188 | 1188 |
| 1189 // Used in runtime.cc and hydrogen's VisitArrayLiteral. | 1189 // Used in runtime.cc and hydrogen's VisitArrayLiteral. |
| 1190 MUST_USE_RESULT static MaybeHandle<Object> CreateArrayLiteralBoilerplate( | 1190 MUST_USE_RESULT static MaybeHandle<Object> CreateArrayLiteralBoilerplate( |
| 1191 Isolate* isolate, Handle<FixedArray> literals, | 1191 Isolate* isolate, Handle<FixedArray> literals, |
| 1192 Handle<FixedArray> elements, bool is_strong); | 1192 Handle<FixedArray> elements, bool is_strong); |
| 1193 | 1193 |
| 1194 static void WeakCollectionInitialize( | |
| 1195 Isolate* isolate, Handle<JSWeakCollection> weak_collection); | |
| 1196 static void WeakCollectionSet(Handle<JSWeakCollection> weak_collection, | |
| 1197 Handle<Object> key, Handle<Object> value, | |
| 1198 int32_t hash); | |
| 1199 static bool WeakCollectionDelete(Handle<JSWeakCollection> weak_collection, | |
| 1200 Handle<Object> key); | |
| 1201 static bool WeakCollectionDelete(Handle<JSWeakCollection> weak_collection, | |
| 1202 Handle<Object> key, int32_t hash); | |
| 1203 | |
| 1204 static MaybeHandle<JSArray> GetInternalProperties(Isolate* isolate, | 1194 static MaybeHandle<JSArray> GetInternalProperties(Isolate* isolate, |
| 1205 Handle<Object>); | 1195 Handle<Object>); |
| 1206 | 1196 |
| 1207 static bool AtomicIsLockFree(uint32_t size); | 1197 static bool AtomicIsLockFree(uint32_t size); |
| 1208 }; | 1198 }; |
| 1209 | 1199 |
| 1210 | 1200 |
| 1211 std::ostream& operator<<(std::ostream&, Runtime::FunctionId); | 1201 std::ostream& operator<<(std::ostream&, Runtime::FunctionId); |
| 1212 | 1202 |
| 1213 //--------------------------------------------------------------------------- | 1203 //--------------------------------------------------------------------------- |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1241 inline bool Runtime::AtomicIsLockFree(uint32_t size) { | 1231 inline bool Runtime::AtomicIsLockFree(uint32_t size) { |
| 1242 return size == 1 || size == 2 || size == 4; | 1232 return size == 1 || size == 2 || size == 4; |
| 1243 } | 1233 } |
| 1244 | 1234 |
| 1245 #endif | 1235 #endif |
| 1246 | 1236 |
| 1247 } // namespace internal | 1237 } // namespace internal |
| 1248 } // namespace v8 | 1238 } // namespace v8 |
| 1249 | 1239 |
| 1250 #endif // V8_RUNTIME_RUNTIME_H_ | 1240 #endif // V8_RUNTIME_RUNTIME_H_ |
| OLD | NEW |