contexts.h 41.3 KB
Newer Older
1
// Copyright 2012 the V8 project authors. All rights reserved.
2 3
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
4

5 6
#ifndef V8_OBJECTS_CONTEXTS_H_
#define V8_OBJECTS_CONTEXTS_H_
7

8
#include "src/objects/fixed-array.h"
9
#include "src/objects/function-kind.h"
10
#include "src/objects/osr-optimized-code-cache.h"
11
#include "torque-generated/field-offsets-tq.h"
12 13 14
// Has to be the last include (doesn't have include guards):
#include "src/objects/object-macros.h"

15 16
namespace v8 {
namespace internal {
17

18 19
class JSGlobalObject;
class JSGlobalProxy;
20
class MicrotaskQueue;
21
class NativeContext;
22
class RegExpMatchInfo;
23 24

enum ContextLookupFlags {
25 26
  FOLLOW_CONTEXT_CHAIN = 1 << 0,
  FOLLOW_PROTOTYPE_CHAIN = 1 << 1,
27 28

  DONT_FOLLOW_CHAINS = 0,
29
  FOLLOW_CHAINS = FOLLOW_CONTEXT_CHAIN | FOLLOW_PROTOTYPE_CHAIN,
30 31 32 33
};

// Heap-allocated activation contexts.
//
34 35
// Contexts are implemented as FixedArray-like objects having a fixed
// header with a set of common fields.
36 37 38 39 40
//
// Note: Context must have no virtual functions and Context objects
// must always be allocated via Heap::AllocateContext() or
// Factory::NewContext.

41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
#define NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V)                     \
  V(GENERATOR_NEXT_INTERNAL, JSFunction, generator_next_internal) \
  V(ASYNC_MODULE_EVALUATE_INTERNAL, JSFunction,                   \
    async_module_evaluate_internal)                               \
  V(MAKE_ERROR_INDEX, JSFunction, make_error)                     \
  V(MAKE_RANGE_ERROR_INDEX, JSFunction, make_range_error)         \
  V(MAKE_SYNTAX_ERROR_INDEX, JSFunction, make_syntax_error)       \
  V(MAKE_TYPE_ERROR_INDEX, JSFunction, make_type_error)           \
  V(MAKE_URI_ERROR_INDEX, JSFunction, make_uri_error)             \
  V(OBJECT_CREATE, JSFunction, object_create)                     \
  V(REFLECT_APPLY_INDEX, JSFunction, reflect_apply)               \
  V(REFLECT_CONSTRUCT_INDEX, JSFunction, reflect_construct)       \
  V(MATH_FLOOR_INDEX, JSFunction, math_floor)                     \
  V(MATH_POW_INDEX, JSFunction, math_pow)                         \
  V(PROMISE_INTERNAL_CONSTRUCTOR_INDEX, JSFunction,               \
    promise_internal_constructor)                                 \
  V(IS_PROMISE_INDEX, JSFunction, is_promise)                     \
58
  V(PROMISE_THEN_INDEX, JSFunction, promise_then)
59

60
#define NATIVE_CONTEXT_FIELDS(V)                                               \
61
  V(GLOBAL_PROXY_INDEX, JSGlobalProxy, global_proxy_object)                    \
62 63 64 65
  /* TODO(ishell): Actually we store exactly EmbedderDataArray here but */     \
  /* it's already UBSan-fiendly and doesn't require a star... So declare */    \
  /* it as a HeapObject for now. */                                            \
  V(EMBEDDER_DATA_INDEX, HeapObject, embedder_data)                            \
66
  /* Below is alpha-sorted */                                                  \
67 68
  V(ACCESSOR_PROPERTY_DESCRIPTOR_MAP_INDEX, Map,                               \
    accessor_property_descriptor_map)                                          \
69
  V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings)    \
70
  V(ARRAY_BUFFER_FUN_INDEX, JSFunction, array_buffer_fun)                      \
71
  V(ARRAY_BUFFER_MAP_INDEX, Map, array_buffer_map)                             \
72
  V(ARRAY_BUFFER_NOINIT_FUN_INDEX, JSFunction, array_buffer_noinit_fun)        \
73
  V(ARRAY_FUNCTION_INDEX, JSFunction, array_function)                          \
74
  V(ARRAY_JOIN_STACK_INDEX, HeapObject, array_join_stack)                      \
75
  V(ASYNC_FROM_SYNC_ITERATOR_MAP_INDEX, Map, async_from_sync_iterator_map)     \
76 77 78 79
  V(ASYNC_FUNCTION_AWAIT_REJECT_SHARED_FUN, SharedFunctionInfo,                \
    async_function_await_reject_shared_fun)                                    \
  V(ASYNC_FUNCTION_AWAIT_RESOLVE_SHARED_FUN, SharedFunctionInfo,               \
    async_function_await_resolve_shared_fun)                                   \
80
  V(ASYNC_FUNCTION_FUNCTION_INDEX, JSFunction, async_function_constructor)     \
81
  V(ASYNC_FUNCTION_OBJECT_MAP_INDEX, Map, async_function_object_map)           \
82 83
  V(ASYNC_GENERATOR_FUNCTION_FUNCTION_INDEX, JSFunction,                       \
    async_generator_function_function)                                         \
84 85
  V(ASYNC_ITERATOR_VALUE_UNWRAP_SHARED_FUN, SharedFunctionInfo,                \
    async_iterator_value_unwrap_shared_fun)                                    \
86 87 88 89 90 91 92 93 94 95 96 97
  V(ASYNC_GENERATOR_AWAIT_REJECT_SHARED_FUN, SharedFunctionInfo,               \
    async_generator_await_reject_shared_fun)                                   \
  V(ASYNC_GENERATOR_AWAIT_RESOLVE_SHARED_FUN, SharedFunctionInfo,              \
    async_generator_await_resolve_shared_fun)                                  \
  V(ASYNC_GENERATOR_YIELD_RESOLVE_SHARED_FUN, SharedFunctionInfo,              \
    async_generator_yield_resolve_shared_fun)                                  \
  V(ASYNC_GENERATOR_RETURN_RESOLVE_SHARED_FUN, SharedFunctionInfo,             \
    async_generator_return_resolve_shared_fun)                                 \
  V(ASYNC_GENERATOR_RETURN_CLOSED_RESOLVE_SHARED_FUN, SharedFunctionInfo,      \
    async_generator_return_closed_resolve_shared_fun)                          \
  V(ASYNC_GENERATOR_RETURN_CLOSED_REJECT_SHARED_FUN, SharedFunctionInfo,       \
    async_generator_return_closed_reject_shared_fun)                           \
98
  V(ATOMICS_OBJECT, JSObject, atomics_object)                                  \
99
  V(BIGINT_FUNCTION_INDEX, JSFunction, bigint_function)                        \
100 101
  V(BIGINT64_ARRAY_FUN_INDEX, JSFunction, bigint64_array_fun)                  \
  V(BIGUINT64_ARRAY_FUN_INDEX, JSFunction, biguint64_array_fun)                \
102
  V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function)                      \
