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