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 "include/v8-debug.h" | 9 #include "include/v8-debug.h" |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 | 1143 |
1144 List<Object*>* partial_snapshot_cache() { return &partial_snapshot_cache_; } | 1144 List<Object*>* partial_snapshot_cache() { return &partial_snapshot_cache_; } |
1145 | 1145 |
1146 void set_array_buffer_allocator(v8::ArrayBuffer::Allocator* allocator) { | 1146 void set_array_buffer_allocator(v8::ArrayBuffer::Allocator* allocator) { |
1147 array_buffer_allocator_ = allocator; | 1147 array_buffer_allocator_ = allocator; |
1148 } | 1148 } |
1149 v8::ArrayBuffer::Allocator* array_buffer_allocator() const { | 1149 v8::ArrayBuffer::Allocator* array_buffer_allocator() const { |
1150 return array_buffer_allocator_; | 1150 return array_buffer_allocator_; |
1151 } | 1151 } |
1152 | 1152 |
| 1153 void set_shared_array_buffer_allocator( |
| 1154 v8::ArrayBuffer::Allocator* allocator) { |
| 1155 shared_array_buffer_allocator_ = allocator; |
| 1156 } |
| 1157 v8::ArrayBuffer::Allocator* shared_array_buffer_allocator() { |
| 1158 return shared_array_buffer_allocator_; |
| 1159 } |
| 1160 |
1153 protected: | 1161 protected: |
1154 explicit Isolate(bool enable_serializer); | 1162 explicit Isolate(bool enable_serializer); |
1155 | 1163 |
1156 private: | 1164 private: |
1157 friend struct GlobalState; | 1165 friend struct GlobalState; |
1158 friend struct InitializeGlobalState; | 1166 friend struct InitializeGlobalState; |
1159 | 1167 |
1160 // These fields are accessed through the API, offsets must be kept in sync | 1168 // These fields are accessed through the API, offsets must be kept in sync |
1161 // with v8::internal::Internals (in include/v8.h) constants. This is also | 1169 // with v8::internal::Internals (in include/v8.h) constants. This is also |
1162 // verified in Isolate::Init() using runtime checks. | 1170 // verified in Isolate::Init() using runtime checks. |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 | 1380 |
1373 // List of callbacks when a Call completes. | 1381 // List of callbacks when a Call completes. |
1374 List<CallCompletedCallback> call_completed_callbacks_; | 1382 List<CallCompletedCallback> call_completed_callbacks_; |
1375 | 1383 |
1376 v8::Isolate::UseCounterCallback use_counter_callback_; | 1384 v8::Isolate::UseCounterCallback use_counter_callback_; |
1377 BasicBlockProfiler* basic_block_profiler_; | 1385 BasicBlockProfiler* basic_block_profiler_; |
1378 | 1386 |
1379 List<Object*> partial_snapshot_cache_; | 1387 List<Object*> partial_snapshot_cache_; |
1380 | 1388 |
1381 v8::ArrayBuffer::Allocator* array_buffer_allocator_; | 1389 v8::ArrayBuffer::Allocator* array_buffer_allocator_; |
| 1390 v8::ArrayBuffer::Allocator* shared_array_buffer_allocator_; |
1382 | 1391 |
1383 friend class ExecutionAccess; | 1392 friend class ExecutionAccess; |
1384 friend class HandleScopeImplementer; | 1393 friend class HandleScopeImplementer; |
1385 friend class OptimizingCompileDispatcher; | 1394 friend class OptimizingCompileDispatcher; |
1386 friend class SweeperThread; | 1395 friend class SweeperThread; |
1387 friend class ThreadManager; | 1396 friend class ThreadManager; |
1388 friend class Simulator; | 1397 friend class Simulator; |
1389 friend class StackGuard; | 1398 friend class StackGuard; |
1390 friend class ThreadId; | 1399 friend class ThreadId; |
1391 friend class TestMemoryAllocatorScope; | 1400 friend class TestMemoryAllocatorScope; |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 } | 1610 } |
1602 | 1611 |
1603 EmbeddedVector<char, 128> filename_; | 1612 EmbeddedVector<char, 128> filename_; |
1604 FILE* file_; | 1613 FILE* file_; |
1605 int scope_depth_; | 1614 int scope_depth_; |
1606 }; | 1615 }; |
1607 | 1616 |
1608 } } // namespace v8::internal | 1617 } } // namespace v8::internal |
1609 | 1618 |
1610 #endif // V8_ISOLATE_H_ | 1619 #endif // V8_ISOLATE_H_ |
OLD | NEW |