103 104 105 106
  V(BOUND_FUNCTION_WITH_CONSTRUCTOR_MAP_INDEX, Map,                            \
    bound_function_with_constructor_map)                                       \
  V(BOUND_FUNCTION_WITHOUT_CONSTRUCTOR_MAP_INDEX, Map,                         \
    bound_function_without_constructor_map)                                    \
107 108
  V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction,                            \
    call_as_constructor_delegate)                                              \
109
  V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate)    \
110 111
  V(CALL_ASYNC_MODULE_FULFILLED, JSFunction, call_async_module_fulfilled)      \
  V(CALL_ASYNC_MODULE_REJECTED, JSFunction, call_async_module_rejected)        \
jgruber's avatar
jgruber committed
112
  V(CALLSITE_FUNCTION_INDEX, JSFunction, callsite_function)                    \
113
  V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function)  \
114
  V(DATA_PROPERTY_DESCRIPTOR_MAP_INDEX, Map, data_property_descriptor_map)     \
115
  V(DATA_VIEW_FUN_INDEX, JSFunction, data_view_fun)                            \
116
  V(DATE_FUNCTION_INDEX, JSFunction, date_function)                            \
117
  V(DEBUG_CONTEXT_ID_INDEX, Object, debug_context_id)                          \
118
  V(EMPTY_FUNCTION_INDEX, JSFunction, empty_function)                          \
119 120
  V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object,                     \
    error_message_for_code_gen_from_strings)                                   \
121
  V(ERRORS_THROWN_INDEX, Smi, errors_thrown)                                   \
122
  V(EXTRAS_BINDING_OBJECT_INDEX, JSObject, extras_binding_object)              \
123
  V(FAST_ALIASED_ARGUMENTS_MAP_INDEX, Map, fast_aliased_arguments_map)         \
124 125
  V(FAST_TEMPLATE_INSTANTIATIONS_CACHE_INDEX, FixedArray,                      \
    fast_template_instantiations_cache)                                        \
126 127
  V(FLOAT32_ARRAY_FUN_INDEX, JSFunction, float32_array_fun)                    \
  V(FLOAT64_ARRAY_FUN_INDEX, JSFunction, float64_array_fun)                    \
128 129 130
  V(FUNCTION_FUNCTION_INDEX, JSFunction, function_function)                    \
  V(GENERATOR_FUNCTION_FUNCTION_INDEX, JSFunction,                             \
    generator_function_function)                                               \
131
  V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, generator_object_prototype_map) \
132 133
  V(ASYNC_GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map,                           \
    async_generator_object_prototype_map)                                      \
134
  V(INITIAL_ARRAY_ITERATOR_MAP_INDEX, Map, initial_array_iterator_map)         \
135 136
  V(INITIAL_ARRAY_ITERATOR_PROTOTYPE_INDEX, JSObject,                          \
    initial_array_iterator_prototype)                                          \
137
  V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype)          \
138
  V(INITIAL_ERROR_PROTOTYPE_INDEX, JSObject, initial_error_prototype)          \
139
  V(INITIAL_GENERATOR_PROTOTYPE_INDEX, JSObject, initial_generator_prototype)  \
140 141
  V(INITIAL_ASYNC_GENERATOR_PROTOTYPE_INDEX, JSObject,                         \
    initial_async_generator_prototype)                                         \
142
  V(INITIAL_ITERATOR_PROTOTYPE_INDEX, JSObject, initial_iterator_prototype)    \
143 144
  V(INITIAL_MAP_ITERATOR_PROTOTYPE_INDEX, JSObject,                            \
    initial_map_iterator_prototype)                                            \
145
  V(INITIAL_MAP_PROTOTYPE_MAP_INDEX, Map, initial_map_prototype_map)           \
146
  V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype)        \
147 148 149
  V(INITIAL_SET_ITERATOR_PROTOTYPE_INDEX, JSObject,                            \
    initial_set_iterator_prototype)                                            \
  V(INITIAL_SET_PROTOTYPE_INDEX, JSObject, initial_set_prototype)              \
150
  V(INITIAL_SET_PROTOTYPE_MAP_INDEX, Map, initial_set_prototype_map)           \
151 152 153
  V(INITIAL_STRING_ITERATOR_MAP_INDEX, Map, initial_string_iterator_map)       \
  V(INITIAL_STRING_ITERATOR_PROTOTYPE_INDEX, JSObject,                         \
    initial_string_iterator_prototype)                                         \
154
  V(INITIAL_STRING_PROTOTYPE_INDEX, JSObject, initial_string_prototype)        \
155 156
  V(INITIAL_WEAKMAP_PROTOTYPE_MAP_INDEX, Map, initial_weakmap_prototype_map)   \
  V(INITIAL_WEAKSET_PROTOTYPE_MAP_INDEX, Map, initial_weakset_prototype_map)   \
157 158 159
  V(INT16_ARRAY_FUN_INDEX, JSFunction, int16_array_fun)                        \
  V(INT32_ARRAY_FUN_INDEX, JSFunction, int32_array_fun)                        \
  V(INT8_ARRAY_FUN_INDEX, JSFunction, int8_array_fun)                          \
