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_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 | 684 |
685 // Returns if the given context may access the given global object. If | 685 // Returns if the given context may access the given global object. If |
686 // the result is false, the pending exception is guaranteed to be | 686 // the result is false, the pending exception is guaranteed to be |
687 // set. | 687 // set. |
688 bool MayAccess(Handle<Context> accessing_context, Handle<JSObject> receiver); | 688 bool MayAccess(Handle<Context> accessing_context, Handle<JSObject> receiver); |
689 | 689 |
690 void SetFailedAccessCheckCallback(v8::FailedAccessCheckCallback callback); | 690 void SetFailedAccessCheckCallback(v8::FailedAccessCheckCallback callback); |
691 void ReportFailedAccessCheck(Handle<JSObject> receiver); | 691 void ReportFailedAccessCheck(Handle<JSObject> receiver); |
692 | 692 |
693 // Exception throwing support. The caller should use the result | 693 // Exception throwing support. The caller should use the result |
694 // of Throw() as its return value. | 694 // of Throw() as its return vaue. |
695 Object* Throw(Object* exception, MessageLocation* location = NULL); | 695 Object* Throw(Object* exception, MessageLocation* location = NULL); |
696 Object* ThrowIllegalOperation(); | 696 Object* ThrowIllegalOperation(); |
697 | 697 |
698 template <typename T> | 698 template <typename T> |
699 MUST_USE_RESULT MaybeHandle<T> Throw(Handle<Object> exception, | 699 MUST_USE_RESULT MaybeHandle<T> Throw(Handle<Object> exception, |
700 MessageLocation* location = NULL) { | 700 MessageLocation* location = NULL) { |
701 Throw(*exception, location); | 701 Throw(*exception, location); |
702 return MaybeHandle<T>(); | 702 return MaybeHandle<T>(); |
703 } | 703 } |
704 | 704 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 date_cache_ = date_cache; | 952 date_cache_ = date_cache; |
953 } | 953 } |
954 | 954 |
955 Map* get_initial_js_array_map(ElementsKind kind); | 955 Map* get_initial_js_array_map(ElementsKind kind); |
956 | 956 |
957 static const int kArrayProtectorValid = 1; | 957 static const int kArrayProtectorValid = 1; |
958 static const int kArrayProtectorInvalid = 0; | 958 static const int kArrayProtectorInvalid = 0; |
959 | 959 |
960 bool IsFastArrayConstructorPrototypeChainIntact(); | 960 bool IsFastArrayConstructorPrototypeChainIntact(); |
961 inline bool IsArraySpeciesLookupChainIntact(); | 961 inline bool IsArraySpeciesLookupChainIntact(); |
| 962 bool IsIsConcatSpreadableLookupChainIntact(); |
962 | 963 |
963 // On intent to set an element in object, make sure that appropriate | 964 // On intent to set an element in object, make sure that appropriate |
964 // notifications occur if the set is on the elements of the array or | 965 // notifications occur if the set is on the elements of the array or |
965 // object prototype. Also ensure that changes to prototype chain between | 966 // object prototype. Also ensure that changes to prototype chain between |
966 // Array and Object fire notifications. | 967 // Array and Object fire notifications. |
967 void UpdateArrayProtectorOnSetElement(Handle<JSObject> object); | 968 void UpdateArrayProtectorOnSetElement(Handle<JSObject> object); |
968 void UpdateArrayProtectorOnSetLength(Handle<JSObject> object) { | 969 void UpdateArrayProtectorOnSetLength(Handle<JSObject> object) { |
969 UpdateArrayProtectorOnSetElement(object); | 970 UpdateArrayProtectorOnSetElement(object); |
970 } | 971 } |
971 void UpdateArrayProtectorOnSetPrototype(Handle<JSObject> object) { | 972 void UpdateArrayProtectorOnSetPrototype(Handle<JSObject> object) { |
972 UpdateArrayProtectorOnSetElement(object); | 973 UpdateArrayProtectorOnSetElement(object); |
973 } | 974 } |
974 void UpdateArrayProtectorOnNormalizeElements(Handle<JSObject> object) { | 975 void UpdateArrayProtectorOnNormalizeElements(Handle<JSObject> object) { |
975 UpdateArrayProtectorOnSetElement(object); | 976 UpdateArrayProtectorOnSetElement(object); |
976 } | 977 } |
977 void InvalidateArraySpeciesProtector(); | 978 void InvalidateArraySpeciesProtector(); |
| 979 void InvalidateIsConcatSpreadableProtector(); |
978 | 980 |
979 // Returns true if array is the initial array prototype in any native context. | 981 // Returns true if array is the initial array prototype in any native context. |
980 bool IsAnyInitialArrayPrototype(Handle<JSArray> array); | 982 bool IsAnyInitialArrayPrototype(Handle<JSArray> array); |
981 | 983 |
982 CallInterfaceDescriptorData* call_descriptor_data(int index); | 984 CallInterfaceDescriptorData* call_descriptor_data(int index); |
983 | 985 |
984 void IterateDeferredHandles(ObjectVisitor* visitor); | 986 void IterateDeferredHandles(ObjectVisitor* visitor); |
985 void LinkDeferredHandles(DeferredHandles* deferred_handles); | 987 void LinkDeferredHandles(DeferredHandles* deferred_handles); |
986 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); | 988 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); |
987 | 989 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 FutexWaitListNode* futex_wait_list_node() { return &futex_wait_list_node_; } | 1102 FutexWaitListNode* futex_wait_list_node() { return &futex_wait_list_node_; } |
1101 | 1103 |
1102 CancelableTaskManager* cancelable_task_manager() { | 1104 CancelableTaskManager* cancelable_task_manager() { |
1103 return cancelable_task_manager_; | 1105 return cancelable_task_manager_; |
1104 } | 1106 } |
1105 | 1107 |
1106 interpreter::Interpreter* interpreter() const { return interpreter_; } | 1108 interpreter::Interpreter* interpreter() const { return interpreter_; } |
1107 | 1109 |
1108 base::AccountingAllocator* allocator() { return &allocator_; } | 1110 base::AccountingAllocator* allocator() { return &allocator_; } |
1109 | 1111 |
| 1112 bool IsInAnyContext(Object* object, uint32_t index); |
| 1113 |
1110 protected: | 1114 protected: |
1111 explicit Isolate(bool enable_serializer); | 1115 explicit Isolate(bool enable_serializer); |
| 1116 bool IsArrayOrObjectPrototype(Object* object); |
1112 | 1117 |
1113 private: | 1118 private: |
1114 friend struct GlobalState; | 1119 friend struct GlobalState; |
1115 friend struct InitializeGlobalState; | 1120 friend struct InitializeGlobalState; |
1116 Handle<JSObject> SetUpSubregistry(Handle<JSObject> registry, Handle<Map> map, | 1121 Handle<JSObject> SetUpSubregistry(Handle<JSObject> registry, Handle<Map> map, |
1117 const char* name); | 1122 const char* name); |
1118 | 1123 |
1119 // These fields are accessed through the API, offsets must be kept in sync | 1124 // These fields are accessed through the API, offsets must be kept in sync |
1120 // with v8::internal::Internals (in include/v8.h) constants. This is also | 1125 // with v8::internal::Internals (in include/v8.h) constants. This is also |
1121 // verified in Isolate::Init() using runtime checks. | 1126 // verified in Isolate::Init() using runtime checks. |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 | 1594 |
1590 EmbeddedVector<char, 128> filename_; | 1595 EmbeddedVector<char, 128> filename_; |
1591 FILE* file_; | 1596 FILE* file_; |
1592 int scope_depth_; | 1597 int scope_depth_; |
1593 }; | 1598 }; |
1594 | 1599 |
1595 } // namespace internal | 1600 } // namespace internal |
1596 } // namespace v8 | 1601 } // namespace v8 |
1597 | 1602 |
1598 #endif // V8_ISOLATE_H_ | 1603 #endif // V8_ISOLATE_H_ |
OLD | NEW |