Commit 38d46c03 authored by yangguo's avatar yangguo Committed by Commit bot

Native context: alpha sort slots and remove boilerplate.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/1307963002

Cr-Commit-Position: refs/heads/master@{#30319}
parent cc97e524
......@@ -6948,7 +6948,7 @@ class Internals {
static const int kJSObjectHeaderSize = 3 * kApiPointerSize;
static const int kFixedArrayHeaderSize = 2 * kApiPointerSize;
static const int kContextHeaderSize = 2 * kApiPointerSize;
static const int kContextEmbedderDataIndex = 27;
static const int kContextEmbedderDataIndex = 5;
static const int kFullStringRepresentationMask = 0x07;
static const int kStringEncodingMask = 0x4;
static const int kExternalTwoByteRepresentationTag = 0x02;
......
......@@ -171,7 +171,7 @@ utils.Export(function(to) {
$arrayValues = ArrayValues;
utils.ExportToRuntime(function(to) {
to.ArrayValues = ArrayValues;
to["array_values_iterator"] = ArrayValues;
});
})
......@@ -263,9 +263,6 @@ class AstValue : public ZoneObject {
F(is_construct_call, "_IsConstructCall") \
F(is_spec_object, "_IsSpecObject") \
F(let, "let") \
F(make_reference_error, "MakeReferenceError") \
F(make_syntax_error, "MakeSyntaxError") \
F(make_type_error, "MakeTypeError") \
F(native, "native") \
F(new_target, ".new.target") \
F(next, "next") \
......
......@@ -1752,83 +1752,18 @@ void Genesis::InitializeBuiltinTypedArrays() {
}
#define INSTALL_NATIVE(Type, name, var) \
Handle<Object> var##_native = \
Object::GetProperty(isolate, container, name, STRICT).ToHandleChecked(); \
DCHECK(var##_native->Is##Type()); \
native_context->set_##var(Type::cast(*var##_native));
#define INSTALL_NATIVE(index, Type, name) \
Handle<Object> name##_native = \
Object::GetProperty(isolate, container, #name, STRICT) \
.ToHandleChecked(); \
DCHECK(name##_native->Is##Type()); \
native_context->set_##name(Type::cast(*name##_native));
void Bootstrapper::ImportNatives(Isolate* isolate, Handle<JSObject> container) {
HandleScope scope(isolate);
Handle<Context> native_context = isolate->native_context();
INSTALL_NATIVE(JSFunction, "CreateDate", create_date_fun);
INSTALL_NATIVE(JSFunction, "ToNumber", to_number_fun);
INSTALL_NATIVE(JSFunction, "ToString", to_string_fun);
INSTALL_NATIVE(JSFunction, "ToDetailString", to_detail_string_fun);
INSTALL_NATIVE(JSFunction, "NoSideEffectToString",
no_side_effect_to_string_fun);
INSTALL_NATIVE(JSFunction, "ToInteger", to_integer_fun);
INSTALL_NATIVE(JSFunction, "ToLength", to_length_fun);
INSTALL_NATIVE(JSFunction, "GlobalEval", global_eval_fun);
INSTALL_NATIVE(JSFunction, "GetStackTraceLine", get_stack_trace_line_fun);
INSTALL_NATIVE(JSFunction, "ToCompletePropertyDescriptor",
to_complete_property_descriptor);
INSTALL_NATIVE(JSFunction, "ObjectDefineOwnProperty",
object_define_own_property);
INSTALL_NATIVE(JSFunction, "ObjectGetOwnPropertyDescriptor",
object_get_own_property_descriptor);
INSTALL_NATIVE(JSFunction, "MessageGetLineNumber", message_get_line_number);
INSTALL_NATIVE(JSFunction, "MessageGetColumnNumber",
message_get_column_number);
INSTALL_NATIVE(JSFunction, "MessageGetSourceLine", message_get_source_line);
INSTALL_NATIVE(JSObject, "StackOverflowBoilerplate",
stack_overflow_boilerplate);
INSTALL_NATIVE(JSFunction, "JsonSerializeAdapter", json_serialize_adapter);
INSTALL_NATIVE(JSFunction, "Error", error_function);
INSTALL_NATIVE(JSFunction, "EvalError", eval_error_function);
INSTALL_NATIVE(JSFunction, "RangeError", range_error_function);
INSTALL_NATIVE(JSFunction, "ReferenceError", reference_error_function);
INSTALL_NATIVE(JSFunction, "SyntaxError", syntax_error_function);
INSTALL_NATIVE(JSFunction, "TypeError", type_error_function);
INSTALL_NATIVE(JSFunction, "URIError", uri_error_function);
INSTALL_NATIVE(JSFunction, "MakeError", make_error_function);
INSTALL_NATIVE(JSFunction, "PromiseCreate", promise_create);
INSTALL_NATIVE(JSFunction, "PromiseResolve", promise_resolve);
INSTALL_NATIVE(JSFunction, "PromiseReject", promise_reject);
INSTALL_NATIVE(JSFunction, "PromiseChain", promise_chain);
INSTALL_NATIVE(JSFunction, "PromiseCatch", promise_catch);
INSTALL_NATIVE(JSFunction, "PromiseThen", promise_then);
INSTALL_NATIVE(JSFunction, "PromiseHasUserDefinedRejectHandler",
promise_has_user_defined_reject_handler);
INSTALL_NATIVE(JSFunction, "ObserveNotifyChange", observers_notify_change);
INSTALL_NATIVE(JSFunction, "ObserveEnqueueSpliceRecord",
observers_enqueue_splice);
INSTALL_NATIVE(JSFunction, "ObserveBeginPerformSplice",
observers_begin_perform_splice);
INSTALL_NATIVE(JSFunction, "ObserveEndPerformSplice",
observers_end_perform_splice);
INSTALL_NATIVE(JSFunction, "ObserveNativeObjectObserve",
native_object_observe);
INSTALL_NATIVE(JSFunction, "ObserveNativeObjectGetNotifier",
native_object_get_notifier);
INSTALL_NATIVE(JSFunction, "ObserveNativeObjectNotifierPerformChange",
native_object_notifier_perform_change);
INSTALL_NATIVE(JSFunction, "ArrayValues", array_values_iterator);
INSTALL_NATIVE(JSFunction, "MapGet", map_get);
INSTALL_NATIVE(JSFunction, "MapSet", map_set);
INSTALL_NATIVE(JSFunction, "MapHas", map_has);
INSTALL_NATIVE(JSFunction, "MapDelete", map_delete);
INSTALL_NATIVE(JSFunction, "SetAdd", set_add);
INSTALL_NATIVE(JSFunction, "SetHas", set_has);
INSTALL_NATIVE(JSFunction, "SetDelete", set_delete);
INSTALL_NATIVE(JSFunction, "MapFromArray", map_from_array);
INSTALL_NATIVE(JSFunction, "SetFromArray", set_from_array);
NATIVE_CONTEXT_IMPORTED_FIELDS(INSTALL_NATIVE)
}
......@@ -1865,10 +1800,7 @@ static void InstallExperimentalNatives_harmony_proxies(
Isolate* isolate, Handle<Context> native_context,
Handle<JSObject> container) {
if (FLAG_harmony_proxies) {
INSTALL_NATIVE(JSFunction, "ProxyDerivedGetTrap", derived_get_trap);
INSTALL_NATIVE(JSFunction, "ProxyDerivedHasTrap", derived_has_trap);
INSTALL_NATIVE(JSFunction, "ProxyDerivedSetTrap", derived_set_trap);
INSTALL_NATIVE(JSFunction, "ProxyEnumerate", proxy_enumerate);
NATIVE_CONTEXT_IMPORTED_FIELDS_FOR_PROXY(INSTALL_NATIVE)
}
}
......
......@@ -503,15 +503,15 @@ function SetFromArray(array) {
// Exports
utils.ExportToRuntime(function(to) {
to.MapGet = MapGet;
to.MapSet = MapSet;
to.MapHas = MapHas;
to.MapDelete = MapDelete;
to.SetAdd = SetAdd;
to.SetHas = SetHas;
to.SetDelete = SetDelete;
to.MapFromArray = MapFromArray;
to.SetFromArray = SetFromArray;
to["map_get"] = MapGet;
to["map_set"] = MapSet;
to["map_has"] = MapHas;
to["map_delete"] = MapDelete;
to["set_add"] = SetAdd;
to["set_has"] = SetHas;
to["set_delete"] = SetDelete;
to["map_from_array"] = MapFromArray;
to["set_from_array"]= SetFromArray;
});
})
......@@ -73,148 +73,154 @@ enum BindingFlags {
// must always be allocated via Heap::AllocateContext() or
// Factory::NewContext.
#define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \
V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) \
V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \
V(ERROR_FUNCTION_INDEX, JSFunction, error_function) \
V(EVAL_ERROR_FUNCTION_INDEX, JSFunction, eval_error_function) \
V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \
V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \
V(JSON_SERIALIZE_ADAPTER_INDEX, JSFunction, json_serialize_adapter) \
V(MAKE_ERROR_FUNCTION_INDEX, JSFunction, make_error_function) \
V(MAP_DELETE_METHOD_INDEX, JSFunction, map_delete) \
V(MAP_FROM_ARRAY_INDEX, JSFunction, map_from_array) \
V(MAP_GET_METHOD_INDEX, JSFunction, map_get) \
V(MAP_HAS_METHOD_INDEX, JSFunction, map_has) \
V(MAP_SET_METHOD_INDEX, JSFunction, map_set) \
V(MESSAGE_GET_COLUMN_NUMBER_INDEX, JSFunction, message_get_column_number) \
V(MESSAGE_GET_LINE_NUMBER_INDEX, JSFunction, message_get_line_number) \
V(MESSAGE_GET_SOURCE_LINE_INDEX, JSFunction, message_get_source_line) \
V(NATIVE_OBJECT_GET_NOTIFIER_INDEX, JSFunction, native_object_get_notifier) \
V(NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, JSFunction, \
native_object_notifier_perform_change) \
V(NATIVE_OBJECT_OBSERVE_INDEX, JSFunction, native_object_observe) \
V(NO_SIDE_EFFECT_TO_STRING_FUN_INDEX, JSFunction, \
no_side_effect_to_string_fun) \
V(OBJECT_DEFINE_OWN_PROPERTY_INDEX, JSFunction, object_define_own_property) \
V(OBJECT_GET_OWN_PROPERTY_DESCROPTOR_INDEX, JSFunction, \
object_get_own_property_descriptor) \
V(OBSERVERS_BEGIN_SPLICE_INDEX, JSFunction, observers_begin_perform_splice) \
V(OBSERVERS_END_SPLICE_INDEX, JSFunction, observers_end_perform_splice) \
V(OBSERVERS_ENQUEUE_SPLICE_INDEX, JSFunction, observers_enqueue_splice) \
V(OBSERVERS_NOTIFY_CHANGE_INDEX, JSFunction, observers_notify_change) \
V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \
V(PROMISE_CHAIN_INDEX, JSFunction, promise_chain) \
V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \
V(PROMISE_HAS_USER_DEFINED_REJECT_HANDLER_INDEX, JSFunction, \
promise_has_user_defined_reject_handler) \
V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \
V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \
V(PROMISE_THEN_INDEX, JSFunction, promise_then) \
V(RANGE_ERROR_FUNCTION_INDEX, JSFunction, range_error_function) \
V(REFERENCE_ERROR_FUNCTION_INDEX, JSFunction, reference_error_function) \
V(SET_ADD_METHOD_INDEX, JSFunction, set_add) \
V(SET_DELETE_METHOD_INDEX, JSFunction, set_delete) \
V(SET_FROM_ARRAY_INDEX, JSFunction, set_from_array) \
V(SET_HAS_METHOD_INDEX, JSFunction, set_has) \
V(STACK_OVERFLOW_BOILERPLATE_INDEX, JSObject, stack_overflow_boilerplate) \
V(SYNTAX_ERROR_FUNCTION_INDEX, JSFunction, syntax_error_function) \
V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \
to_complete_property_descriptor) \
V(TO_DETAIL_STRING_FUN_INDEX, JSFunction, to_detail_string_fun) \
V(TO_INTEGER_FUN_INDEX, JSFunction, to_integer_fun) \
V(TO_LENGTH_FUN_INDEX, JSFunction, to_length_fun) \
V(TO_NUMBER_FUN_INDEX, JSFunction, to_number_fun) \
V(TO_STRING_FUN_INDEX, JSFunction, to_string_fun) \
V(TYPE_ERROR_FUNCTION_INDEX, JSFunction, type_error_function) \
V(URI_ERROR_FUNCTION_INDEX, JSFunction, uri_error_function)
#define NATIVE_CONTEXT_IMPORTED_FIELDS_FOR_PROXY(V) \
V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \
V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \
V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \
V(PROXY_ENUMERATE_INDEX, JSFunction, proxy_enumerate)
#define NATIVE_CONTEXT_FIELDS(V) \
V(GLOBAL_PROXY_INDEX, JSObject, global_proxy_object) \
V(SECURITY_TOKEN_INDEX, Object, security_token) \
V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function) \
V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \
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) \
V(FLOAT32X4_FUNCTION_INDEX, JSFunction, float32x4_function) \
V(INT32X4_FUNCTION_INDEX, JSFunction, int32x4_function) \
V(BOOL32X4_FUNCTION_INDEX, JSFunction, bool32x4_function) \
V(INT16X8_FUNCTION_INDEX, JSFunction, int16x8_function) \
V(BOOL16X8_FUNCTION_INDEX, JSFunction, bool16x8_function) \
V(INT8X16_FUNCTION_INDEX, JSFunction, int8x16_function) \
V(BOOL8X16_FUNCTION_INDEX, JSFunction, bool8x16_function) \
V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \
V(JS_OBJECT_STRONG_MAP_INDEX, Map, js_object_strong_map) \
V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \
V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \
V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \
V(JS_ARRAY_STRONG_MAPS_INDEX, Object, js_array_strong_maps) \
V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \
V(INITIAL_OBJECT_PROTOTYPE_INDEX, JSObject, initial_object_prototype) \
V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \
V(EMBEDDER_DATA_INDEX, FixedArray, embedder_data) \
V(CREATE_DATE_FUN_INDEX, JSFunction, create_date_fun) \
V(TO_NUMBER_FUN_INDEX, JSFunction, to_number_fun) \
V(TO_STRING_FUN_INDEX, JSFunction, to_string_fun) \
V(TO_DETAIL_STRING_FUN_INDEX, JSFunction, to_detail_string_fun) \
V(NO_SIDE_EFFECT_TO_STRING_FUN_INDEX, JSFunction, \
no_side_effect_to_string_fun) \
V(TO_INTEGER_FUN_INDEX, JSFunction, to_integer_fun) \
V(TO_LENGTH_FUN_INDEX, JSFunction, to_length_fun) \
V(GLOBAL_EVAL_FUN_INDEX, JSFunction, global_eval_fun) \
/* Below is alpha-sorted */ \
V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \
V(ARRAY_BUFFER_FUN_INDEX, JSFunction, array_buffer_fun) \
V(SHARED_ARRAY_BUFFER_FUN_INDEX, JSFunction, shared_array_buffer_fun) \
V(ARRAY_BUFFER_MAP_INDEX, Map, array_buffer_map) \
V(UINT8_ARRAY_FUN_INDEX, JSFunction, uint8_array_fun) \
V(INT8_ARRAY_FUN_INDEX, JSFunction, int8_array_fun) \
V(UINT16_ARRAY_FUN_INDEX, JSFunction, uint16_array_fun) \
V(INT16_ARRAY_FUN_INDEX, JSFunction, int16_array_fun) \
V(UINT32_ARRAY_FUN_INDEX, JSFunction, uint32_array_fun) \
V(INT32_ARRAY_FUN_INDEX, JSFunction, int32_array_fun) \
V(FLOAT32_ARRAY_FUN_INDEX, JSFunction, float32_array_fun) \
V(FLOAT64_ARRAY_FUN_INDEX, JSFunction, float64_array_fun) \
V(UINT8_CLAMPED_ARRAY_FUN_INDEX, JSFunction, uint8_clamped_array_fun) \
V(DATA_VIEW_FUN_INDEX, JSFunction, data_view_fun) \
V(SLOPPY_FUNCTION_MAP_INDEX, Map, sloppy_function_map) \
V(SLOPPY_FUNCTION_WITH_READONLY_PROTOTYPE_MAP_INDEX, Map, \
sloppy_function_with_readonly_prototype_map) \
V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \
V(STRONG_FUNCTION_MAP_INDEX, Map, strong_function_map) \
V(SLOPPY_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
sloppy_function_without_prototype_map) \
V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
strict_function_without_prototype_map) \
V(STRONG_CONSTRUCTOR_MAP_INDEX, Map, strong_constructor_map) \
V(ARRAY_FUNCTION_INDEX, JSFunction, array_function) \
V(BOOL16X8_FUNCTION_INDEX, JSFunction, bool16x8_function) \
V(BOOL32X4_FUNCTION_INDEX, JSFunction, bool32x4_function) \
V(BOOL8X16_FUNCTION_INDEX, JSFunction, bool8x16_function) \
V(BOOLEAN_FUNCTION_INDEX, JSFunction, boolean_function) \
V(BOUND_FUNCTION_MAP_INDEX, Map, bound_function_map) \
V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map) \
V(SLOPPY_ARGUMENTS_MAP_INDEX, Map, sloppy_arguments_map) \
V(FAST_ALIASED_ARGUMENTS_MAP_INDEX, Map, fast_aliased_arguments_map) \
V(SLOW_ALIASED_ARGUMENTS_MAP_INDEX, Map, slow_aliased_arguments_map) \
V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \
V(MESSAGE_LISTENERS_INDEX, JSObject, message_listeners) \
V(GET_STACK_TRACE_LINE_INDEX, JSFunction, get_stack_trace_line_fun) \
V(FUNCTION_CACHE_INDEX, ObjectHashTable, function_cache) \
V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \
V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \
V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \
V(CALL_AS_CONSTRUCTOR_DELEGATE_INDEX, JSFunction, \
call_as_constructor_delegate) \
V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \
V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \
V(CALL_AS_FUNCTION_DELEGATE_INDEX, JSFunction, call_as_function_delegate) \
V(CONTEXT_EXTENSION_FUNCTION_INDEX, JSFunction, context_extension_function) \
V(MAP_CACHE_INDEX, Object, map_cache) \
V(STRONG_MAP_CACHE_INDEX, Object, strong_map_cache) \
V(ALLOW_CODE_GEN_FROM_STRINGS_INDEX, Object, allow_code_gen_from_strings) \
V(DATA_VIEW_FUN_INDEX, JSFunction, data_view_fun) \
V(ERROR_MESSAGE_FOR_CODE_GEN_FROM_STRINGS_INDEX, Object, \
error_message_for_code_gen_from_strings) \
V(ERROR_FUNCTION_INDEX, JSFunction, error_function) \
V(EVAL_ERROR_FUNCTION_INDEX, JSFunction, eval_error_function) \
V(RANGE_ERROR_FUNCTION_INDEX, JSFunction, range_error_function) \
V(REFERENCE_ERROR_FUNCTION_INDEX, JSFunction, reference_error_function) \
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(MAKE_ERROR_FUNCTION_INDEX, JSFunction, make_error_function) \
V(PROMISE_CREATE_INDEX, JSFunction, promise_create) \
V(PROMISE_RESOLVE_INDEX, JSFunction, promise_resolve) \
V(PROMISE_REJECT_INDEX, JSFunction, promise_reject) \
V(PROMISE_CHAIN_INDEX, JSFunction, promise_chain) \
V(PROMISE_CATCH_INDEX, JSFunction, promise_catch) \
V(PROMISE_THEN_INDEX, JSFunction, promise_then) \
V(PROMISE_HAS_USER_DEFINED_REJECT_HANDLER_INDEX, JSFunction, \
promise_has_user_defined_reject_handler) \
V(TO_COMPLETE_PROPERTY_DESCRIPTOR_INDEX, JSFunction, \
to_complete_property_descriptor) \
V(OBJECT_DEFINE_OWN_PROPERTY_INDEX, JSFunction, object_define_own_property) \
V(OBJECT_GET_OWN_PROPERTY_DESCROPTOR_INDEX, JSFunction, \
object_get_own_property_descriptor) \
V(MESSAGE_GET_LINE_NUMBER_INDEX, JSFunction, message_get_line_number) \
V(MESSAGE_GET_COLUMN_NUMBER_INDEX, JSFunction, message_get_column_number) \
V(MESSAGE_GET_SOURCE_LINE_INDEX, JSFunction, message_get_source_line) \
V(STACK_OVERFLOW_BOILERPLATE_INDEX, JSObject, stack_overflow_boilerplate) \
V(JSON_SERIALIZE_ADAPTER_INDEX, JSFunction, json_serialize_adapter) \
V(DERIVED_HAS_TRAP_INDEX, JSFunction, derived_has_trap) \
V(DERIVED_GET_TRAP_INDEX, JSFunction, derived_get_trap) \
V(DERIVED_SET_TRAP_INDEX, JSFunction, derived_set_trap) \
V(PROXY_ENUMERATE_INDEX, JSFunction, proxy_enumerate) \
V(OBSERVERS_NOTIFY_CHANGE_INDEX, JSFunction, observers_notify_change) \
V(OBSERVERS_ENQUEUE_SPLICE_INDEX, JSFunction, observers_enqueue_splice) \
V(OBSERVERS_BEGIN_SPLICE_INDEX, JSFunction, observers_begin_perform_splice) \
V(OBSERVERS_END_SPLICE_INDEX, JSFunction, observers_end_perform_splice) \
V(NATIVE_OBJECT_OBSERVE_INDEX, JSFunction, native_object_observe) \
V(NATIVE_OBJECT_GET_NOTIFIER_INDEX, JSFunction, native_object_get_notifier) \
V(NATIVE_OBJECT_NOTIFIER_PERFORM_CHANGE, JSFunction, \
native_object_notifier_perform_change) \
V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \
V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \
V(STRONG_GENERATOR_FUNCTION_MAP_INDEX, Map, strong_generator_function_map) \
V(EXTRAS_EXPORTS_OBJECT_INDEX, JSObject, extras_binding_object) \
V(FAST_ALIASED_ARGUMENTS_MAP_INDEX, Map, fast_aliased_arguments_map) \
V(FLOAT32_ARRAY_FUN_INDEX, JSFunction, float32_array_fun) \
V(FLOAT32X4_FUNCTION_INDEX, JSFunction, float32x4_function) \
V(FLOAT64_ARRAY_FUN_INDEX, JSFunction, float64_array_fun) \
V(FUNCTION_CACHE_INDEX, ObjectHashTable, function_cache) \
V(GENERATOR_OBJECT_PROTOTYPE_MAP_INDEX, Map, generator_object_prototype_map) \
V(INITIAL_ARRAY_PROTOTYPE_INDEX, JSObject, initial_array_prototype) \
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) \
V(INT32_ARRAY_FUN_INDEX, JSFunction, int32_array_fun) \
V(INT32X4_FUNCTION_INDEX, JSFunction, int32x4_function) \
V(INT8_ARRAY_FUN_INDEX, JSFunction, int8_array_fun) \
V(INT8X16_FUNCTION_INDEX, JSFunction, int8x16_function) \
V(INTERNAL_ARRAY_FUNCTION_INDEX, JSFunction, internal_array_function) \
V(ITERATOR_RESULT_MAP_INDEX, Map, iterator_result_map) \
V(JS_ARRAY_MAPS_INDEX, Object, js_array_maps) \
V(JS_ARRAY_STRONG_MAPS_INDEX, Object, js_array_strong_maps) \
V(JS_MAP_FUN_INDEX, JSFunction, js_map_fun) \
V(JS_MAP_MAP_INDEX, Map, js_map_map) \
V(JS_OBJECT_STRONG_MAP_INDEX, Map, js_object_strong_map) \
V(JS_SET_FUN_INDEX, JSFunction, js_set_fun) \
V(JS_SET_MAP_INDEX, Map, js_set_map) \
V(MAP_GET_METHOD_INDEX, JSFunction, map_get) \
V(MAP_SET_METHOD_INDEX, JSFunction, map_set) \
V(MAP_HAS_METHOD_INDEX, JSFunction, map_has) \
V(MAP_DELETE_METHOD_INDEX, JSFunction, map_delete) \
V(SET_ADD_METHOD_INDEX, JSFunction, set_add) \
V(SET_HAS_METHOD_INDEX, JSFunction, set_has) \
V(SET_DELETE_METHOD_INDEX, JSFunction, set_delete) \
V(MAP_FROM_ARRAY_INDEX, JSFunction, map_from_array) \
V(SET_FROM_ARRAY_INDEX, JSFunction, set_from_array) \
V(MAP_CACHE_INDEX, Object, map_cache) \
V(MAP_ITERATOR_MAP_INDEX, Map, map_iterator_map) \
V(SET_ITERATOR_MAP_INDEX, Map, set_iterator_map) \
V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) \
V(SCRIPT_CONTEXT_TABLE_INDEX, ScriptContextTable, script_context_table) \
V(MESSAGE_LISTENERS_INDEX, JSObject, message_listeners) \
V(NATIVES_UTILS_OBJECT_INDEX, Object, natives_utils_object) \
V(EXTRAS_EXPORTS_OBJECT_INDEX, JSObject, extras_binding_object)
V(NORMALIZED_MAP_CACHE_INDEX, Object, normalized_map_cache) \
V(NUMBER_FUNCTION_INDEX, JSFunction, number_function) \
V(OBJECT_FUNCTION_INDEX, JSFunction, object_function) \
V(OPAQUE_REFERENCE_FUNCTION_INDEX, JSFunction, opaque_reference_function) \
V(REGEXP_FUNCTION_INDEX, JSFunction, regexp_function) \
V(REGEXP_RESULT_MAP_INDEX, Map, regexp_result_map) \
V(RUNTIME_CONTEXT_INDEX, Context, runtime_context) \
V(SCRIPT_CONTEXT_TABLE_INDEX, ScriptContextTable, script_context_table) \
V(SCRIPT_FUNCTION_INDEX, JSFunction, script_function) \
V(SECURITY_TOKEN_INDEX, Object, security_token) \
V(SET_ITERATOR_MAP_INDEX, Map, set_iterator_map) \
V(SHARED_ARRAY_BUFFER_FUN_INDEX, JSFunction, shared_array_buffer_fun) \
V(SLOPPY_ARGUMENTS_MAP_INDEX, Map, sloppy_arguments_map) \
V(SLOPPY_FUNCTION_MAP_INDEX, Map, sloppy_function_map) \
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) \
V(SLOPPY_GENERATOR_FUNCTION_MAP_INDEX, Map, sloppy_generator_function_map) \
V(SLOW_ALIASED_ARGUMENTS_MAP_INDEX, Map, slow_aliased_arguments_map) \
V(STRICT_ARGUMENTS_MAP_INDEX, Map, strict_arguments_map) \
V(STRICT_FUNCTION_MAP_INDEX, Map, strict_function_map) \
V(STRICT_FUNCTION_WITHOUT_PROTOTYPE_MAP_INDEX, Map, \
strict_function_without_prototype_map) \
V(STRICT_GENERATOR_FUNCTION_MAP_INDEX, Map, strict_generator_function_map) \
V(STRING_FUNCTION_INDEX, JSFunction, string_function) \
V(STRING_FUNCTION_PROTOTYPE_MAP_INDEX, Map, string_function_prototype_map) \
V(STRONG_CONSTRUCTOR_MAP_INDEX, Map, strong_constructor_map) \
V(STRONG_FUNCTION_MAP_INDEX, Map, strong_function_map) \
V(STRONG_GENERATOR_FUNCTION_MAP_INDEX, Map, strong_generator_function_map) \
V(STRONG_MAP_CACHE_INDEX, Object, strong_map_cache) \
V(SYMBOL_FUNCTION_INDEX, JSFunction, symbol_function) \
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) \
NATIVE_CONTEXT_IMPORTED_FIELDS(V) \
NATIVE_CONTEXT_IMPORTED_FIELDS_FOR_PROXY(V)
// A table of all script contexts. Every loaded top-level script with top-level
// lexical declarations contributes its ScriptContext into this table.
......
......@@ -884,7 +884,7 @@ utils.InstallFunctions(GlobalDate.prototype, DONT_ENUM, [
]);
utils.ExportToRuntime(function(to) {
to.CreateDate = CreateDate;
to["create_date_fun"] = CreateDate;
});
})
......@@ -1265,7 +1265,7 @@ void V8HeapExplorer::ExtractContextReferences(int entry, Context* context) {
TagObject(context->normalized_map_cache(), "(context norm. map cache)");
TagObject(context->runtime_context(), "(runtime context)");
TagObject(context->embedder_data(), "(context data)");
NATIVE_CONTEXT_FIELDS(EXTRACT_CONTEXT_FIELD);
NATIVE_CONTEXT_FIELDS(EXTRACT_CONTEXT_FIELD)
EXTRACT_CONTEXT_FIELD(OPTIMIZED_FUNCTIONS_LIST, unused,
optimized_functions_list);
EXTRACT_CONTEXT_FIELD(OPTIMIZED_CODE_LIST, unused, optimized_code_list);
......
......@@ -253,7 +253,7 @@ function JsonSerializeAdapter(key, object) {
}
utils.ExportToRuntime(function(to) {
to.JsonSerializeAdapter = JsonSerializeAdapter;
to["json_serialize_adapter"] = JsonSerializeAdapter;
});
})
......@@ -1017,21 +1017,21 @@ captureStackTrace = function captureStackTrace(obj, cons_opt) {
GlobalError.captureStackTrace = captureStackTrace;
utils.ExportToRuntime(function(to) {
to.Error = GlobalError;
to.EvalError = GlobalEvalError;
to.RangeError = GlobalRangeError;
to.ReferenceError = GlobalReferenceError;
to.SyntaxError = GlobalSyntaxError;
to.TypeError = GlobalTypeError;
to.URIError = GlobalURIError;
to.GetStackTraceLine = GetStackTraceLine;
to.NoSideEffectToString = NoSideEffectToString;
to.ToDetailString = ToDetailString;
to.MakeError = MakeGenericError;
to.MessageGetLineNumber = GetLineNumber;
to.MessageGetColumnNumber = GetColumnNumber;
to.MessageGetSourceLine = GetSourceLine;
to.StackOverflowBoilerplate = StackOverflowBoilerplate;
to["error_function"] = GlobalError;
to["eval_error_function"] = GlobalEvalError;
to["get_stack_trace_line_fun"] = GetStackTraceLine;
to["make_error_function"] = MakeGenericError;
to["message_get_column_number"] = GetColumnNumber;
to["message_get_line_number"] = GetLineNumber;
to["message_get_source_line"] = GetSourceLine;
to["no_side_effect_to_string_fun"] = NoSideEffectToString;
to["range_error_function"] = GlobalRangeError;
to["reference_error_function"] = GlobalReferenceError;
to["stack_overflow_boilerplate"] = StackOverflowBoilerplate;
to["syntax_error_function"] = GlobalSyntaxError;
to["to_detail_string_fun"] = ToDetailString;
to["type_error_function"] = GlobalTypeError;
to["uri_error_function"] = GlobalURIError;
});
});
......@@ -704,14 +704,14 @@ $observeBeginPerformSplice = BeginPerformSplice;
$observeEndPerformSplice = EndPerformSplice;
utils.ExportToRuntime(function(to) {
to.ObserveNotifyChange = NotifyChange;
to.ObserveEnqueueSpliceRecord = EnqueueSpliceRecord;
to.ObserveBeginPerformSplice = BeginPerformSplice;
to.ObserveEndPerformSplice = EndPerformSplice;
to.ObserveNativeObjectObserve = NativeObjectObserve;
to.ObserveNativeObjectGetNotifier = NativeObjectGetNotifier;
to.ObserveNativeObjectNotifierPerformChange =
to["native_object_get_notifier"] = NativeObjectGetNotifier;
to["native_object_notifier_perform_change"] =
NativeObjectNotifierPerformChange;
to["native_object_observe"] = NativeObjectObserve;
to["observers_begin_perform_splice"] = BeginPerformSplice;
to["observers_end_perform_splice"] = EndPerformSplice;
to["observers_enqueue_splice"] = EnqueueSpliceRecord;
to["observers_notify_change"] = NotifyChange;
});
})
......@@ -380,13 +380,14 @@ utils.InstallFunctions(GlobalPromise.prototype, DONT_ENUM, [
]);
utils.ExportToRuntime(function(to) {
to.PromiseCreate = PromiseCreate;
to.PromiseResolve = PromiseResolve;
to.PromiseReject = PromiseReject;
to.PromiseChain = PromiseChain;
to.PromiseCatch = PromiseCatch;
to.PromiseThen = PromiseThen;
to.PromiseHasUserDefinedRejectHandler = PromiseHasUserDefinedRejectHandler;
to["promise_catch"] = PromiseCatch;
to["promise_chain"] = PromiseChain;
to["promise_create"] = PromiseCreate;
to["promise_has_user_defined_reject_handler"] =
PromiseHasUserDefinedRejectHandler;
to["promise_reject"] = PromiseReject;
to["promise_resolve"] = PromiseResolve;
to["promise_then"] = PromiseThen;
});
})
......@@ -201,10 +201,10 @@ utils.Export(function(to) {
});
utils.ExportToRuntime(function(to) {
to.ProxyDerivedGetTrap = DerivedGetTrap;
to.ProxyDerivedHasTrap = DerivedHasTrap;
to.ProxyDerivedSetTrap = DerivedSetTrap;
to.ProxyEnumerate = ProxyEnumerate;
to["derived_get_trap"] = DerivedGetTrap;
to["derived_has_trap"] = DerivedHasTrap;
to["derived_set_trap"] = DerivedSetTrap;
to["proxy_enumerate"] = ProxyEnumerate;
});
})
......@@ -915,10 +915,10 @@ $toString = ToString;
});
utils.ExportToRuntime(function(to) {
to.ToNumber = ToNumber;
to.ToString = ToString;
to.ToInteger = ToInteger;
to.ToLength = ToLength;
to["to_integer_fun"] = ToInteger;
to["to_length_fun"] = ToLength;
to["to_number_fun"] = ToNumber;
to["to_string_fun"] = ToString;
});
utils.Export(function(to) {
......
......@@ -1810,10 +1810,10 @@ utils.Export(function(to) {
});
utils.ExportToRuntime(function(to) {
to.GlobalEval = GlobalEval;
to.ObjectDefineOwnProperty = DefineOwnPropertyFromAPI;
to.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor;
to.ToCompletePropertyDescriptor = ToCompletePropertyDescriptor;
to["global_eval_fun"] = GlobalEval;
to["object_define_own_property"] = DefineOwnPropertyFromAPI;
to["object_get_own_property_descriptor"] = ObjectGetOwnPropertyDescriptor;
to["to_complete_property_descriptor"] = ToCompletePropertyDescriptor;
});
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment