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 <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 Object* FindCodeObject(Address a); | 1078 Object* FindCodeObject(Address a); |
1079 | 1079 |
1080 int NextOptimizationId() { | 1080 int NextOptimizationId() { |
1081 int id = next_optimization_id_++; | 1081 int id = next_optimization_id_++; |
1082 if (!Smi::IsValid(next_optimization_id_)) { | 1082 if (!Smi::IsValid(next_optimization_id_)) { |
1083 next_optimization_id_ = 0; | 1083 next_optimization_id_ = 0; |
1084 } | 1084 } |
1085 return id; | 1085 return id; |
1086 } | 1086 } |
1087 | 1087 |
1088 // Get (and lazily initialize) the registry for per-isolate symbols. | |
1089 Handle<JSObject> GetSymbolRegistry(); | |
1090 | |
1091 void AddCallCompletedCallback(CallCompletedCallback callback); | 1088 void AddCallCompletedCallback(CallCompletedCallback callback); |
1092 void RemoveCallCompletedCallback(CallCompletedCallback callback); | 1089 void RemoveCallCompletedCallback(CallCompletedCallback callback); |
1093 void FireCallCompletedCallback(); | 1090 void FireCallCompletedCallback(); |
1094 | 1091 |
1095 void AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback); | 1092 void AddBeforeCallEnteredCallback(BeforeCallEnteredCallback callback); |
1096 void RemoveBeforeCallEnteredCallback(BeforeCallEnteredCallback callback); | 1093 void RemoveBeforeCallEnteredCallback(BeforeCallEnteredCallback callback); |
1097 inline void FireBeforeCallEnteredCallback(); | 1094 inline void FireBeforeCallEnteredCallback(); |
1098 | 1095 |
1099 void AddMicrotasksCompletedCallback(MicrotasksCompletedCallback callback); | 1096 void AddMicrotasksCompletedCallback(MicrotasksCompletedCallback callback); |
1100 void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallback callback); | 1097 void RemoveMicrotasksCompletedCallback(MicrotasksCompletedCallback callback); |
1101 void FireMicrotasksCompletedCallback(); | 1098 void FireMicrotasksCompletedCallback(); |
1102 | 1099 |
1103 void SetPromiseRejectCallback(PromiseRejectCallback callback); | 1100 void SetPromiseRejectCallback(PromiseRejectCallback callback); |
1104 void ReportPromiseReject(Handle<JSObject> promise, Handle<Object> value, | 1101 void ReportPromiseReject(Handle<JSObject> promise, Handle<Object> value, |
1105 v8::PromiseRejectEvent event); | 1102 v8::PromiseRejectEvent event); |
1106 | 1103 |
1107 void PromiseReactionJob(Handle<PromiseReactionJobInfo> info, | 1104 void PromiseReactionJob(Handle<PromiseReactionJobInfo> info, |
1108 MaybeHandle<Object>* result, | 1105 MaybeHandle<Object>* result, |
1109 MaybeHandle<Object>* maybe_exception); | 1106 MaybeHandle<Object>* maybe_exception); |
1110 void PromiseResolveThenableJob(Handle<PromiseResolveThenableJobInfo> info, | 1107 void PromiseResolveThenableJob(Handle<PromiseResolveThenableJobInfo> info, |
1111 MaybeHandle<Object>* result, | 1108 MaybeHandle<Object>* result, |
1112 MaybeHandle<Object>* maybe_exception); | 1109 MaybeHandle<Object>* maybe_exception); |
1113 void EnqueueMicrotask(Handle<Object> microtask); | 1110 void EnqueueMicrotask(Handle<Object> microtask); |
1114 void RunMicrotasks(); | 1111 void RunMicrotasks(); |
1115 bool IsRunningMicrotasks() const { return is_running_microtasks_; } | 1112 bool IsRunningMicrotasks() const { return is_running_microtasks_; } |
1116 int GetNextDebugMicrotaskId() { return debug_microtask_count_++; } | 1113 int GetNextDebugMicrotaskId() { return debug_microtask_count_++; } |
1117 | 1114 |
| 1115 Handle<Symbol> SymbolFor(Heap::RootListIndex dictionary_index, |
| 1116 Handle<String> name, bool private_symbol); |
| 1117 |
1118 void SetUseCounterCallback(v8::Isolate::UseCounterCallback callback); | 1118 void SetUseCounterCallback(v8::Isolate::UseCounterCallback callback); |
1119 void CountUsage(v8::Isolate::UseCounterFeature feature); | 1119 void CountUsage(v8::Isolate::UseCounterFeature feature); |
1120 | 1120 |
1121 BasicBlockProfiler* GetOrCreateBasicBlockProfiler(); | 1121 BasicBlockProfiler* GetOrCreateBasicBlockProfiler(); |
1122 BasicBlockProfiler* basic_block_profiler() { return basic_block_profiler_; } | 1122 BasicBlockProfiler* basic_block_profiler() { return basic_block_profiler_; } |
1123 | 1123 |
1124 std::string GetTurboCfgFileName(); | 1124 std::string GetTurboCfgFileName(); |
1125 | 1125 |
1126 #if TRACE_MAPS | 1126 #if TRACE_MAPS |
1127 int GetNextUniqueSharedFunctionInfoId() { return next_unique_sfi_id_++; } | 1127 int GetNextUniqueSharedFunctionInfoId() { return next_unique_sfi_id_++; } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 base::Mutex* simulator_i_cache_mutex() { return &simulator_i_cache_mutex_; } | 1178 base::Mutex* simulator_i_cache_mutex() { return &simulator_i_cache_mutex_; } |
1179 #endif | 1179 #endif |
1180 | 1180 |
1181 protected: | 1181 protected: |
1182 explicit Isolate(bool enable_serializer); | 1182 explicit Isolate(bool enable_serializer); |
1183 bool IsArrayOrObjectPrototype(Object* object); | 1183 bool IsArrayOrObjectPrototype(Object* object); |
1184 | 1184 |
1185 private: | 1185 private: |
1186 friend struct GlobalState; | 1186 friend struct GlobalState; |
1187 friend struct InitializeGlobalState; | 1187 friend struct InitializeGlobalState; |
1188 Handle<JSObject> SetUpSubregistry(Handle<JSObject> registry, Handle<Map> map, | |
1189 const char* name); | |
1190 | 1188 |
1191 // These fields are accessed through the API, offsets must be kept in sync | 1189 // These fields are accessed through the API, offsets must be kept in sync |
1192 // with v8::internal::Internals (in include/v8.h) constants. This is also | 1190 // with v8::internal::Internals (in include/v8.h) constants. This is also |
1193 // verified in Isolate::Init() using runtime checks. | 1191 // verified in Isolate::Init() using runtime checks. |
1194 void* embedder_data_[Internals::kNumIsolateDataSlots]; | 1192 void* embedder_data_[Internals::kNumIsolateDataSlots]; |
1195 Heap heap_; | 1193 Heap heap_; |
1196 | 1194 |
1197 // The per-process lock should be acquired before the ThreadDataTable is | 1195 // The per-process lock should be acquired before the ThreadDataTable is |
1198 // modified. | 1196 // modified. |
1199 class ThreadDataTable { | 1197 class ThreadDataTable { |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1682 | 1680 |
1683 EmbeddedVector<char, 128> filename_; | 1681 EmbeddedVector<char, 128> filename_; |
1684 FILE* file_; | 1682 FILE* file_; |
1685 int scope_depth_; | 1683 int scope_depth_; |
1686 }; | 1684 }; |
1687 | 1685 |
1688 } // namespace internal | 1686 } // namespace internal |
1689 } // namespace v8 | 1687 } // namespace v8 |
1690 | 1688 |
1691 #endif // V8_ISOLATE_H_ | 1689 #endif // V8_ISOLATE_H_ |
OLD | NEW |