OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_WASM_OBJECTS_H_ | 5 #ifndef V8_WASM_OBJECTS_H_ |
6 #define V8_WASM_OBJECTS_H_ | 6 #define V8_WASM_OBJECTS_H_ |
7 | 7 |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/debug/interface-types.h" | 9 #include "src/debug/interface-types.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } \ | 247 } \ |
248 void set_##NAME(TYPE value) { set(kID_##NAME, Smi::FromInt(value)); } | 248 void set_##NAME(TYPE value) { set(kID_##NAME, Smi::FromInt(value)); } |
249 | 249 |
250 #define WCM_WEAK_LINK(TYPE, NAME) \ | 250 #define WCM_WEAK_LINK(TYPE, NAME) \ |
251 WCM_OBJECT_OR_WEAK(WeakCell, weak_##NAME, kID_##NAME, obj->IsWeakCell()); \ | 251 WCM_OBJECT_OR_WEAK(WeakCell, weak_##NAME, kID_##NAME, obj->IsWeakCell()); \ |
252 \ | 252 \ |
253 Handle<TYPE> NAME() const { \ | 253 Handle<TYPE> NAME() const { \ |
254 return handle(TYPE::cast(weak_##NAME()->value())); \ | 254 return handle(TYPE::cast(weak_##NAME()->value())); \ |
255 } | 255 } |
256 | 256 |
257 #define CORE_WCM_PROPERTY_TABLE(MACRO) \ | 257 #define CORE_WCM_PROPERTY_TABLE(MACRO) \ |
258 MACRO(WASM_OBJECT, WasmSharedModuleData, shared) \ | 258 MACRO(WASM_OBJECT, WasmSharedModuleData, shared) \ |
259 MACRO(OBJECT, Context, native_context) \ | 259 MACRO(OBJECT, Context, native_context) \ |
260 MACRO(OBJECT, FixedArray, code_table) \ | 260 MACRO(SMALL_NUMBER, uint32_t, num_imported_functions) \ |
261 MACRO(OBJECT, FixedArray, weak_exported_functions) \ | 261 MACRO(OBJECT, FixedArray, code_table) \ |
262 MACRO(OBJECT, FixedArray, function_tables) \ | 262 MACRO(OBJECT, FixedArray, weak_exported_functions) \ |
263 MACRO(OBJECT, FixedArray, signature_tables) \ | 263 MACRO(OBJECT, FixedArray, function_tables) \ |
264 MACRO(OBJECT, FixedArray, empty_function_tables) \ | 264 MACRO(OBJECT, FixedArray, signature_tables) \ |
265 MACRO(OBJECT, JSArrayBuffer, memory) \ | 265 MACRO(OBJECT, FixedArray, empty_function_tables) \ |
266 MACRO(SMALL_NUMBER, uint32_t, min_mem_pages) \ | 266 MACRO(OBJECT, JSArrayBuffer, memory) \ |
267 MACRO(SMALL_NUMBER, uint32_t, max_mem_pages) \ | 267 MACRO(SMALL_NUMBER, uint32_t, min_mem_pages) \ |
268 MACRO(WEAK_LINK, WasmCompiledModule, next_instance) \ | 268 MACRO(SMALL_NUMBER, uint32_t, max_mem_pages) \ |
269 MACRO(WEAK_LINK, WasmCompiledModule, prev_instance) \ | 269 MACRO(WEAK_LINK, WasmCompiledModule, next_instance) \ |
270 MACRO(WEAK_LINK, JSObject, owning_instance) \ | 270 MACRO(WEAK_LINK, WasmCompiledModule, prev_instance) \ |
| 271 MACRO(WEAK_LINK, JSObject, owning_instance) \ |
271 MACRO(WEAK_LINK, WasmModuleObject, wasm_module) | 272 MACRO(WEAK_LINK, WasmModuleObject, wasm_module) |
272 | 273 |
273 #if DEBUG | 274 #if DEBUG |
274 #define DEBUG_ONLY_TABLE(MACRO) MACRO(SMALL_NUMBER, uint32_t, instance_id) | 275 #define DEBUG_ONLY_TABLE(MACRO) MACRO(SMALL_NUMBER, uint32_t, instance_id) |
275 #else | 276 #else |
276 #define DEBUG_ONLY_TABLE(IGNORE) | 277 #define DEBUG_ONLY_TABLE(IGNORE) |
277 uint32_t instance_id() const { return -1; } | 278 uint32_t instance_id() const { return -1; } |
278 #endif | 279 #endif |
279 | 280 |
280 #define WCM_PROPERTY_TABLE(MACRO) \ | 281 #define WCM_PROPERTY_TABLE(MACRO) \ |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 }; | 491 }; |
491 }; | 492 }; |
492 | 493 |
493 #undef DECLARE_ACCESSORS | 494 #undef DECLARE_ACCESSORS |
494 #undef DECLARE_OPTIONAL_ACCESSORS | 495 #undef DECLARE_OPTIONAL_ACCESSORS |
495 | 496 |
496 } // namespace internal | 497 } // namespace internal |
497 } // namespace v8 | 498 } // namespace v8 |
498 | 499 |
499 #endif // V8_WASM_OBJECTS_H_ | 500 #endif // V8_WASM_OBJECTS_H_ |
OLD | NEW |