160
  V(INTL_COLLATOR_FUNCTION_INDEX, JSFunction, intl_collator_function)          \
161 162
  V(INTL_DATE_TIME_FORMAT_FUNCTION_INDEX, JSFunction,                          \
    intl_date_time_format_function)                                            \
163 164
  V(INTL_DISPLAY_NAMES_FUNCTION_INDEX, JSFunction,                             \
    intl_display_names_function)                                               \
165 166
  V(INTL_NUMBER_FORMAT_FUNCTION_INDEX, JSFunction,                             \
    intl_number_format_function)                                               \
167
  V(INTL_LOCALE_FUNCTION_INDEX, JSFunction, intl_locale_function)              \
168 169 170 171 172
  V(INTL_LIST_FORMAT_FUNCTION_INDEX, JSFunction, intl_list_format_function)    \
  V(INTL_PLURAL_RULES_FUNCTION_INDEX, JSFunction, intl_plural_rules_function)  \
  V(INTL_RELATIVE_TIME_FORMAT_FUNCTION_INDEX, JSFunction,                      \
    intl_relative_time_format_function)                                        \
  V(INTL_SEGMENTER_FUNCTION_INDEX, JSFunction, intl_segmenter_function)        \
173
  V(INTL_SEGMENT_ITERATOR_MAP_INDEX, Map, intl_segment_iterator_map)           \
174
  V(ITERATOR_RESULT_MAP_INDEX, Map, iterator_result_map)                       \
175
  V(JS_ARRAY_PACKED_SMI_ELEMENTS_MAP_INDEX, Map,                               \
176
    js_array_packed_smi_elements_map)                                          \
177
  V(JS_ARRAY_HOLEY_SMI_ELEMENTS_MAP_INDEX, Map,                                \
178 179 180
    js_array_holey_smi_elements_map)                                           \
  V(JS_ARRAY_PACKED_ELEMENTS_MAP_INDEX, Map, js_array_packed_elements_map)     \
  V(JS_ARRAY_HOLEY_ELEMENTS_MAP_INDEX, Map, js_array_holey_elements_map)       \
181
  V(JS_ARRAY_PACKED_DOUBLE_ELEMENTS_MAP_INDEX, Map,                            \
182
    js_array_packed_double_elements_map)                                       \
183
  V(JS_ARRAY_HOLEY_DOUBLE_ELEMENTS_MAP_INDEX, Map,                             \
184
    js_array_holey_double_elements_map)                                        \
185
  V(JS_MAP_FUN_INDEX, JSFunction, js_map_fun)                                  \
186
  V(JS_MAP_MAP_INDEX, Map, js_map_map)                                         \
187
  V(JS_MODULE_NAMESPACE_MAP, Map, js_module_namespace_map)                     \
188
  V(JS_SET_FUN_INDEX, JSFunction, js_set_fun)                                  \
189
  V(JS_SET_MAP_INDEX, Map, js_set_map)                                         \
190 191 192
  V(WEAK_CELL_MAP_INDEX, Map, weak_cell_map)                                   \
  V(JS_FINALIZATION_GROUP_CLEANUP_ITERATOR_MAP_INDEX, Map,                     \
    js_finalization_group_cleanup_iterator_map)                                \
193 194
  V(JS_WEAK_MAP_FUN_INDEX, JSFunction, js_weak_map_fun)                        \
  V(JS_WEAK_SET_FUN_INDEX, JSFunction, js_weak_set_fun)                        \
195 196 197
  V(JS_WEAK_REF_FUNCTION_INDEX, JSFunction, js_weak_ref_fun)                   \
  V(JS_FINALIZATION_GROUP_FUNCTION_INDEX, JSFunction,                          \
    js_finalization_group_fun)                                                 \
198 199 200 201 202 203 204 205 206 207 208
  /* Context maps */                                                           \
  V(NATIVE_CONTEXT_MAP_INDEX, Map, native_context_map)                         \
  V(FUNCTION_CONTEXT_MAP_INDEX, Map, function_context_map)                     \
  V(MODULE_CONTEXT_MAP_INDEX, Map, module_context_map)                         \
  V(EVAL_CONTEXT_MAP_INDEX, Map, eval_context_map)                             \
  V(SCRIPT_CONTEXT_MAP_INDEX, Map, script_context_map)                         \
  V(AWAIT_CONTEXT_MAP_INDEX, Map, await_context_map)                           \
  V(BLOCK_CONTEXT_MAP_INDEX, Map, block_context_map)                           \
  V(CATCH_CONTEXT_MAP_INDEX, Map, catch_context_map)                           \
  V(WITH_CONTEXT_MAP_INDEX, Map, with_context_map)                             \
  V(DEBUG_EVALUATE_CONTEXT_MAP_INDEX, Map, debug_evaluate_context_map)         \
209
  V(MAP_CACHE_INDEX, Object, map_cache)                                        \
210 211 212
  V(MAP_KEY_ITERATOR_MAP_INDEX, Map, map_key_iterator_map)                     \
  V(MAP_KEY_VALUE_ITERATOR_MAP_INDEX, Map, map_key_value_iterator_map)         \
  V(MAP_VALUE_ITERATOR_MAP_INDEX, Map, map_value_iterator_map)                 \
213
  V(MATH_RANDOM_INDEX_INDEX, Smi, math_random_index)                           \
214 215
  V(MATH_RANDOM_STATE_INDEX, ByteArray, math_random_state)                     \
  V(MATH_RANDOM_CACHE_INDEX, FixedDoubleArray, math_random_cache)              \
216
  V(MESSAGE_LISTENERS_INDEX, TemplateList, message_listeners)                  \
217 218 219
  V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache)                  \
  V(NUMBER_FUNCTION_INDEX, JSFunction, number_function)                        \
  V(OBJECT_FUNCTION_INDEX, JSFunction, object_function)                        \
220
  V(OBJECT_FUNCTION_PROTOTYPE_MAP_INDEX, Map, object_function_prototype_map)   \
221 222
  V(PROXY_CALLABLE_MAP_INDEX, Map, proxy_callable_map)                         \
  V(PROXY_CONSTRUCTOR_MAP_INDEX, Map, proxy_constructor_map)                   \
