Index: src/contexts.h |
diff --git a/src/contexts.h b/src/contexts.h |
index 96b76bf315f0bdd35bf3ffb067b86dc06249dd03..6283b0f6d6b72187daa4f959779a28cc487f9e25 100644 |
--- a/src/contexts.h |
+++ b/src/contexts.h |
@@ -34,43 +34,48 @@ enum ContextLookupFlags { |
// must always be allocated via Heap::AllocateContext() or |
// Factory::NewContext. |
-#define NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \ |
- V(IS_ARRAYLIKE, JSFunction, is_arraylike) \ |
- V(GENERATOR_NEXT_INTERNAL, JSFunction, generator_next_internal) \ |
- V(GET_TEMPLATE_CALL_SITE_INDEX, JSFunction, get_template_call_site) \ |
- 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(OBJECT_DEFINE_PROPERTIES, JSFunction, object_define_properties) \ |
- V(OBJECT_DEFINE_PROPERTY, JSFunction, object_define_property) \ |
- V(OBJECT_FREEZE, JSFunction, object_freeze) \ |
- V(OBJECT_GET_PROTOTYPE_OF, JSFunction, object_get_prototype_of) \ |
- V(OBJECT_IS_EXTENSIBLE, JSFunction, object_is_extensible) \ |
- V(OBJECT_IS_FROZEN, JSFunction, object_is_frozen) \ |
- V(OBJECT_IS_SEALED, JSFunction, object_is_sealed) \ |
- V(OBJECT_KEYS, JSFunction, object_keys) \ |
- V(REGEXP_INTERNAL_MATCH, JSFunction, regexp_internal_match) \ |
- V(REFLECT_APPLY_INDEX, JSFunction, reflect_apply) \ |
- V(REFLECT_CONSTRUCT_INDEX, JSFunction, reflect_construct) \ |
- V(REFLECT_DEFINE_PROPERTY_INDEX, JSFunction, reflect_define_property) \ |
- V(REFLECT_DELETE_PROPERTY_INDEX, JSFunction, reflect_delete_property) \ |
- V(SPREAD_ARGUMENTS_INDEX, JSFunction, spread_arguments) \ |
- V(SPREAD_ITERABLE_INDEX, JSFunction, spread_iterable) \ |
- V(MATH_FLOOR_INDEX, JSFunction, math_floor) \ |
- V(MATH_POW_INDEX, JSFunction, math_pow) \ |
- V(NEW_PROMISE_CAPABILITY_INDEX, JSFunction, new_promise_capability) \ |
- V(PROMISE_INTERNAL_CONSTRUCTOR_INDEX, JSFunction, \ |
- promise_internal_constructor) \ |
- V(IS_PROMISE_INDEX, JSFunction, is_promise) \ |
- V(PERFORM_PROMISE_THEN_INDEX, JSFunction, perform_promise_then) \ |
- V(PROMISE_CREATE_AND_SET_INDEX, JSFunction, promise_create_and_set) \ |
- V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \ |
- V(PROMISE_THEN_INDEX, JSFunction, promise_then) \ |
- V(PROMISE_HANDLE_INDEX, JSFunction, promise_handle) \ |
- V(PROMISE_HANDLE_REJECT_INDEX, JSFunction, promise_handle_reject) |
+#define NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \ |
+ V(IS_ARRAYLIKE, JSFunction, is_arraylike) \ |
+ V(GENERATOR_NEXT_INTERNAL, JSFunction, generator_next_internal) \ |
+ V(GET_TEMPLATE_CALL_SITE_INDEX, JSFunction, get_template_call_site) \ |
+ 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(OBJECT_DEFINE_PROPERTIES, JSFunction, object_define_properties) \ |
+ V(OBJECT_DEFINE_PROPERTY, JSFunction, object_define_property) \ |
+ V(OBJECT_FREEZE, JSFunction, object_freeze) \ |
+ V(OBJECT_GET_PROTOTYPE_OF, JSFunction, object_get_prototype_of) \ |
+ V(OBJECT_IS_EXTENSIBLE, JSFunction, object_is_extensible) \ |
+ V(OBJECT_IS_FROZEN, JSFunction, object_is_frozen) \ |
+ V(OBJECT_IS_SEALED, JSFunction, object_is_sealed) \ |
+ V(OBJECT_KEYS, JSFunction, object_keys) \ |
+ V(REGEXP_INTERNAL_MATCH, JSFunction, regexp_internal_match) \ |
+ V(REFLECT_APPLY_INDEX, JSFunction, reflect_apply) \ |
+ V(REFLECT_CONSTRUCT_INDEX, JSFunction, reflect_construct) \ |
+ V(REFLECT_DEFINE_PROPERTY_INDEX, JSFunction, reflect_define_property) \ |
+ V(REFLECT_DELETE_PROPERTY_INDEX, JSFunction, reflect_delete_property) \ |
+ V(SPREAD_ARGUMENTS_INDEX, JSFunction, spread_arguments) \ |
+ V(SPREAD_ITERABLE_INDEX, JSFunction, spread_iterable) \ |
+ V(MATH_FLOOR_INDEX, JSFunction, math_floor) \ |
+ V(MATH_POW_INDEX, JSFunction, math_pow) \ |
+ V(NEW_PROMISE_CAPABILITY_INDEX, JSFunction, new_promise_capability) \ |
+ V(PROMISE_INTERNAL_CONSTRUCTOR_INDEX, JSFunction, \ |
+ promise_internal_constructor) \ |
+ V(IS_PROMISE_INDEX, JSFunction, is_promise) \ |
+ V(PERFORM_PROMISE_THEN_INDEX, JSFunction, perform_promise_then) \ |
+ V(PROMISE_CREATE_AND_SET_INDEX, JSFunction, promise_create_and_set) \ |
+ V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \ |
+ V(PROMISE_THEN_INDEX, JSFunction, promise_then) \ |
+ V(PROMISE_HANDLE_INDEX, JSFunction, promise_handle) \ |
+ V(PROMISE_HANDLE_REJECT_INDEX, JSFunction, promise_handle_reject) \ |
+ V(ASYNC_GENERATOR_AWAIT_CAUGHT, JSFunction, async_generator_await_caught) \ |
+ V(ASYNC_GENERATOR_AWAIT_UNCAUGHT, JSFunction, \ |
+ async_generator_await_uncaught) \ |
+ V(ASYNC_GENERATOR_YIELD, JSFunction, async_generator_yield) \ |
+ V(ASYNC_GENERATOR_RAW_YIELD, JSFunction, async_generator_raw_yield) |
#define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \ |
V(ARRAY_CONCAT_INDEX, JSFunction, array_concat) \ |
@@ -197,10 +202,18 @@ enum ContextLookupFlags { |
V(ACCESSOR_PROPERTY_DESCRIPTOR_MAP_INDEX, Map, \ |
accessor_property_descriptor_map) \ |
V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \ |
+ 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_ITERATOR_VALUE_UNWRAP_SHARED_FUN, SharedFunctionInfo, \ |
+ async_iterator_value_unwrap_shared_fun) \ |
V(ARRAY_BUFFER_FUN_INDEX, JSFunction, array_buffer_fun) \ |
V(ARRAY_BUFFER_MAP_INDEX, Map, array_buffer_map) \ |
V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \ |
V(ASYNC_FUNCTION_FUNCTION_INDEX, JSFunction, async_function_constructor) \ |
+ V(ASYNC_GENERATOR_FUNCTION_FUNCTION_INDEX, JSFunction, \ |
+ async_generator_function_function) \ |
V(BOOL16X8_FUNCTION_INDEX, JSFunction, bool16x8_function) \ |
V(BOOL32X4_FUNCTION_INDEX, JSFunction, bool32x4_function) \ |
V(BOOL8X16_FUNCTION_INDEX, JSFunction, bool8x16_function) \ |
@@ -233,6 +246,8 @@ enum ContextLookupFlags { |
V(GENERATOR_FUNCTION_FUNCTION_INDEX, JSFunction, \ |
generator_function_function) \ |
V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, generator_object_prototype_map) \ |
+ V(ASYNC_GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, \ |
+ async_generator_object_prototype_map) \ |
V(INITIAL_ARRAY_ITERATOR_PROTOTYPE_INDEX, JSObject, \ |
initial_array_iterator_prototype) \ |
V(INITIAL_ARRAY_ITERATOR_PROTOTYPE_MAP_INDEX, Map, \ |
@@ -240,6 +255,8 @@ enum ContextLookupFlags { |
V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \ |
V(INITIAL_GENERATOR_PROTOTYPE_INDEX, JSObject, initial_generator_prototype) \ |
V(INITIAL_ITERATOR_PROTOTYPE_INDEX, JSObject, initial_iterator_prototype) \ |
+ V(INITIAL_ASYNC_FROM_SYNC_ITERATOR_MAP_INDEX, Map, \ |
+ initial_async_from_sync_iterator_map) \ |
V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \ |
V(INT16_ARRAY_FUN_INDEX, JSFunction, int16_array_fun) \ |
V(INT16X8_FUNCTION_INDEX, JSFunction, int16x8_function) \ |
@@ -320,6 +337,7 @@ enum ContextLookupFlags { |
V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \ |
strict_function_without_prototype_map) \ |
V(GENERATOR_FUNCTION_MAP_INDEX, Map, generator_function_map) \ |
+ V(ASYNC_GENERATOR_FUNCTION_MAP_INDEX, Map, async_generator_function_map) \ |
V(CLASS_FUNCTION_MAP_INDEX, Map, class_function_map) \ |
V(STRING_FUNCTION_INDEX, JSFunction, string_function) \ |
V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \ |
@@ -635,7 +653,8 @@ class Context: public FixedArray { |
static int FunctionMapIndex(LanguageMode language_mode, FunctionKind kind) { |
// Note: Must be kept in sync with the FastNewClosure builtin. |
if (IsGeneratorFunction(kind)) { |
- return GENERATOR_FUNCTION_MAP_INDEX; |
+ return IsAsyncFunction(kind) ? ASYNC_GENERATOR_FUNCTION_MAP_INDEX |
+ : GENERATOR_FUNCTION_MAP_INDEX; |
} |
if (IsAsyncFunction(kind)) { |