| 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 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 | 961 |
| 962 void set_date_cache(DateCache* date_cache) { | 962 void set_date_cache(DateCache* date_cache) { |
| 963 if (date_cache != date_cache_) { | 963 if (date_cache != date_cache_) { |
| 964 delete date_cache_; | 964 delete date_cache_; |
| 965 } | 965 } |
| 966 date_cache_ = date_cache; | 966 date_cache_ = date_cache; |
| 967 } | 967 } |
| 968 | 968 |
| 969 Map* get_initial_js_array_map(ElementsKind kind); | 969 Map* get_initial_js_array_map(ElementsKind kind); |
| 970 | 970 |
| 971 // The elements protector is valid if there are no additional elements |
| 972 // on the Array prototype chain. |
| 971 static const int kArrayProtectorValid = 1; | 973 static const int kArrayProtectorValid = 1; |
| 972 static const int kArrayProtectorInvalid = 0; | 974 static const int kArrayProtectorInvalid = 0; |
| 973 | |
| 974 bool IsFastArrayConstructorPrototypeChainIntact(); | 975 bool IsFastArrayConstructorPrototypeChainIntact(); |
| 975 bool IsArraySpeciesLookupChainIntact(); | 976 bool IsArraySpeciesLookupChainIntact(); |
| 977 bool IsArrayIsConcatSpreadableLookupChainIntact(); |
| 976 | 978 |
| 977 // On intent to set an element in object, make sure that appropriate | 979 // On intent to set an element in object, make sure that appropriate |
| 978 // notifications occur if the set is on the elements of the array or | 980 // notifications occur if the set is on the elements of the array or |
| 979 // object prototype. Also ensure that changes to prototype chain between | 981 // object prototype. Also ensure that changes to prototype chain between |
| 980 // Array and Object fire notifications. | 982 // Array and Object fire notifications. |
| 981 void UpdateArrayProtectorOnSetElement(Handle<JSObject> object); | 983 void UpdateArrayProtectorOnSetElement(Handle<JSObject> object); |
| 982 void UpdateArrayProtectorOnSetLength(Handle<JSObject> object) { | 984 void UpdateArrayProtectorOnSetLength(Handle<JSObject> object) { |
| 983 UpdateArrayProtectorOnSetElement(object); | 985 UpdateArrayProtectorOnSetElement(object); |
| 984 } | 986 } |
| 985 void UpdateArrayProtectorOnSetPrototype(Handle<JSObject> object) { | 987 void UpdateArrayProtectorOnSetPrototype(Handle<JSObject> object) { |
| 986 UpdateArrayProtectorOnSetElement(object); | 988 UpdateArrayProtectorOnSetElement(object); |
| 987 } | 989 } |
| 988 void UpdateArrayProtectorOnNormalizeElements(Handle<JSObject> object) { | 990 void UpdateArrayProtectorOnNormalizeElements(Handle<JSObject> object) { |
| 989 UpdateArrayProtectorOnSetElement(object); | 991 UpdateArrayProtectorOnSetElement(object); |
| 990 } | 992 } |
| 991 void InvalidateArraySpeciesProtector(); | 993 void InvalidateArraySpeciesProtector(); |
| 994 void InvalidateArrayIsConcatSpreadableProtector(); |
| 992 | 995 |
| 993 // Returns true if array is the initial array prototype in any native context. | 996 // Returns true if array is the initial array prototype in any native context. |
| 994 bool IsAnyInitialArrayPrototype(Handle<JSArray> array); | 997 bool IsAnyInitialArrayPrototype(Handle<JSArray> array); |
| 995 | 998 |
| 996 CallInterfaceDescriptorData* call_descriptor_data(int index); | 999 CallInterfaceDescriptorData* call_descriptor_data(int index); |
| 997 | 1000 |
| 998 void IterateDeferredHandles(ObjectVisitor* visitor); | 1001 void IterateDeferredHandles(ObjectVisitor* visitor); |
| 999 void LinkDeferredHandles(DeferredHandles* deferred_handles); | 1002 void LinkDeferredHandles(DeferredHandles* deferred_handles); |
| 1000 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); | 1003 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); |
| 1001 | 1004 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 } | 1114 } |
| 1112 | 1115 |
| 1113 FutexWaitListNode* futex_wait_list_node() { return &futex_wait_list_node_; } | 1116 FutexWaitListNode* futex_wait_list_node() { return &futex_wait_list_node_; } |
| 1114 | 1117 |
| 1115 CancelableTaskManager* cancelable_task_manager() { | 1118 CancelableTaskManager* cancelable_task_manager() { |
| 1116 return cancelable_task_manager_; | 1119 return cancelable_task_manager_; |
| 1117 } | 1120 } |
| 1118 | 1121 |
| 1119 interpreter::Interpreter* interpreter() const { return interpreter_; } | 1122 interpreter::Interpreter* interpreter() const { return interpreter_; } |
| 1120 | 1123 |
| 1124 bool IsInContextIndex(Object* object, uint32_t index); |
| 1125 |
| 1121 protected: | 1126 protected: |
| 1122 explicit Isolate(bool enable_serializer); | 1127 explicit Isolate(bool enable_serializer); |
| 1128 bool ArrayOrObjectPrototypeIsInContext(Object* object); |
| 1123 | 1129 |
| 1124 private: | 1130 private: |
| 1125 friend struct GlobalState; | 1131 friend struct GlobalState; |
| 1126 friend struct InitializeGlobalState; | 1132 friend struct InitializeGlobalState; |
| 1127 Handle<JSObject> SetUpSubregistry(Handle<JSObject> registry, Handle<Map> map, | 1133 Handle<JSObject> SetUpSubregistry(Handle<JSObject> registry, Handle<Map> map, |
| 1128 const char* name); | 1134 const char* name); |
| 1129 | 1135 |
| 1130 // These fields are accessed through the API, offsets must be kept in sync | 1136 // These fields are accessed through the API, offsets must be kept in sync |
| 1131 // with v8::internal::Internals (in include/v8.h) constants. This is also | 1137 // with v8::internal::Internals (in include/v8.h) constants. This is also |
| 1132 // verified in Isolate::Init() using runtime checks. | 1138 // verified in Isolate::Init() using runtime checks. |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1593 | 1599 |
| 1594 EmbeddedVector<char, 128> filename_; | 1600 EmbeddedVector<char, 128> filename_; |
| 1595 FILE* file_; | 1601 FILE* file_; |
| 1596 int scope_depth_; | 1602 int scope_depth_; |
| 1597 }; | 1603 }; |
| 1598 | 1604 |
| 1599 } // namespace internal | 1605 } // namespace internal |
| 1600 } // namespace v8 | 1606 } // namespace v8 |
| 1601 | 1607 |
| 1602 #endif // V8_ISOLATE_H_ | 1608 #endif // V8_ISOLATE_H_ |
| OLD | NEW |