223
  V(PROXY_FUNCTION_INDEX, JSFunction, proxy_function)                          \
224
  V(PROXY_MAP_INDEX, Map, proxy_map)                                           \
225 226
  V(PROXY_REVOCABLE_RESULT_MAP_INDEX, Map, proxy_revocable_result_map)         \
  V(PROXY_REVOKE_SHARED_FUN, SharedFunctionInfo, proxy_revoke_shared_fun)      \
227 228
  V(PROMISE_GET_CAPABILITIES_EXECUTOR_SHARED_FUN, SharedFunctionInfo,          \
    promise_get_capabilities_executor_shared_fun)                              \
229 230 231 232
  V(PROMISE_CAPABILITY_DEFAULT_REJECT_SHARED_FUN_INDEX, SharedFunctionInfo,    \
    promise_capability_default_reject_shared_fun)                              \
  V(PROMISE_CAPABILITY_DEFAULT_RESOLVE_SHARED_FUN_INDEX, SharedFunctionInfo,   \
    promise_capability_default_resolve_shared_fun)                             \
233 234 235 236 237 238 239 240
  V(PROMISE_THEN_FINALLY_SHARED_FUN, SharedFunctionInfo,                       \
    promise_then_finally_shared_fun)                                           \
  V(PROMISE_CATCH_FINALLY_SHARED_FUN, SharedFunctionInfo,                      \
    promise_catch_finally_shared_fun)                                          \
  V(PROMISE_VALUE_THUNK_FINALLY_SHARED_FUN, SharedFunctionInfo,                \
    promise_value_thunk_finally_shared_fun)                                    \
  V(PROMISE_THROWER_FINALLY_SHARED_FUN, SharedFunctionInfo,                    \
    promise_thrower_finally_shared_fun)                                        \
241 242
  V(PROMISE_ALL_RESOLVE_ELEMENT_SHARED_FUN, SharedFunctionInfo,                \
    promise_all_resolve_element_shared_fun)                                    \
243 244 245 246
  V(PROMISE_ALL_SETTLED_RESOLVE_ELEMENT_SHARED_FUN, SharedFunctionInfo,        \
    promise_all_settled_resolve_element_shared_fun)                            \
  V(PROMISE_ALL_SETTLED_REJECT_ELEMENT_SHARED_FUN, SharedFunctionInfo,         \
    promise_all_settled_reject_element_shared_fun)                             \
247
  V(PROMISE_PROTOTYPE_INDEX, JSObject, promise_prototype)                      \
248
  V(REGEXP_EXEC_FUNCTION_INDEX, JSFunction, regexp_exec_function)              \
249
  V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function)                        \
250
  V(REGEXP_LAST_MATCH_INFO_INDEX, RegExpMatchInfo, regexp_last_match_info)     \
251 252
  V(REGEXP_MATCH_ALL_FUNCTION_INDEX, JSFunction, regexp_match_all_function)    \
  V(REGEXP_MATCH_FUNCTION_INDEX, JSFunction, regexp_match_function)            \
253
  V(REGEXP_PROTOTYPE_INDEX, JSObject, regexp_prototype)                        \
254
  V(REGEXP_PROTOTYPE_MAP_INDEX, Map, regexp_prototype_map)                     \
255
  V(REGEXP_REPLACE_FUNCTION_INDEX, JSFunction, regexp_replace_function)        \
256
  V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map)                           \
257
  V(REGEXP_RESULT_INDICES_MAP_INDEX, Map, regexp_result_indices_map)           \
258 259
  V(REGEXP_SEARCH_FUNCTION_INDEX, JSFunction, regexp_search_function)          \
  V(REGEXP_SPLIT_FUNCTION_INDEX, JSFunction, regexp_split_function)            \
260
  V(INITIAL_REGEXP_STRING_ITERATOR_PROTOTYPE_MAP_INDEX, Map,                   \
261
    initial_regexp_string_iterator_prototype_map)                              \
262
  V(SCRIPT_CONTEXT_TABLE_INDEX, ScriptContextTable, script_context_table)      \
263
  V(SCRIPT_EXECUTION_CALLBACK_INDEX, Object, script_execution_callback)        \
264
  V(SECURITY_TOKEN_INDEX, Object, security_token)                              \
265
  V(SERIALIZED_OBJECTS, FixedArray, serialized_objects)                        \
266 267
  V(SET_VALUE_ITERATOR_MAP_INDEX, Map, set_value_iterator_map)                 \
  V(SET_KEY_VALUE_ITERATOR_MAP_INDEX, Map, set_key_value_iterator_map)         \
268 269 270
  V(SHARED_ARRAY_BUFFER_FUN_INDEX, JSFunction, shared_array_buffer_fun)        \
  V(SLOPPY_ARGUMENTS_MAP_INDEX, Map, sloppy_arguments_map)                     \
  V(SLOW_ALIASED_ARGUMENTS_MAP_INDEX, Map, slow_aliased_arguments_map)         \
271
  V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map)                     \
272 273
  V(SLOW_OBJECT_WITH_NULL_PROTOTYPE_MAP, Map,                                  \
    slow_object_with_null_prototype_map)                                       \
274 275
  V(SLOW_OBJECT_WITH_OBJECT_PROTOTYPE_MAP, Map,                                \
    slow_object_with_object_prototype_map)                                     \
276
  V(SLOW_TEMPLATE_INSTANTIATIONS_CACHE_INDEX, SimpleNumberDictionary,          \
277
    slow_template_instantiations_cache)                                        \
278 279
  /* Fast Path Protectors */                                                   \
  V(REGEXP_SPECIES_PROTECTOR_INDEX, PropertyCell, regexp_species_protector)    \
280 281 282
  /* All *_FUNCTION_MAP_INDEX definitions used by Context::FunctionMapIndex */ \
  /* must remain together. */                                                  \
  V(SLOPPY_FUNCTION_MAP_INDEX, Map, sloppy_function_map)                       \
283
  V(SLOPPY_FUNCTION_WITH_NAME_MAP_INDEX, Map, sloppy_function_with_name_map)   \
