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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // Heap-allocated activation contexts. | 28 // Heap-allocated activation contexts. |
29 // | 29 // |
30 // Contexts are implemented as FixedArray objects; the Context | 30 // Contexts are implemented as FixedArray objects; the Context |
31 // class is a convenience interface casted on a FixedArray object. | 31 // class is a convenience interface casted on a FixedArray object. |
32 // | 32 // |
33 // Note: Context must have no virtual functions and Context objects | 33 // Note: Context must have no virtual functions and Context objects |
34 // must always be allocated via Heap::AllocateContext() or | 34 // must always be allocated via Heap::AllocateContext() or |
35 // Factory::NewContext. | 35 // Factory::NewContext. |
36 | 36 |
37 #define NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \ | 37 #define NATIVE_CONTEXT_INTRINSIC_FUNCTIONS(V) \ |
38 V(IS_ARRAYLIKE, JSFunction, is_arraylike) \ | 38 V(IS_ARRAYLIKE, JSFunction, is_arraylike) \ |
39 V(GENERATOR_NEXT_INTERNAL, JSFunction, generator_next_internal) \ | 39 V(GENERATOR_NEXT_INTERNAL, JSFunction, generator_next_internal) \ |
40 V(GET_TEMPLATE_CALL_SITE_INDEX, JSFunction, get_template_call_site) \ | 40 V(GET_TEMPLATE_CALL_SITE_INDEX, JSFunction, get_template_call_site) \ |
41 V(MAKE_ERROR_INDEX, JSFunction, make_error) \ | 41 V(MAKE_ERROR_INDEX, JSFunction, make_error) \ |
42 V(MAKE_RANGE_ERROR_INDEX, JSFunction, make_range_error) \ | 42 V(MAKE_RANGE_ERROR_INDEX, JSFunction, make_range_error) \ |
43 V(MAKE_SYNTAX_ERROR_INDEX, JSFunction, make_syntax_error) \ | 43 V(MAKE_SYNTAX_ERROR_INDEX, JSFunction, make_syntax_error) \ |
44 V(MAKE_TYPE_ERROR_INDEX, JSFunction, make_type_error) \ | 44 V(MAKE_TYPE_ERROR_INDEX, JSFunction, make_type_error) \ |
45 V(MAKE_URI_ERROR_INDEX, JSFunction, make_uri_error) \ | 45 V(MAKE_URI_ERROR_INDEX, JSFunction, make_uri_error) \ |
46 V(OBJECT_DEFINE_PROPERTIES, JSFunction, object_define_properties) \ | 46 V(OBJECT_DEFINE_PROPERTIES, JSFunction, object_define_properties) \ |
47 V(OBJECT_DEFINE_PROPERTY, JSFunction, object_define_property) \ | 47 V(OBJECT_DEFINE_PROPERTY, JSFunction, object_define_property) \ |
48 V(OBJECT_FREEZE, JSFunction, object_freeze) \ | 48 V(OBJECT_FREEZE, JSFunction, object_freeze) \ |
49 V(OBJECT_GET_PROTOTYPE_OF, JSFunction, object_get_prototype_of) \ | 49 V(OBJECT_GET_PROTOTYPE_OF, JSFunction, object_get_prototype_of) \ |
50 V(OBJECT_IS_EXTENSIBLE, JSFunction, object_is_extensible) \ | 50 V(OBJECT_IS_EXTENSIBLE, JSFunction, object_is_extensible) \ |
51 V(OBJECT_IS_FROZEN, JSFunction, object_is_frozen) \ | 51 V(OBJECT_IS_FROZEN, JSFunction, object_is_frozen) \ |
52 V(OBJECT_IS_SEALED, JSFunction, object_is_sealed) \ | 52 V(OBJECT_IS_SEALED, JSFunction, object_is_sealed) \ |
53 V(OBJECT_KEYS, JSFunction, object_keys) \ | 53 V(OBJECT_KEYS, JSFunction, object_keys) \ |
54 V(REGEXP_INTERNAL_MATCH, JSFunction, regexp_internal_match) \ | 54 V(REGEXP_INTERNAL_MATCH, JSFunction, regexp_internal_match) \ |
55 V(REFLECT_APPLY_INDEX, JSFunction, reflect_apply) \ | 55 V(REFLECT_APPLY_INDEX, JSFunction, reflect_apply) \ |
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, JSFunction, promise_internal_constructor) \ |
| 65 V(IS_PROMISE, JSFunction, is_promise) |
64 | 66 |
65 #define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \ | 67 #define NATIVE_CONTEXT_IMPORTED_FIELDS(V) \ |
66 V(ARRAY_CONCAT_INDEX, JSFunction, array_concat) \ | 68 V(ARRAY_CONCAT_INDEX, JSFunction, array_concat) \ |
67 V(ARRAY_POP_INDEX, JSFunction, array_pop) \ | 69 V(ARRAY_POP_INDEX, JSFunction, array_pop) \ |
68 V(ARRAY_PUSH_INDEX, JSFunction, array_push) \ | 70 V(ARRAY_PUSH_INDEX, JSFunction, array_push) \ |
69 V(ARRAY_SHIFT_INDEX, JSFunction, array_shift) \ | 71 V(ARRAY_SHIFT_INDEX, JSFunction, array_shift) \ |
70 V(ARRAY_SPLICE_INDEX, JSFunction, array_splice) \ | 72 V(ARRAY_SPLICE_INDEX, JSFunction, array_splice) \ |
71 V(ARRAY_SLICE_INDEX, JSFunction, array_slice) \ | 73 V(ARRAY_SLICE_INDEX, JSFunction, array_slice) \ |
72 V(ARRAY_UNSHIFT_INDEX, JSFunction, array_unshift) \ | 74 V(ARRAY_UNSHIFT_INDEX, JSFunction, array_unshift) \ |
73 V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) \ | 75 V(ARRAY_VALUES_ITERATOR_INDEX, JSFunction, array_values_iterator) \ |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); | 656 STATIC_ASSERT(kHeaderSize == Internals::kContextHeaderSize); |
655 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); | 657 STATIC_ASSERT(EMBEDDER_DATA_INDEX == Internals::kContextEmbedderDataIndex); |
656 }; | 658 }; |
657 | 659 |
658 typedef Context::Field ContextField; | 660 typedef Context::Field ContextField; |
659 | 661 |
660 } // namespace internal | 662 } // namespace internal |
661 } // namespace v8 | 663 } // namespace v8 |
662 | 664 |
663 #endif // V8_CONTEXTS_H_ | 665 #endif // V8_CONTEXTS_H_ |
OLD | NEW |