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> |
| 10 |
9 #include "include/v8-debug.h" | 11 #include "include/v8-debug.h" |
10 #include "src/allocation.h" | 12 #include "src/allocation.h" |
11 #include "src/assert-scope.h" | 13 #include "src/assert-scope.h" |
12 #include "src/base/atomicops.h" | 14 #include "src/base/atomicops.h" |
13 #include "src/builtins.h" | 15 #include "src/builtins.h" |
| 16 #include "src/cancelable-task.h" |
14 #include "src/contexts.h" | 17 #include "src/contexts.h" |
15 #include "src/date.h" | 18 #include "src/date.h" |
16 #include "src/execution.h" | 19 #include "src/execution.h" |
17 #include "src/frames.h" | 20 #include "src/frames.h" |
18 #include "src/futex-emulation.h" | 21 #include "src/futex-emulation.h" |
19 #include "src/global-handles.h" | 22 #include "src/global-handles.h" |
20 #include "src/handles.h" | 23 #include "src/handles.h" |
21 #include "src/hashmap.h" | 24 #include "src/hashmap.h" |
22 #include "src/heap/heap.h" | 25 #include "src/heap/heap.h" |
23 #include "src/optimizing-compile-dispatcher.h" | 26 #include "src/optimizing-compile-dispatcher.h" |
(...skipping 1102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 | 1129 |
1127 void set_array_buffer_allocator(v8::ArrayBuffer::Allocator* allocator) { | 1130 void set_array_buffer_allocator(v8::ArrayBuffer::Allocator* allocator) { |
1128 array_buffer_allocator_ = allocator; | 1131 array_buffer_allocator_ = allocator; |
1129 } | 1132 } |
1130 v8::ArrayBuffer::Allocator* array_buffer_allocator() const { | 1133 v8::ArrayBuffer::Allocator* array_buffer_allocator() const { |
1131 return array_buffer_allocator_; | 1134 return array_buffer_allocator_; |
1132 } | 1135 } |
1133 | 1136 |
1134 FutexWaitListNode* futex_wait_list_node() { return &futex_wait_list_node_; } | 1137 FutexWaitListNode* futex_wait_list_node() { return &futex_wait_list_node_; } |
1135 | 1138 |
| 1139 void RegisterCancelableTask(CancelableTask* task); |
| 1140 void RemoveCancelableTask(CancelableTask* task); |
| 1141 |
1136 protected: | 1142 protected: |
1137 explicit Isolate(bool enable_serializer); | 1143 explicit Isolate(bool enable_serializer); |
1138 | 1144 |
1139 private: | 1145 private: |
1140 friend struct GlobalState; | 1146 friend struct GlobalState; |
1141 friend struct InitializeGlobalState; | 1147 friend struct InitializeGlobalState; |
1142 Handle<JSObject> SetUpSubregistry(Handle<JSObject> registry, Handle<Map> map, | 1148 Handle<JSObject> SetUpSubregistry(Handle<JSObject> registry, Handle<Map> map, |
1143 const char* name); | 1149 const char* name); |
1144 | 1150 |
1145 // These fields are accessed through the API, offsets must be kept in sync | 1151 // These fields are accessed through the API, offsets must be kept in sync |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 | 1367 |
1362 v8::Isolate::UseCounterCallback use_counter_callback_; | 1368 v8::Isolate::UseCounterCallback use_counter_callback_; |
1363 BasicBlockProfiler* basic_block_profiler_; | 1369 BasicBlockProfiler* basic_block_profiler_; |
1364 | 1370 |
1365 List<Object*> partial_snapshot_cache_; | 1371 List<Object*> partial_snapshot_cache_; |
1366 | 1372 |
1367 v8::ArrayBuffer::Allocator* array_buffer_allocator_; | 1373 v8::ArrayBuffer::Allocator* array_buffer_allocator_; |
1368 | 1374 |
1369 FutexWaitListNode futex_wait_list_node_; | 1375 FutexWaitListNode futex_wait_list_node_; |
1370 | 1376 |
| 1377 std::set<CancelableTask*> cancelable_tasks_; |
| 1378 |
1371 friend class ExecutionAccess; | 1379 friend class ExecutionAccess; |
1372 friend class HandleScopeImplementer; | 1380 friend class HandleScopeImplementer; |
1373 friend class OptimizingCompileDispatcher; | 1381 friend class OptimizingCompileDispatcher; |
1374 friend class SweeperThread; | 1382 friend class SweeperThread; |
1375 friend class ThreadManager; | 1383 friend class ThreadManager; |
1376 friend class Simulator; | 1384 friend class Simulator; |
1377 friend class StackGuard; | 1385 friend class StackGuard; |
1378 friend class ThreadId; | 1386 friend class ThreadId; |
1379 friend class TestMemoryAllocatorScope; | 1387 friend class TestMemoryAllocatorScope; |
1380 friend class TestCodeRangeScope; | 1388 friend class TestCodeRangeScope; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 } | 1597 } |
1590 | 1598 |
1591 EmbeddedVector<char, 128> filename_; | 1599 EmbeddedVector<char, 128> filename_; |
1592 FILE* file_; | 1600 FILE* file_; |
1593 int scope_depth_; | 1601 int scope_depth_; |
1594 }; | 1602 }; |
1595 | 1603 |
1596 } } // namespace v8::internal | 1604 } } // namespace v8::internal |
1597 | 1605 |
1598 #endif // V8_ISOLATE_H_ | 1606 #endif // V8_ISOLATE_H_ |
OLD | NEW |