284 285 286 287
  V(SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map,                          \
    sloppy_function_without_prototype_map)                                     \
  V(SLOPPY_FUNCTION_WITH_READONLY_PROTOTYPE_MAP_INDEX, Map,                    \
    sloppy_function_with_readonly_prototype_map)                               \
288
  V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map)                       \
289
  V(STRICT_FUNCTION_WITH_NAME_MAP_INDEX, Map, strict_function_with_name_map)   \
290 291
  V(STRICT_FUNCTION_WITH_READONLY_PROTOTYPE_MAP_INDEX, Map,                    \
    strict_function_with_readonly_prototype_map)                               \
292 293 294 295 296 297 298 299 300 301 302 303
  V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map,                          \
    strict_function_without_prototype_map)                                     \
  V(METHOD_WITH_NAME_MAP_INDEX, Map, method_with_name_map)                     \
  V(METHOD_WITH_HOME_OBJECT_MAP_INDEX, Map, method_with_home_object_map)       \
  V(METHOD_WITH_NAME_AND_HOME_OBJECT_MAP_INDEX, Map,                           \
    method_with_name_and_home_object_map)                                      \
  V(ASYNC_FUNCTION_MAP_INDEX, Map, async_function_map)                         \
  V(ASYNC_FUNCTION_WITH_NAME_MAP_INDEX, Map, async_function_with_name_map)     \
  V(ASYNC_FUNCTION_WITH_HOME_OBJECT_MAP_INDEX, Map,                            \
    async_function_with_home_object_map)                                       \
  V(ASYNC_FUNCTION_WITH_NAME_AND_HOME_OBJECT_MAP_INDEX, Map,                   \
    async_function_with_name_and_home_object_map)                              \
304
  V(GENERATOR_FUNCTION_MAP_INDEX, Map, generator_function_map)                 \
305 306 307 308 309 310
  V(GENERATOR_FUNCTION_WITH_NAME_MAP_INDEX, Map,                               \
    generator_function_with_name_map)                                          \
  V(GENERATOR_FUNCTION_WITH_HOME_OBJECT_MAP_INDEX, Map,                        \
    generator_function_with_home_object_map)                                   \
  V(GENERATOR_FUNCTION_WITH_NAME_AND_HOME_OBJECT_MAP_INDEX, Map,               \
    generator_function_with_name_and_home_object_map)                          \
311
  V(ASYNC_GENERATOR_FUNCTION_MAP_INDEX, Map, async_generator_function_map)     \
312 313 314 315 316 317
  V(ASYNC_GENERATOR_FUNCTION_WITH_NAME_MAP_INDEX, Map,                         \
    async_generator_function_with_name_map)                                    \
  V(ASYNC_GENERATOR_FUNCTION_WITH_HOME_OBJECT_MAP_INDEX, Map,                  \
    async_generator_function_with_home_object_map)                             \
  V(ASYNC_GENERATOR_FUNCTION_WITH_NAME_AND_HOME_OBJECT_MAP_INDEX, Map,         \
    async_generator_function_with_name_and_home_object_map)                    \
318
  V(CLASS_FUNCTION_MAP_INDEX, Map, class_function_map)                         \
319 320 321
  V(STRING_FUNCTION_INDEX, JSFunction, string_function)                        \
  V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map)   \
  V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function)                        \
322
  V(WASM_EXPORTED_FUNCTION_MAP_INDEX, Map, wasm_exported_function_map)         \
323
  V(WASM_EXCEPTION_CONSTRUCTOR_INDEX, JSFunction, wasm_exception_constructor)  \
324
  V(WASM_GLOBAL_CONSTRUCTOR_INDEX, JSFunction, wasm_global_constructor)        \
325 326 327 328
  V(WASM_INSTANCE_CONSTRUCTOR_INDEX, JSFunction, wasm_instance_constructor)    \
  V(WASM_MEMORY_CONSTRUCTOR_INDEX, JSFunction, wasm_memory_constructor)        \
  V(WASM_MODULE_CONSTRUCTOR_INDEX, JSFunction, wasm_module_constructor)        \
  V(WASM_TABLE_CONSTRUCTOR_INDEX, JSFunction, wasm_table_constructor)          \
329
  V(TEMPLATE_WEAKMAP_INDEX, HeapObject, template_weakmap)                      \
330 331
  V(TYPED_ARRAY_FUN_INDEX, JSFunction, typed_array_function)                   \
  V(TYPED_ARRAY_PROTOTYPE_INDEX, JSObject, typed_array_prototype)              \
332 333 334 335
  V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun)                      \
  V(UINT32_ARRAY_FUN_INDEX, JSFunction, uint32_array_fun)                      \
  V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun)                        \
  V(UINT8_CLAMPED_ARRAY_FUN_INDEX, JSFunction, uint8_clamped_array_fun)        \
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
  V(ARRAY_ENTRIES_ITERATOR_INDEX, JSFunction, array_entries_iterator)          \
  V(ARRAY_FOR_EACH_ITERATOR_INDEX, JSFunction, array_for_each_iterator)        \
  V(ARRAY_KEYS_ITERATOR_INDEX, JSFunction, array_keys_iterator)                \
  V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator)            \
  V(ERROR_FUNCTION_INDEX, JSFunction, error_function)                          \
  V(ERROR_TO_STRING, JSFunction, error_to_string)                              \
  V(EVAL_ERROR_FUNCTION_INDEX, JSFunction, eval_error_function)                \
  V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun)                        \
  V(GLOBAL_PROXY_FUNCTION_INDEX, JSFunction, global_proxy_function)            \
  V(MAP_DELETE_INDEX, JSFunction, map_delete)                                  \
  V(MAP_GET_INDEX, JSFunction, map_get)                                        \
  V(MAP_HAS_INDEX, JSFunction, map_has)                                        \
  V(MAP_SET_INDEX, JSFunction, map_set)                                        \
  V(FUNCTION_HAS_INSTANCE_INDEX, JSFunction, function_has_instance)            \
  V(OBJECT_TO_STRING, JSFunction, object_to_string)                            \
  V(PROMISE_ALL_INDEX, JSFunction, promise_all)                                \
  V(PROMISE_CATCH_INDEX, JSFunction, promise_catch)                            \
  V(PROMISE_FUNCTION_INDEX, JSFunction, promise_function)                      \
  V(RANGE_ERROR_FUNCTION_INDEX, JSFunction, range_error_function)              \
  V(REFERENCE_ERROR_FUNCTION_INDEX, JSFunction, reference_error_function)      \
  V(SET_ADD_INDEX, JSFunction, set_add)                                        \
  V(SET_DELETE_INDEX, JSFunction, set_delete)                                  \
  V(SET_HAS_INDEX, JSFunction, set_has)                                        \
  V(SYNTAX_ERROR_FUNCTION_INDEX, JSFunction, syntax_error_function)            \
  V(TYPE_ERROR_FUNCTION_INDEX, JSFunction, type_error_function)                \
  V(URI_ERROR_FUNCTION_INDEX, JSFunction, uri_error_function)                  \
  V(WASM_COMPILE_ERROR_FUNCTION_INDEX, JSFunction,                             \
    wasm_compile_error_function)                                               \
  V(WASM_LINK_ERROR_FUNCTION_INDEX, JSFunction, wasm_link_error_function)      \
  V(WASM_RUNTIME_ERROR_FUNCTION_INDEX, JSFunction,                             \
    wasm_runtime_error_function)                                               \
  V(WEAKMAP_SET_INDEX, JSFunction, weakmap_set)                                \
  V(WEAKMAP_GET_INDEX, JSFunction, weakmap_get)                                \
  V(WEAKSET_ADD_INDEX, JSFunction, weakset_add)                                \
