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_CONTEXTS_H_ | 5 #ifndef V8_CONTEXTS_H_ |
6 #define V8_CONTEXTS_H_ | 6 #define V8_CONTEXTS_H_ |
7 | 7 |
8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // Heap-allocated activation contexts. | 67 // Heap-allocated activation contexts. |
68 // | 68 // |
69 // Contexts are implemented as FixedArray objects; the Context | 69 // Contexts are implemented as FixedArray objects; the Context |
70 // class is a convenience interface casted on a FixedArray object. | 70 // class is a convenience interface casted on a FixedArray object. |
71 // | 71 // |
72 // Note: Context must have no virtual functions and Context objects | 72 // Note: Context must have no virtual functions and Context objects |
73 // must always be allocated via Heap::AllocateContext() or | 73 // must always be allocated via Heap::AllocateContext() or |
74 // Factory::NewContext. | 74 // Factory::NewContext. |
75 | 75 |
| 76 #define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \ |
| 77 V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) \ |
| 78 V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \ |
| 79 V(ERROR_FUNCTION_INDEX, JSFunction, error_function) \ |
| 80 V(EVAL_ERROR_FUNCTION_INDEX, JSFunction, eval_error_function) \ |
| 81 V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \ |
| 82 V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \ |
| 83 V(JSON_SERIALIZE_ADAPTER_INDEX, JSFunction, json_serialize_adapter) \ |
| 84 V(MAKE_ERROR_FUNCTION_INDEX, JSFunction, make_error_function) \ |
| 85 V(MAP_DELETE_METHOD_INDEX, JSFunction, map_delete) \ |
| 86 V(MAP_FROM_ARRAY_INDEX, JSFunction, map_from_array) \ |
| 87 V(MAP_GET_METHOD_INDEX, JSFunction, map_get) \ |
| 88 V(MAP_HAS_METHOD_INDEX, JSFunction, map_has) \ |
| 89 V(MAP_SET_METHOD_INDEX, JSFunction, map_set) \ |
| 90 V(MESSAGE_GET_COLUMN_NUMBER_INDEX, JSFunction, message_get_column_number) \ |
| 91 V(MESSAGE_GET_LINE_NUMBER_INDEX, JSFunction, message_get_line_number) \ |
| 92 V(MESSAGE_GET_SOURCE_LINE_INDEX, JSFunction, message_get_source_line) \ |
| 93 V(NATIVE_OBJECT_GET_NOTIFIER_INDEX, JSFunction, native_object_get_notifier) \ |
| 94 V(NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, JSFunction, \ |
| 95 native_object_notifier_perform_change) \ |
| 96 V(NATIVE_OBJECT_OBSERVE_INDEX, JSFunction, native_object_observe) \ |
| 97 V(NO_SIDE_EFFECT_TO_STRING_FUN_INDEX, JSFunction, \ |
| 98 no_side_effect_to_string_fun) \ |
| 99 V(OBJECT_DEFINE_OWN_PROPERTY_INDEX, JSFunction, object_define_own_property) \ |
| 100 V(OBJECT_GET_OWN_PROPERTY_DESCROPTOR_INDEX, JSFunction, \ |
| 101 object_get_own_property_descriptor) \ |
| 102 V(OBSERVERS_BEGIN_SPLICE_INDEX, JSFunction, observers_begin_perform_splice) \ |
| 103 V(OBSERVERS_END_SPLICE_INDEX, JSFunction, observers_end_perform_splice) \ |
| 104 V(OBSERVERS_ENQUEUE_SPLICE_INDEX, JSFunction, observers_enqueue_splice) \ |
| 105 V(OBSERVERS_NOTIFY_CHANGE_INDEX, JSFunction, observers_notify_change) \ |
| 106 V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \ |
| 107 V(PROMISE_CHAIN_INDEX, JSFunction, promise_chain) \ |
| 108 V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \ |
| 109 V(PROMISE_HAS_USER_DEFINED_REJECT_HANDLER_INDEX, JSFunction, \ |
| 110 promise_has_user_defined_reject_handler) \ |
| 111 V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \ |
| 112 V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \ |
| 113 V(PROMISE_THEN_INDEX, JSFunction, promise_then) \ |
| 114 V(RANGE_ERROR_FUNCTION_INDEX, JSFunction, range_error_function) \ |
| 115 V(REFERENCE_ERROR_FUNCTION_INDEX, JSFunction, reference_error_function) \ |
| 116 V(SET_ADD_METHOD_INDEX, JSFunction, set_add) \ |
| 117 V(SET_DELETE_METHOD_INDEX, JSFunction, set_delete) \ |
| 118 V(SET_FROM_ARRAY_INDEX, JSFunction, set_from_array) \ |
| 119 V(SET_HAS_METHOD_INDEX, JSFunction, set_has) \ |
| 120 V(STACK_OVERFLOW_BOILERPLATE_INDEX, JSObject, stack_overflow_boilerplate) \ |
| 121 V(SYNTAX_ERROR_FUNCTION_INDEX, JSFunction, syntax_error_function) \ |
| 122 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \ |
| 123 to_complete_property_descriptor) \ |
| 124 V(TO_DETAIL_STRING_FUN_INDEX, JSFunction, to_detail_string_fun) \ |
| 125 V(TO_INTEGER_FUN_INDEX, JSFunction, to_integer_fun) \ |
| 126 V(TO_LENGTH_FUN_INDEX, JSFunction, to_length_fun) \ |
| 127 V(TO_NUMBER_FUN_INDEX, JSFunction, to_number_fun) \ |
| 128 V(TO_STRING_FUN_INDEX, JSFunction, to_string_fun) \ |
| 129 V(TYPE_ERROR_FUNCTION_INDEX, JSFunction, type_error_function) \ |
| 130 V(URI_ERROR_FUNCTION_INDEX, JSFunction, uri_error_function) |
| 131 |
| 132 #define NATIVE_CONTEXT_IMPORTED_FIELDS_FOR_PROXY(V) \ |
| 133 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ |
| 134 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \ |
| 135 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \ |
| 136 V(PROXY_ENUMERATE_INDEX, JSFunction, proxy_enumerate) |
| 137 |
76 #define NATIVE_CONTEXT_FIELDS(V) \ | 138 #define NATIVE_CONTEXT_FIELDS(V) \ |
77 V(GLOBAL_PROXY_INDEX, JSObject, global_proxy_object) \ | 139 V(GLOBAL_PROXY_INDEX, JSObject, global_proxy_object) \ |
| 140 V(EMBEDDER_DATA_INDEX, FixedArray, embedder_data) \ |
| 141 /* Below is alpha-sorted */ \ |
| 142 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ |
| 143 V(ARRAY_BUFFER_FUN_INDEX, JSFunction, array_buffer_fun) \ |
| 144 V(ARRAY_BUFFER_MAP_INDEX, Map, array_buffer_map) \ |
| 145 V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \ |
| 146 V(BOOL16X8_FUNCTION_INDEX, JSFunction, bool16x8_function) \ |
| 147 V(BOOL32X4_FUNCTION_INDEX, JSFunction, bool32x4_function) \ |
| 148 V(BOOL8X16_FUNCTION_INDEX, JSFunction, bool8x16_function) \ |
| 149 V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function) \ |
| 150 V(BOUND_FUNCTION_MAP_INDEX, Map, bound_function_map) \ |
| 151 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ |
| 152 call_as_constructor_delegate) \ |
| 153 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ |
| 154 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ |
| 155 V(DATA_VIEW_FUN_INDEX, JSFunction, data_view_fun) \ |
| 156 V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \ |
| 157 error_message_for_code_gen_from_strings) \ |
| 158 V(EXTRAS_EXPORTS_OBJECT_INDEX, JSObject, extras_binding_object) \ |
| 159 V(FAST_ALIASED_ARGUMENTS_MAP_INDEX, Map, fast_aliased_arguments_map) \ |
| 160 V(FLOAT32_ARRAY_FUN_INDEX, JSFunction, float32_array_fun) \ |
| 161 V(FLOAT32X4_FUNCTION_INDEX, JSFunction, float32x4_function) \ |
| 162 V(FLOAT64_ARRAY_FUN_INDEX, JSFunction, float64_array_fun) \ |
| 163 V(FUNCTION_CACHE_INDEX, ObjectHashTable, function_cache) \ |
| 164 V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, generator_object_prototype_map) \ |
| 165 V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \ |
| 166 V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \ |
| 167 V(INT16_ARRAY_FUN_INDEX, JSFunction, int16_array_fun) \ |
| 168 V(INT16X8_FUNCTION_INDEX, JSFunction, int16x8_function) \ |
| 169 V(INT32_ARRAY_FUN_INDEX, JSFunction, int32_array_fun) \ |
| 170 V(INT32X4_FUNCTION_INDEX, JSFunction, int32x4_function) \ |
| 171 V(INT8_ARRAY_FUN_INDEX, JSFunction, int8_array_fun) \ |
| 172 V(INT8X16_FUNCTION_INDEX, JSFunction, int8x16_function) \ |
| 173 V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \ |
| 174 V(ITERATOR_RESULT_MAP_INDEX, Map, iterator_result_map) \ |
| 175 V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \ |
| 176 V(JS_ARRAY_STRONG_MAPS_INDEX, Object, js_array_strong_maps) \ |
| 177 V(JS_MAP_FUN_INDEX, JSFunction, js_map_fun) \ |
| 178 V(JS_MAP_MAP_INDEX, Map, js_map_map) \ |
| 179 V(JS_OBJECT_STRONG_MAP_INDEX, Map, js_object_strong_map) \ |
| 180 V(JS_SET_FUN_INDEX, JSFunction, js_set_fun) \ |
| 181 V(JS_SET_MAP_INDEX, Map, js_set_map) \ |
| 182 V(MAP_CACHE_INDEX, Object, map_cache) \ |
| 183 V(MAP_ITERATOR_MAP_INDEX, Map, map_iterator_map) \ |
| 184 V(MESSAGE_LISTENERS_INDEX, JSObject, message_listeners) \ |
| 185 V(NATIVES_UTILS_OBJECT_INDEX, Object, natives_utils_object) \ |
| 186 V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \ |
| 187 V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \ |
| 188 V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \ |
| 189 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ |
| 190 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \ |
| 191 V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map) \ |
| 192 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \ |
| 193 V(SCRIPT_CONTEXT_TABLE_INDEX, ScriptContextTable, script_context_table) \ |
| 194 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ |
78 V(SECURITY_TOKEN_INDEX, Object, security_token) \ | 195 V(SECURITY_TOKEN_INDEX, Object, security_token) \ |
79 V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function) \ | 196 V(SET_ITERATOR_MAP_INDEX, Map, set_iterator_map) \ |
80 V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \ | 197 V(SHARED_ARRAY_BUFFER_FUN_INDEX, JSFunction, shared_array_buffer_fun) \ |
| 198 V(SLOPPY_ARGUMENTS_MAP_INDEX, Map, sloppy_arguments_map) \ |
| 199 V(SLOPPY_FUNCTION_MAP_INDEX, Map, sloppy_function_map) \ |
| 200 V(SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \ |
| 201 sloppy_function_without_prototype_map) \ |
| 202 V(SLOPPY_FUNCTION_WITH_READONLY_PROTOTYPE_MAP_INDEX, Map, \ |
| 203 sloppy_function_with_readonly_prototype_map) \ |
| 204 V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \ |
| 205 V(SLOW_ALIASED_ARGUMENTS_MAP_INDEX, Map, slow_aliased_arguments_map) \ |
| 206 V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \ |
| 207 V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \ |
| 208 V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \ |
| 209 strict_function_without_prototype_map) \ |
| 210 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \ |
81 V(STRING_FUNCTION_INDEX, JSFunction, string_function) \ | 211 V(STRING_FUNCTION_INDEX, JSFunction, string_function) \ |
82 V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \ | 212 V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \ |
| 213 V(STRONG_CONSTRUCTOR_MAP_INDEX, Map, strong_constructor_map) \ |
| 214 V(STRONG_FUNCTION_MAP_INDEX, Map, strong_function_map) \ |
| 215 V(STRONG_GENERATOR_FUNCTION_MAP_INDEX, Map, strong_generator_function_map) \ |
| 216 V(STRONG_MAP_CACHE_INDEX, Object, strong_map_cache) \ |
83 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \ | 217 V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \ |
84 V(FLOAT32X4_FUNCTION_INDEX, JSFunction, float32x4_function) \ | 218 V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \ |
85 V(INT32X4_FUNCTION_INDEX, JSFunction, int32x4_function) \ | 219 V(UINT32_ARRAY_FUN_INDEX, JSFunction, uint32_array_fun) \ |
86 V(BOOL32X4_FUNCTION_INDEX, JSFunction, bool32x4_function) \ | |
87 V(INT16X8_FUNCTION_INDEX, JSFunction, int16x8_function) \ | |
88 V(BOOL16X8_FUNCTION_INDEX, JSFunction, bool16x8_function) \ | |
89 V(INT8X16_FUNCTION_INDEX, JSFunction, int8x16_function) \ | |
90 V(BOOL8X16_FUNCTION_INDEX, JSFunction, bool8x16_function) \ | |
91 V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \ | |
92 V(JS_OBJECT_STRONG_MAP_INDEX, Map, js_object_strong_map) \ | |
93 V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \ | |
94 V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \ | |
95 V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \ | |
96 V(JS_ARRAY_STRONG_MAPS_INDEX, Object, js_array_strong_maps) \ | |
97 V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \ | |
98 V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \ | |
99 V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \ | |
100 V(EMBEDDER_DATA_INDEX, FixedArray, embedder_data) \ | |
101 V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \ | |
102 V(TO_NUMBER_FUN_INDEX, JSFunction, to_number_fun) \ | |
103 V(TO_STRING_FUN_INDEX, JSFunction, to_string_fun) \ | |
104 V(TO_DETAIL_STRING_FUN_INDEX, JSFunction, to_detail_string_fun) \ | |
105 V(NO_SIDE_EFFECT_TO_STRING_FUN_INDEX, JSFunction, \ | |
106 no_side_effect_to_string_fun) \ | |
107 V(TO_INTEGER_FUN_INDEX, JSFunction, to_integer_fun) \ | |
108 V(TO_LENGTH_FUN_INDEX, JSFunction, to_length_fun) \ | |
109 V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \ | |
110 V(ARRAY_BUFFER_FUN_INDEX, JSFunction, array_buffer_fun) \ | |
111 V(SHARED_ARRAY_BUFFER_FUN_INDEX, JSFunction, shared_array_buffer_fun) \ | |
112 V(ARRAY_BUFFER_MAP_INDEX, Map, array_buffer_map) \ | |
113 V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \ | 220 V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \ |
114 V(INT8_ARRAY_FUN_INDEX, JSFunction, int8_array_fun) \ | |
115 V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \ | |
116 V(INT16_ARRAY_FUN_INDEX, JSFunction, int16_array_fun) \ | |
117 V(UINT32_ARRAY_FUN_INDEX, JSFunction, uint32_array_fun) \ | |
118 V(INT32_ARRAY_FUN_INDEX, JSFunction, int32_array_fun) \ | |
119 V(FLOAT32_ARRAY_FUN_INDEX, JSFunction, float32_array_fun) \ | |
120 V(FLOAT64_ARRAY_FUN_INDEX, JSFunction, float64_array_fun) \ | |
121 V(UINT8_CLAMPED_ARRAY_FUN_INDEX, JSFunction, uint8_clamped_array_fun) \ | 221 V(UINT8_CLAMPED_ARRAY_FUN_INDEX, JSFunction, uint8_clamped_array_fun) \ |
122 V(DATA_VIEW_FUN_INDEX, JSFunction, data_view_fun) \ | 222 NATIVE_CONTEXT_IMPORTED_FIELDS(V) \ |
123 V(SLOPPY_FUNCTION_MAP_INDEX, Map, sloppy_function_map) \ | 223 NATIVE_CONTEXT_IMPORTED_FIELDS_FOR_PROXY(V) |
124 V(SLOPPY_FUNCTION_WITH_READONLY_PROTOTYPE_MAP_INDEX, Map, \ | |
125 sloppy_function_with_readonly_prototype_map) \ | |
126 V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \ | |
127 V(STRONG_FUNCTION_MAP_INDEX, Map, strong_function_map) \ | |
128 V(SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \ | |
129 sloppy_function_without_prototype_map) \ | |
130 V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \ | |
131 strict_function_without_prototype_map) \ | |
132 V(STRONG_CONSTRUCTOR_MAP_INDEX, Map, strong_constructor_map) \ | |
133 V(BOUND_FUNCTION_MAP_INDEX, Map, bound_function_map) \ | |
134 V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map) \ | |
135 V(SLOPPY_ARGUMENTS_MAP_INDEX, Map, sloppy_arguments_map) \ | |
136 V(FAST_ALIASED_ARGUMENTS_MAP_INDEX, Map, fast_aliased_arguments_map) \ | |
137 V(SLOW_ALIASED_ARGUMENTS_MAP_INDEX, Map, slow_aliased_arguments_map) \ | |
138 V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \ | |
139 V(MESSAGE_LISTENERS_INDEX, JSObject, message_listeners) \ | |
140 V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \ | |
141 V(FUNCTION_CACHE_INDEX, ObjectHashTable, function_cache) \ | |
142 V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \ | |
143 V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \ | |
144 V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \ | |
145 V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \ | |
146 call_as_constructor_delegate) \ | |
147 V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \ | |
148 V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \ | |
149 V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \ | |
150 V(MAP_CACHE_INDEX, Object, map_cache) \ | |
151 V(STRONG_MAP_CACHE_INDEX, Object, strong_map_cache) \ | |
152 V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ | |
153 V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \ | |
154 error_message_for_code_gen_from_strings) \ | |
155 V(ERROR_FUNCTION_INDEX, JSFunction, error_function) \ | |
156 V(EVAL_ERROR_FUNCTION_INDEX, JSFunction, eval_error_function) \ | |
157 V(RANGE_ERROR_FUNCTION_INDEX, JSFunction, range_error_function) \ | |
158 V(REFERENCE_ERROR_FUNCTION_INDEX, JSFunction, reference_error_function) \ | |
159 V(SYNTAX_ERROR_FUNCTION_INDEX, JSFunction, syntax_error_function) \ | |
160 V(TYPE_ERROR_FUNCTION_INDEX, JSFunction, type_error_function) \ | |
161 V(URI_ERROR_FUNCTION_INDEX, JSFunction, uri_error_function) \ | |
162 V(MAKE_ERROR_FUNCTION_INDEX, JSFunction, make_error_function) \ | |
163 V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \ | |
164 V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \ | |
165 V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \ | |
166 V(PROMISE_CHAIN_INDEX, JSFunction, promise_chain) \ | |
167 V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \ | |
168 V(PROMISE_THEN_INDEX, JSFunction, promise_then) \ | |
169 V(PROMISE_HAS_USER_DEFINED_REJECT_HANDLER_INDEX, JSFunction, \ | |
170 promise_has_user_defined_reject_handler) \ | |
171 V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \ | |
172 to_complete_property_descriptor) \ | |
173 V(OBJECT_DEFINE_OWN_PROPERTY_INDEX, JSFunction, object_define_own_property) \ | |
174 V(OBJECT_GET_OWN_PROPERTY_DESCROPTOR_INDEX, JSFunction, \ | |
175 object_get_own_property_descriptor) \ | |
176 V(MESSAGE_GET_LINE_NUMBER_INDEX, JSFunction, message_get_line_number) \ | |
177 V(MESSAGE_GET_COLUMN_NUMBER_INDEX, JSFunction, message_get_column_number) \ | |
178 V(MESSAGE_GET_SOURCE_LINE_INDEX, JSFunction, message_get_source_line) \ | |
179 V(STACK_OVERFLOW_BOILERPLATE_INDEX, JSObject, stack_overflow_boilerplate) \ | |
180 V(JSON_SERIALIZE_ADAPTER_INDEX, JSFunction, json_serialize_adapter) \ | |
181 V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \ | |
182 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ | |
183 V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \ | |
184 V(PROXY_ENUMERATE_INDEX, JSFunction, proxy_enumerate) \ | |
185 V(OBSERVERS_NOTIFY_CHANGE_INDEX, JSFunction, observers_notify_change) \ | |
186 V(OBSERVERS_ENQUEUE_SPLICE_INDEX, JSFunction, observers_enqueue_splice) \ | |
187 V(OBSERVERS_BEGIN_SPLICE_INDEX, JSFunction, observers_begin_perform_splice) \ | |
188 V(OBSERVERS_END_SPLICE_INDEX, JSFunction, observers_end_perform_splice) \ | |
189 V(NATIVE_OBJECT_OBSERVE_INDEX, JSFunction, native_object_observe) \ | |
190 V(NATIVE_OBJECT_GET_NOTIFIER_INDEX, JSFunction, native_object_get_notifier) \ | |
191 V(NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, JSFunction, \ | |
192 native_object_notifier_perform_change) \ | |
193 V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \ | |
194 V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \ | |
195 V(STRONG_GENERATOR_FUNCTION_MAP_INDEX, Map, strong_generator_function_map) \ | |
196 V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, generator_object_prototype_map) \ | |
197 V(ITERATOR_RESULT_MAP_INDEX, Map, iterator_result_map) \ | |
198 V(JS_MAP_FUN_INDEX, JSFunction, js_map_fun) \ | |
199 V(JS_MAP_MAP_INDEX, Map, js_map_map) \ | |
200 V(JS_SET_FUN_INDEX, JSFunction, js_set_fun) \ | |
201 V(JS_SET_MAP_INDEX, Map, js_set_map) \ | |
202 V(MAP_GET_METHOD_INDEX, JSFunction, map_get) \ | |
203 V(MAP_SET_METHOD_INDEX, JSFunction, map_set) \ | |
204 V(MAP_HAS_METHOD_INDEX, JSFunction, map_has) \ | |
205 V(MAP_DELETE_METHOD_INDEX, JSFunction, map_delete) \ | |
206 V(SET_ADD_METHOD_INDEX, JSFunction, set_add) \ | |
207 V(SET_HAS_METHOD_INDEX, JSFunction, set_has) \ | |
208 V(SET_DELETE_METHOD_INDEX, JSFunction, set_delete) \ | |
209 V(MAP_FROM_ARRAY_INDEX, JSFunction, map_from_array) \ | |
210 V(SET_FROM_ARRAY_INDEX, JSFunction, set_from_array) \ | |
211 V(MAP_ITERATOR_MAP_INDEX, Map, map_iterator_map) \ | |
212 V(SET_ITERATOR_MAP_INDEX, Map, set_iterator_map) \ | |
213 V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) \ | |
214 V(SCRIPT_CONTEXT_TABLE_INDEX, ScriptContextTable, script_context_table) \ | |
215 V(NATIVES_UTILS_OBJECT_INDEX, Object, natives_utils_object) \ | |
216 V(EXTRAS_EXPORTS_OBJECT_INDEX, JSObject, extras_binding_object) | |
217 | |
218 | 224 |
219 // A table of all script contexts. Every loaded top-level script with top-level | 225 // A table of all script contexts. Every loaded top-level script with top-level |
220 // lexical declarations contributes its ScriptContext into this table. | 226 // lexical declarations contributes its ScriptContext into this table. |
221 // | 227 // |
222 // The table is a fixed array, its first slot is the current used count and | 228 // The table is a fixed array, its first slot is the current used count and |
223 // the subsequent slots 1..used contain ScriptContexts. | 229 // the subsequent slots 1..used contain ScriptContexts. |
224 class ScriptContextTable : public FixedArray { | 230 class ScriptContextTable : public FixedArray { |
225 public: | 231 public: |
226 // Conversions. | 232 // Conversions. |
227 static ScriptContextTable* cast(Object* context) { | 233 static ScriptContextTable* cast(Object* context) { |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); | 563 static bool IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object); |
558 #endif | 564 #endif |
559 | 565 |
560 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 566 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
561 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 567 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
562 }; | 568 }; |
563 | 569 |
564 } } // namespace v8::internal | 570 } } // namespace v8::internal |
565 | 571 |
566 #endif // V8_CONTEXTS_H_ | 572 #endif // V8_CONTEXTS_H_ |
OLD | NEW |