| 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 "include/v8-debug.h" | 8 #include "include/v8-debug.h" |
| 9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
| 10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
| 11 #include "src/atomicops.h" | 11 #include "src/base/atomicops.h" |
| 12 #include "src/builtins.h" | 12 #include "src/builtins.h" |
| 13 #include "src/contexts.h" | 13 #include "src/contexts.h" |
| 14 #include "src/execution.h" | 14 #include "src/execution.h" |
| 15 #include "src/frames.h" | 15 #include "src/frames.h" |
| 16 #include "src/date.h" | 16 #include "src/date.h" |
| 17 #include "src/global-handles.h" | 17 #include "src/global-handles.h" |
| 18 #include "src/handles.h" | 18 #include "src/handles.h" |
| 19 #include "src/hashmap.h" | 19 #include "src/hashmap.h" |
| 20 #include "src/heap.h" | 20 #include "src/heap.h" |
| 21 #include "src/optimizing-compiler-thread.h" | 21 #include "src/optimizing-compiler-thread.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 static const int kInvalidId = -1; | 184 static const int kInvalidId = -1; |
| 185 | 185 |
| 186 explicit ThreadId(int id) : id_(id) {} | 186 explicit ThreadId(int id) : id_(id) {} |
| 187 | 187 |
| 188 static int AllocateThreadId(); | 188 static int AllocateThreadId(); |
| 189 | 189 |
| 190 static int GetCurrentThreadId(); | 190 static int GetCurrentThreadId(); |
| 191 | 191 |
| 192 int id_; | 192 int id_; |
| 193 | 193 |
| 194 static Atomic32 highest_thread_id_; | 194 static base::Atomic32 highest_thread_id_; |
| 195 | 195 |
| 196 friend class Isolate; | 196 friend class Isolate; |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 | 199 |
| 200 #define FIELD_ACCESSOR(type, name) \ | 200 #define FIELD_ACCESSOR(type, name) \ |
| 201 inline void set_##name(type v) { name##_ = v; } \ | 201 inline void set_##name(type v) { name##_ = v; } \ |
| 202 inline type name() const { return name##_; } | 202 inline type name() const { return name##_; } |
| 203 | 203 |
| 204 | 204 |
| (...skipping 936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 | 1141 |
| 1142 // This mutex protects highest_thread_id_ and thread_data_table_. | 1142 // This mutex protects highest_thread_id_ and thread_data_table_. |
| 1143 static Mutex process_wide_mutex_; | 1143 static Mutex process_wide_mutex_; |
| 1144 | 1144 |
| 1145 static Thread::LocalStorageKey per_isolate_thread_data_key_; | 1145 static Thread::LocalStorageKey per_isolate_thread_data_key_; |
| 1146 static Thread::LocalStorageKey isolate_key_; | 1146 static Thread::LocalStorageKey isolate_key_; |
| 1147 static Thread::LocalStorageKey thread_id_key_; | 1147 static Thread::LocalStorageKey thread_id_key_; |
| 1148 static ThreadDataTable* thread_data_table_; | 1148 static ThreadDataTable* thread_data_table_; |
| 1149 | 1149 |
| 1150 // A global counter for all generated Isolates, might overflow. | 1150 // A global counter for all generated Isolates, might overflow. |
| 1151 static Atomic32 isolate_counter_; | 1151 static base::Atomic32 isolate_counter_; |
| 1152 | 1152 |
| 1153 void Deinit(); | 1153 void Deinit(); |
| 1154 | 1154 |
| 1155 static void SetIsolateThreadLocals(Isolate* isolate, | 1155 static void SetIsolateThreadLocals(Isolate* isolate, |
| 1156 PerIsolateThreadData* data); | 1156 PerIsolateThreadData* data); |
| 1157 | 1157 |
| 1158 // Find the PerThread for this particular (isolate, thread) combination. | 1158 // Find the PerThread for this particular (isolate, thread) combination. |
| 1159 // If one does not yet exist, allocate a new one. | 1159 // If one does not yet exist, allocate a new one. |
| 1160 PerIsolateThreadData* FindOrAllocatePerThreadDataForThisThread(); | 1160 PerIsolateThreadData* FindOrAllocatePerThreadDataForThisThread(); |
| 1161 | 1161 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1178 ThreadLocalTop* archived_thread_data); | 1178 ThreadLocalTop* archived_thread_data); |
| 1179 | 1179 |
| 1180 void FillCache(); | 1180 void FillCache(); |
| 1181 | 1181 |
| 1182 void PropagatePendingExceptionToExternalTryCatch(); | 1182 void PropagatePendingExceptionToExternalTryCatch(); |
| 1183 | 1183 |
| 1184 // Traverse prototype chain to find out whether the object is derived from | 1184 // Traverse prototype chain to find out whether the object is derived from |
| 1185 // the Error object. | 1185 // the Error object. |
| 1186 bool IsErrorObject(Handle<Object> obj); | 1186 bool IsErrorObject(Handle<Object> obj); |
| 1187 | 1187 |
| 1188 Atomic32 id_; | 1188 base::Atomic32 id_; |
| 1189 EntryStackItem* entry_stack_; | 1189 EntryStackItem* entry_stack_; |
| 1190 int stack_trace_nesting_level_; | 1190 int stack_trace_nesting_level_; |
| 1191 StringStream* incomplete_message_; | 1191 StringStream* incomplete_message_; |
| 1192 Address isolate_addresses_[kIsolateAddressCount + 1]; // NOLINT | 1192 Address isolate_addresses_[kIsolateAddressCount + 1]; // NOLINT |
| 1193 Bootstrapper* bootstrapper_; | 1193 Bootstrapper* bootstrapper_; |
| 1194 RuntimeProfiler* runtime_profiler_; | 1194 RuntimeProfiler* runtime_profiler_; |
| 1195 CompilationCache* compilation_cache_; | 1195 CompilationCache* compilation_cache_; |
| 1196 Counters* counters_; | 1196 Counters* counters_; |
| 1197 CodeRange* code_range_; | 1197 CodeRange* code_range_; |
| 1198 RecursiveMutex break_access_; | 1198 RecursiveMutex break_access_; |
| 1199 Atomic32 debugger_initialized_; | 1199 base::Atomic32 debugger_initialized_; |
| 1200 Logger* logger_; | 1200 Logger* logger_; |
| 1201 StackGuard stack_guard_; | 1201 StackGuard stack_guard_; |
| 1202 StatsTable* stats_table_; | 1202 StatsTable* stats_table_; |
| 1203 StubCache* stub_cache_; | 1203 StubCache* stub_cache_; |
| 1204 CodeAgingHelper* code_aging_helper_; | 1204 CodeAgingHelper* code_aging_helper_; |
| 1205 DeoptimizerData* deoptimizer_data_; | 1205 DeoptimizerData* deoptimizer_data_; |
| 1206 MaterializedObjectStore* materialized_object_store_; | 1206 MaterializedObjectStore* materialized_object_store_; |
| 1207 ThreadLocalTop thread_local_top_; | 1207 ThreadLocalTop thread_local_top_; |
| 1208 bool capture_stack_trace_for_uncaught_exceptions_; | 1208 bool capture_stack_trace_for_uncaught_exceptions_; |
| 1209 int stack_trace_for_uncaught_exceptions_frame_limit_; | 1209 int stack_trace_for_uncaught_exceptions_frame_limit_; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1489 } | 1489 } |
| 1490 | 1490 |
| 1491 EmbeddedVector<char, 128> filename_; | 1491 EmbeddedVector<char, 128> filename_; |
| 1492 FILE* file_; | 1492 FILE* file_; |
| 1493 int scope_depth_; | 1493 int scope_depth_; |
| 1494 }; | 1494 }; |
| 1495 | 1495 |
| 1496 } } // namespace v8::internal | 1496 } } // namespace v8::internal |
| 1497 | 1497 |
| 1498 #endif // V8_ISOLATE_H_ | 1498 #endif // V8_ISOLATE_H_ |
| OLD | NEW |