370
  V(OSR_CODE_CACHE_INDEX, WeakFixedArray, osr_code_cache)                      \
371
  NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V)
372

373 374
// A table of all script contexts. Every loaded top-level script with top-level
// lexical declarations contributes its ScriptContext into this table.
375 376
//
// The table is a fixed array, its first slot is the current used count and
377
// the subsequent slots 1..used contain ScriptContexts.
378
class ScriptContextTable : public FixedArray {
379
 public:
380
  DECL_CAST(ScriptContextTable)
381 382 383 384 385 386 387 388 389

  struct LookupResult {
    int context_index;
    int slot_index;
    VariableMode mode;
    InitializationFlag init_flag;
    MaybeAssignedFlag maybe_assigned_flag;
  };

390 391
  inline int used() const;
  inline void set_used(int used);
392

393 394
  static inline Handle<Context> GetContext(Isolate* isolate,
                                           Handle<ScriptContextTable> table,
395
                                           int i);
396
  inline Context get_context(int i) const;
397

398
  // Lookup a variable `name` in a ScriptContextTable.
399 400 401
  // If it returns true, the variable is found and `result` contains
  // valid information about its location.
  // If it returns false, `result` is untouched.
402
  V8_WARN_UNUSED_RESULT
403 404 405
  V8_EXPORT_PRIVATE static bool Lookup(Isolate* isolate,
                                       ScriptContextTable table, String name,
                                       LookupResult* result);
406

407
  V8_WARN_UNUSED_RESULT
408 409
  static Handle<ScriptContextTable> Extend(Handle<ScriptContextTable> table,
                                           Handle<Context> script_context);
410

411 412
  static const int kUsedSlotIndex = 0;
  static const int kFirstContextSlotIndex = 1;
413
  static const int kMinLength = kFirstContextSlotIndex;
414

415
  OBJECT_CONSTRUCTORS(ScriptContextTable, FixedArray);
416
};
417 418 419 420 421 422 423 424 425

// JSFunctions are pairs (context, function code), sometimes also called
// closures. A Context object is used to represent function contexts and
// dynamically pushed 'with' contexts (or 'scopes' in ECMA-262 speak).
//
// At runtime, the contexts build a stack in parallel to the execution
// stack, with the top-most context being the current context. All contexts
// have the following slots:
//
426 427 428 429 430
// [ scope_info     ]  This is the scope info describing the current context. It
//                     contains the names of statically allocated context slots,
//                     and stack-allocated locals.  The names are needed for
//                     dynamic lookups in the presence of 'with' or 'eval', and
//                     for the debugger.
431
//
432
// [ previous       ]  A pointer to the previous context.
433
//
434 435
// [ extension      ]  Additional data. This slot is only available when
//                     extension_bit is set. Check using has_extension.
436
//
437
//                     For native contexts, it contains the global object.
438
//                     For module contexts, it contains the module object.
439
//                     For await contexts, it contains the generator object.
440 441
//                     For var block contexts, it may contain an "extension
//                     object".
442
//                     For with contexts, it contains an "extension object".
443
//
444 445 446 447 448 449 450
//                     An "extension object" is used to dynamically extend a
//                     context with additional variables, namely in the
//                     implementation of the 'with' construct and the 'eval'
//                     construct.  For instance, Context::Lookup also searches
//                     the extension object for properties.  (Storing the
//                     extension object is the original purpose of this context
//                     slot, hence the name.)
451
//
452 453 454 455
// In addition, function contexts with sloppy eval may have statically
// allocated context slots to store local variables/functions that are accessed
// from inner functions (via static context addresses) or through 'eval'
// (dynamic context lookups).
456 457 458 459
// The native context contains additional slots for fast access to native
// properties.
//
// Finally, with Harmony scoping, the JSFunction representing a top level
460 461 462
// script will have the ScriptContext rather than a FunctionContext.
// Script contexts from all top-level scripts are gathered in
// ScriptContextTable.
463

464
class Context : public HeapObject {
465
 public:
466 467
  NEVER_READ_ONLY_SPACE

468
  DECL_CAST(Context)
469 470
  // [length]: length of the context.
  V8_INLINE int length() const;
471
  V8_INLINE void set_length(int value);
472 473

  // Setter and getter for elements.
474
  V8_INLINE Object get(int index) const;
475
  V8_INLINE Object get(const Isolate* isolate, int index) const;
476
  V8_INLINE void set(int index, Object value);
477
  // Setter with explicit barrier mode.
478
  V8_INLINE void set(int index, Object value, WriteBarrierMode mode);
479

480 481
  DEFINE_FIELD_OFFSET_CONSTANTS(HeapObject::kHeaderSize,
                                TORQUE_GENERATED_CONTEXT_FIELDS)
482 483

