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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 V(REFLECT_CONSTRUCT_INDEX, JSFunction, reflect_construct) \ | 56 V(REFLECT_CONSTRUCT_INDEX, JSFunction, reflect_construct) \ |
57 V(REFLECT_DEFINE_PROPERTY_INDEX, JSFunction, reflect_define_property) \ | 57 V(REFLECT_DEFINE_PROPERTY_INDEX, JSFunction, reflect_define_property) \ |
58 V(REFLECT_DELETE_PROPERTY_INDEX, JSFunction, reflect_delete_property) \ | 58 V(REFLECT_DELETE_PROPERTY_INDEX, JSFunction, reflect_delete_property) \ |
59 V(SPREAD_ARGUMENTS_INDEX, JSFunction, spread_arguments) \ | 59 V(SPREAD_ARGUMENTS_INDEX, JSFunction, spread_arguments) \ |
60 V(SPREAD_ITERABLE_INDEX, JSFunction, spread_iterable) \ | 60 V(SPREAD_ITERABLE_INDEX, JSFunction, spread_iterable) \ |
61 V(MATH_FLOOR_INDEX, JSFunction, math_floor) \ | 61 V(MATH_FLOOR_INDEX, JSFunction, math_floor) \ |
62 V(MATH_POW_INDEX, JSFunction, math_pow) \ | 62 V(MATH_POW_INDEX, JSFunction, math_pow) \ |
63 V(CREATE_RESOLVING_FUNCTION_INDEX, JSFunction, create_resolving_functions) \ | 63 V(CREATE_RESOLVING_FUNCTION_INDEX, JSFunction, create_resolving_functions) \ |
64 V(PROMISE_INTERNAL_CONSTRUCTOR_INDEX, JSFunction, \ | 64 V(PROMISE_INTERNAL_CONSTRUCTOR_INDEX, JSFunction, \ |
65 promise_internal_constructor) \ | 65 promise_internal_constructor) \ |
66 V(IS_PROMISE_INDEX, JSFunction, is_promise) | 66 V(IS_PROMISE_INDEX, JSFunction, is_promise) \ |
| 67 V(PERFORM_PROMISE_THEN_INDEX, JSFunction, perform_promise_then) \ |
| 68 V(PROMISE_CREATE_AND_SET_INDEX, JSFunction, promise_create_and_set) |
67 | 69 |
68 #define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \ | 70 #define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \ |
69 V(ARRAY_CONCAT_INDEX, JSFunction, array_concat) \ | 71 V(ARRAY_CONCAT_INDEX, JSFunction, array_concat) \ |
70 V(ARRAY_POP_INDEX, JSFunction, array_pop) \ | 72 V(ARRAY_POP_INDEX, JSFunction, array_pop) \ |
71 V(ARRAY_PUSH_INDEX, JSFunction, array_push) \ | 73 V(ARRAY_PUSH_INDEX, JSFunction, array_push) \ |
72 V(ARRAY_SHIFT_INDEX, JSFunction, array_shift) \ | 74 V(ARRAY_SHIFT_INDEX, JSFunction, array_shift) \ |
73 V(ARRAY_SPLICE_INDEX, JSFunction, array_splice) \ | 75 V(ARRAY_SPLICE_INDEX, JSFunction, array_splice) \ |
74 V(ARRAY_SLICE_INDEX, JSFunction, array_slice) \ | 76 V(ARRAY_SLICE_INDEX, JSFunction, array_slice) \ |
75 V(ARRAY_UNSHIFT_INDEX, JSFunction, array_unshift) \ | 77 V(ARRAY_UNSHIFT_INDEX, JSFunction, array_unshift) \ |
76 V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) \ | 78 V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) \ |
77 V(ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX, JSFunction, \ | 79 V(ASYNC_FUNCTION_AWAIT_CAUGHT_INDEX, JSFunction, \ |
78 async_function_await_caught) \ | 80 async_function_await_caught) \ |
79 V(ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX, JSFunction, \ | 81 V(ASYNC_FUNCTION_AWAIT_UNCAUGHT_INDEX, JSFunction, \ |
80 async_function_await_uncaught) \ | 82 async_function_await_uncaught) \ |
81 V(ASYNC_FUNCTION_PROMISE_CREATE_INDEX, JSFunction, \ | 83 V(ASYNC_FUNCTION_PROMISE_CREATE_INDEX, JSFunction, \ |
82 async_function_promise_create) \ | 84 async_function_promise_create) \ |
83 V(ASYNC_FUNCTION_PROMISE_RELEASE_INDEX, JSFunction, \ | 85 V(ASYNC_FUNCTION_PROMISE_RELEASE_INDEX, JSFunction, \ |
84 async_function_promise_release) \ | 86 async_function_promise_release) \ |
85 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ | 87 V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \ |
86 V(ERROR_FUNCTION_INDEX, JSFunction, error_function) \ | 88 V(ERROR_FUNCTION_INDEX, JSFunction, error_function) \ |
87 V(ERROR_TO_STRING, JSFunction, error_to_string) \ | 89 V(ERROR_TO_STRING, JSFunction, error_to_string) \ |
88 V(EVAL_ERROR_FUNCTION_INDEX, JSFunction, eval_error_function) \ | 90 V(EVAL_ERROR_FUNCTION_INDEX, JSFunction, eval_error_function) \ |
89 V(FUNCTION_HAS_INSTANCE_INDEX, JSFunction, function_has_instance) \ | 91 V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \ |
90 V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \ | 92 V(MAP_DELETE_METHOD_INDEX, JSFunction, map_delete) \ |
91 V(MAP_DELETE_METHOD_INDEX, JSFunction, map_delete) \ | 93 V(MAP_GET_METHOD_INDEX, JSFunction, map_get) \ |
92 V(MAP_GET_METHOD_INDEX, JSFunction, map_get) \ | 94 V(MAP_HAS_METHOD_INDEX, JSFunction, map_has) \ |
93 V(MAP_HAS_METHOD_INDEX, JSFunction, map_has) \ | 95 V(MAP_SET_METHOD_INDEX, JSFunction, map_set) \ |
94 V(MAP_SET_METHOD_INDEX, JSFunction, map_set) \ | 96 V(FUNCTION_HAS_INSTANCE_INDEX, JSFunction, function_has_instance) \ |
95 V(OBJECT_VALUE_OF, JSFunction, object_value_of) \ | 97 V(OBJECT_VALUE_OF, JSFunction, object_value_of) \ |
96 V(OBJECT_TO_STRING, JSFunction, object_to_string) \ | 98 V(OBJECT_TO_STRING, JSFunction, object_to_string) \ |
97 V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \ | 99 V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \ |
98 V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \ | 100 V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \ |
99 V(PROMISE_FUNCTION_INDEX, JSFunction, promise_function) \ | 101 V(PROMISE_FUNCTION_INDEX, JSFunction, promise_function) \ |
100 V(PROMISE_HANDLE_INDEX, JSFunction, promise_handle) \ | 102 V(PROMISE_HANDLE_INDEX, JSFunction, promise_handle) \ |
101 V(PROMISE_HAS_USER_DEFINED_REJECT_HANDLER_INDEX, JSFunction, \ | 103 V(PROMISE_HAS_USER_DEFINED_REJECT_HANDLER_INDEX, JSFunction, \ |
102 promise_has_user_defined_reject_handler) \ | 104 promise_has_user_defined_reject_handler) \ |
103 V(PROMISE_DEBUG_GET_INFO_INDEX, JSFunction, promise_debug_get_info) \ | 105 V(PROMISE_DEBUG_GET_INFO_INDEX, JSFunction, promise_debug_get_info) \ |
104 V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \ | 106 V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \ |
105 V(PROMISE_INTERNAL_REJECT_INDEX, JSFunction, promise_internal_reject) \ | 107 V(PROMISE_INTERNAL_REJECT_INDEX, JSFunction, promise_internal_reject) \ |
106 V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \ | 108 V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \ |
107 V(PROMISE_THEN_INDEX, JSFunction, promise_then) \ | 109 V(PROMISE_ID_RESOLVE_HANDLER_INDEX, JSFunction, promise_id_resolve_handler) \ |
108 V(RANGE_ERROR_FUNCTION_INDEX, JSFunction, range_error_function) \ | 110 V(PROMISE_ID_REJECT_HANDLER_INDEX, JSFunction, promise_id_reject_handler) \ |
109 V(REJECT_PROMISE_NO_DEBUG_EVENT_INDEX, JSFunction, \ | 111 V(PROMISE_THEN_INDEX, JSFunction, promise_then) \ |
110 reject_promise_no_debug_event) \ | 112 V(NEW_PROMISE_CAPABILITY_INDEX, JSFunction, new_promise_capability) \ |
111 V(REFERENCE_ERROR_FUNCTION_INDEX, JSFunction, reference_error_function) \ | 113 V(INTERNAL_PROMISE_CAPABILITY_INDEX, JSFunction, \ |
112 V(SET_ADD_METHOD_INDEX, JSFunction, set_add) \ | 114 internal_promise_capability) \ |
113 V(SET_DELETE_METHOD_INDEX, JSFunction, set_delete) \ | 115 V(RANGE_ERROR_FUNCTION_INDEX, JSFunction, range_error_function) \ |
114 V(SET_HAS_METHOD_INDEX, JSFunction, set_has) \ | 116 V(REJECT_PROMISE_NO_DEBUG_EVENT_INDEX, JSFunction, \ |
115 V(SYNTAX_ERROR_FUNCTION_INDEX, JSFunction, syntax_error_function) \ | 117 reject_promise_no_debug_event) \ |
116 V(TYPE_ERROR_FUNCTION_INDEX, JSFunction, type_error_function) \ | 118 V(REFERENCE_ERROR_FUNCTION_INDEX, JSFunction, reference_error_function) \ |
117 V(URI_ERROR_FUNCTION_INDEX, JSFunction, uri_error_function) \ | 119 V(SET_ADD_METHOD_INDEX, JSFunction, set_add) \ |
118 V(WASM_COMPILE_ERROR_FUNCTION_INDEX, JSFunction, \ | 120 V(SET_DELETE_METHOD_INDEX, JSFunction, set_delete) \ |
119 wasm_compile_error_function) \ | 121 V(SET_HAS_METHOD_INDEX, JSFunction, set_has) \ |
| 122 V(SYNTAX_ERROR_FUNCTION_INDEX, JSFunction, syntax_error_function) \ |
| 123 V(TYPE_ERROR_FUNCTION_INDEX, JSFunction, type_error_function) \ |
| 124 V(URI_ERROR_FUNCTION_INDEX, JSFunction, uri_error_function) \ |
| 125 V(WASM_COMPILE_ERROR_FUNCTION_INDEX, JSFunction, \ |
| 126 wasm_compile_error_function) \ |
120 V(WASM_RUNTIME_ERROR_FUNCTION_INDEX, JSFunction, wasm_runtime_error_function) | 127 V(WASM_RUNTIME_ERROR_FUNCTION_INDEX, JSFunction, wasm_runtime_error_function) |
121 | 128 |
122 #define NATIVE_CONTEXT_JS_ARRAY_ITERATOR_MAPS(V) \ | 129 #define NATIVE_CONTEXT_JS_ARRAY_ITERATOR_MAPS(V) \ |
123 V(FAST_ARRAY_KEY_ITERATOR_MAP_INDEX, Map, fast_array_key_iterator_map) \ | 130 V(FAST_ARRAY_KEY_ITERATOR_MAP_INDEX, Map, fast_array_key_iterator_map) \ |
124 V(GENERIC_ARRAY_KEY_ITERATOR_MAP_INDEX, Map, array_key_iterator_map) \ | 131 V(GENERIC_ARRAY_KEY_ITERATOR_MAP_INDEX, Map, array_key_iterator_map) \ |
125 V(TYPED_ARRAY_KEY_ITERATOR_MAP_INDEX, Map, typed_array_key_iterator_map) \ | 132 V(TYPED_ARRAY_KEY_ITERATOR_MAP_INDEX, Map, typed_array_key_iterator_map) \ |
126 \ | 133 \ |
127 V(UINT8_ARRAY_KEY_VALUE_ITERATOR_MAP_INDEX, Map, \ | 134 V(UINT8_ARRAY_KEY_VALUE_ITERATOR_MAP_INDEX, Map, \ |
128 uint8_array_key_value_iterator_map) \ | 135 uint8_array_key_value_iterator_map) \ |
129 V(INT8_ARRAY_KEY_VALUE_ITERATOR_MAP_INDEX, Map, \ | 136 V(INT8_ARRAY_KEY_VALUE_ITERATOR_MAP_INDEX, Map, \ |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 664 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
658 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 665 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
659 }; | 666 }; |
660 | 667 |
661 typedef Context::Field ContextField; | 668 typedef Context::Field ContextField; |
662 | 669 |
663 } // namespace internal | 670 } // namespace internal |
664 } // namespace v8 | 671 } // namespace v8 |
665 | 672 |
666 #endif // V8_CONTEXTS_H_ | 673 #endif // V8_CONTEXTS_H_ |
OLD | NEW |