  // TODO(v8:8989): [torque] Support marker constants
484
  /* TODO(ishell): remove this fixedArray-like header size. */
485
  static const int kFixedArrayLikeHeaderSize = kScopeInfoOffset;
486
  static const int kStartOfTaggedFieldsOffset = kScopeInfoOffset;
487 488 489
  /* Header size. */                                                  \
  /* TODO(ishell): use this as header size once MIN_CONTEXT_SLOTS */  \
  /* is removed in favour of offset-based access to common fields. */ \
490
  static const int kTodoHeaderSize = kHeaderSize;
491

492 493 494
  // If the extension slot exists, it is the first slot after the header.
  static const int kExtensionOffset = kHeaderSize;

495 496
  // Garbage collection support.
  V8_INLINE static constexpr int SizeFor(int length) {
497
    return kFixedArrayLikeHeaderSize + length * kTaggedSize;
498 499 500 501 502 503 504 505 506 507 508 509
  }

  // Code Generation support.
  // Offset of the element from the beginning of object.
  V8_INLINE static constexpr int OffsetOfElementAt(int index) {
    return SizeFor(index);
  }
  // Offset of the element from the heap object pointer.
  V8_INLINE static constexpr int SlotOffset(int index) {
    return SizeFor(index) - kHeapObjectTag;
  }

510 511
  // TODO(ishell): eventually migrate to the offset based access instead of
  // index-based.
512
  // The default context slot layout; indices are FixedArray slot indices.
513
  enum Field {
514
    // TODO(shell): use offset-based approach for accessing common values.
515
    // These slots are in all contexts.
516
    SCOPE_INFO_INDEX,
517
    PREVIOUS_INDEX,
518 519

    // This slot only exists if the extension_flag bit is set.
520
    EXTENSION_INDEX,
521

522
// These slots are only in native contexts.
523 524 525
#define NATIVE_CONTEXT_SLOT(index, type, name) index,
    NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_SLOT)
#undef NATIVE_CONTEXT_SLOT
526 527 528

    // Properties from here are treated as weak references by the full GC.
    // Scavenge treats them as strong references.
529 530 531
    OPTIMIZED_CODE_LIST,    // Weak.
    DEOPTIMIZED_CODE_LIST,  // Weak.
    NEXT_CONTEXT_LINK,      // Weak.
532 533

    // Total number of slots.
534
    NATIVE_CONTEXT_SLOTS,
535
    FIRST_WEAK_SLOT = OPTIMIZED_CODE_LIST,
536
    FIRST_JS_ARRAY_MAP_SLOT = JS_ARRAY_PACKED_SMI_ELEMENTS_MAP_INDEX,
537

538
    // TODO(shell): Remove, once it becomes zero
539 540
    MIN_CONTEXT_SLOTS = EXTENSION_INDEX,
    MIN_CONTEXT_EXTENDED_SLOTS = EXTENSION_INDEX + 1,
541

542 543
    // This slot holds the thrown value in catch contexts.
    THROWN_OBJECT_INDEX = MIN_CONTEXT_SLOTS,
544 545

    // These slots hold values in debug evaluate contexts.
546 547
    WRAPPED_CONTEXT_INDEX = MIN_CONTEXT_EXTENDED_SLOTS,
    BLACK_LIST_INDEX = MIN_CONTEXT_EXTENDED_SLOTS + 1
548 549
  };

550 551 552 553
  static const int kExtensionSize =
      (MIN_CONTEXT_EXTENDED_SLOTS - MIN_CONTEXT_SLOTS) * kTaggedSize;
  static const int kExtendedHeaderSize = kHeaderSize + kExtensionSize;

554 555 556 557 558
  // A region of native context entries containing maps for functions created
  // by Builtins::kFastNewClosure.
  static const int FIRST_FUNCTION_MAP_INDEX = SLOPPY_FUNCTION_MAP_INDEX;
  static const int LAST_FUNCTION_MAP_INDEX = CLASS_FUNCTION_MAP_INDEX;

559 560 561
  static const int kNoContext = 0;
  static const int kInvalidContext = 1;

562
  // Direct slot access.
563
  inline void set_scope_info(ScopeInfo scope_info);
564 565

  inline Object unchecked_previous();
566 567
  inline Context previous();
  inline void set_previous(Context context);
568

569
  inline Object next_context_link();
570

571
  inline bool has_extension();
572 573
  inline HeapObject extension();
  inline void set_extension(HeapObject object);
574 575
  JSObject extension_object();
  JSReceiver extension_receiver();
576
  V8_EXPORT_PRIVATE ScopeInfo scope_info();
577

578 579
  // Find the module context (assuming there is one) and return the associated
  // module object.
580
  SourceTextModule module();
581

582 583
  // Get the context where var declarations will be hoisted to, which
  // may be the context itself.
584
  Context declaration_context();
585
  bool is_declaration_context();
586

587
  // Get the next closure's context on the context chain.
588
  Context closure_context();
589

590
  // Returns a JSGlobalProxy object or null.
591
  V8_EXPORT_PRIVATE JSGlobalProxy global_proxy();
592

593
  // Get the JSGlobalObject object.
594
  V8_EXPORT_PRIVATE JSGlobalObject global_object();
595

596
  // Get the script context by traversing the context chain.
597
  Context script_context();
598

599
  // Compute the native context.
600
  inline NativeContext native_context() const;
601

602 603
  // Predicates for context types.  IsNativeContext is already defined on
  // Object.
604 605 606 607
  inline bool IsFunctionContext() const;
  inline bool IsCatchContext() const;
  inline bool IsWithContext() const;
  inline bool IsDebugEvaluateContext() const;
608
  inline bool IsAwaitContext() const;
609 610 611 612 613
  inline bool IsBlockContext() const;
  inline bool IsModuleContext() const;
  inline bool IsEvalContext() const;
  inline bool IsScriptContext() const;

614
  inline bool HasSameSecurityTokenAs(Context that) const;
615

616 617
  Handle<Object> ErrorMessageForCodeGenerationFromStrings();

618
  static int IntrinsicIndexForName(Handle<String> name);
619
  static int IntrinsicIndexForName(const unsigned char* name, int length);
620

621
#define NATIVE_CONTEXT_FIELD_ACCESSORS(index, type, name) \
622 623 624
  inline void set_##name(type value);                     \
  inline bool is_##name(type value) const;                \
  inline type name() const;
625 626
  NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSORS)
#undef NATIVE_CONTEXT_FIELD_ACCESSORS
627

628
  // Lookup the slot called name, starting with the current context.
629
  // There are three possibilities:
630
  //
631 632 633 634
  // 1) result->IsContext():
  //    The binding was found in a context.  *index is always the
  //    non-negative slot index.  *attributes is NONE for var and let
  //    declarations, READ_ONLY for const declarations (never ABSENT).
635
  //
636 637 638 639 640
  // 2) result->IsJSObject():
  //    The binding was found as a named property in a context extension
  //    object (i.e., was introduced via eval), as a property on the subject
  //    of with, or as a property of the global object.  *index is -1 and
  //    *attributes is not ABSENT.
641
  //
642 643 644 645 646
  // 3) result->IsModule():
  //    The binding was found in module imports or exports.
  //     *attributes is never ABSENT. imports are READ_ONLY.
  //
  // 4) result.is_null():
647 648
  //    There was no binding found, *index is always -1 and *attributes is
  //    always ABSENT.
649 650 651 652 653 654
  static Handle<Object> Lookup(Handle<Context> context, Handle<String> name,
                               ContextLookupFlags flags, int* index,
                               PropertyAttributes* attributes,
                               InitializationFlag* init_flag,
                               VariableMode* variable_mode,
                               bool* is_sloppy_function_name = nullptr);
655

656
  static inline int FunctionMapIndex(LanguageMode language_mode,
657
                                     FunctionKind kind, bool has_shared_name,
658
                                     bool needs_home_object);
659

660
  static int ArrayMapIndex(ElementsKind elements_kind) {
661
    DCHECK(IsFastElementsKind(elements_kind));
662
    return elements_kind + FIRST_JS_ARRAY_MAP_SLOT;
663 664
  }

665
  inline Map GetInitialJSArrayMap(ElementsKind kind) const;
666

667
  static const int kNotFound = -1;
668

669 670 671 672
  // Dispatched behavior.
  DECL_PRINTER(Context)
  DECL_VERIFIER(Context)

673
  using BodyDescriptor = FlexibleBodyDescriptor<kStartOfTaggedFieldsOffset>;
674

675 676 677
 private:
#ifdef DEBUG
  // Bootstrapping-aware type checks.
678
  static bool IsBootstrappingOrValidParentContext(Object object, Context kid);
679
#endif
680

681
  OBJECT_CONSTRUCTORS(Context, HeapObject);
682 683
  DECL_INT_ACCESSORS(length_and_extension_flag)
  DECL_SYNCHRONIZED_INT_ACCESSORS(length_and_extension_flag)
684 685
};

686 687
class NativeContext : public Context {
 public:
688
  DECL_CAST(NativeContext)
689 690
  // TODO(neis): Move some stuff from Context here.

691 692 693 694 695 696 697 698 699 700
  // [microtask_queue]: pointer to the MicrotaskQueue object.
  DECL_PRIMITIVE_ACCESSORS(microtask_queue, MicrotaskQueue*)

  // Dispatched behavior.
  DECL_PRINTER(NativeContext)
  DECL_VERIFIER(NativeContext)

  // Layout description.
#define NATIVE_CONTEXT_FIELDS_DEF(V)                                        \
  /* TODO(ishell): move definition of common context offsets to Context. */ \
701
  V(kStartOfNativeContextFieldsOffset,                                      \
702
    (FIRST_WEAK_SLOT - MIN_CONTEXT_EXTENDED_SLOTS) * kTaggedSize)           \
703 704 705 706 707 708 709 710 711 712 713
  V(kEndOfStrongFieldsOffset, 0)                                            \
  V(kStartOfWeakFieldsOffset,                                               \
    (NATIVE_CONTEXT_SLOTS - FIRST_WEAK_SLOT) * kTaggedSize)                 \
  V(kEndOfWeakFieldsOffset, 0)                                              \
  V(kEndOfNativeContextFieldsOffset, 0)                                     \
  V(kEndOfTaggedFieldsOffset, 0)                                            \
  /* Raw data. */                                                           \
  V(kMicrotaskQueueOffset, kSystemPointerSize)                              \
  /* Total size. */                                                         \
  V(kSize, 0)

714
  DEFINE_FIELD_OFFSET_CONSTANTS(Context::kExtendedHeaderSize,
715
                                NATIVE_CONTEXT_FIELDS_DEF)
716 717 718 719
#undef NATIVE_CONTEXT_FIELDS_DEF

  class BodyDescriptor;

720 721 722 723 724 725 726 727
  // The native context stores a list of all optimized code and a list of all
  // deoptimized code, which are needed by the deoptimizer.
  V8_EXPORT_PRIVATE void AddOptimizedCode(Code code);
  void SetOptimizedCodeListHead(Object head);
  Object OptimizedCodeListHead();
  void SetDeoptimizedCodeListHead(Object head);
  Object DeoptimizedCodeListHead();

728 729
  inline OSROptimizedCodeCache GetOSROptimizedCodeCache();

730 731 732 733
  void ResetErrorsThrown();
  void IncrementErrorsThrown();
  int GetErrorsThrown();

734
 private:
735 736 737
  STATIC_ASSERT(OffsetOfElementAt(EMBEDDER_DATA_INDEX) ==
                Internals::kNativeContextEmbedderDataOffset);

738
  OBJECT_CONSTRUCTORS(NativeContext, Context);
739 740
};

741
using ContextField = Context::Field;
742

743 744
}  // namespace internal
}  // namespace v8
745

746 747
#include "src/objects/object-macros-undef.h"

748
#endif  // V8_OBJECTS_CONTEXTS_H_