| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #ifndef V8_ISOLATE_H_ | 28 #ifndef V8_ISOLATE_H_ |
| 29 #define V8_ISOLATE_H_ | 29 #define V8_ISOLATE_H_ |
| 30 | 30 |
| 31 #include <set> |
| 32 |
| 31 #include "../include/v8-debug.h" | 33 #include "../include/v8-debug.h" |
| 32 #include "allocation.h" | 34 #include "allocation.h" |
| 33 #include "apiutils.h" | 35 #include "apiutils.h" |
| 34 #include "assert-scope.h" | 36 #include "assert-scope.h" |
| 35 #include "atomicops.h" | 37 #include "atomicops.h" |
| 36 #include "builtins.h" | 38 #include "builtins.h" |
| 37 #include "contexts.h" | 39 #include "contexts.h" |
| 38 #include "execution.h" | 40 #include "execution.h" |
| 39 #include "frames.h" | 41 #include "frames.h" |
| 40 #include "date.h" | 42 #include "date.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 class HTracer; | 77 class HTracer; |
| 76 class InlineRuntimeFunctionsTable; | 78 class InlineRuntimeFunctionsTable; |
| 77 class NoAllocationStringAllocator; | 79 class NoAllocationStringAllocator; |
| 78 class InnerPointerToCodeCache; | 80 class InnerPointerToCodeCache; |
| 79 class PreallocatedMemoryThread; | 81 class PreallocatedMemoryThread; |
| 80 class RandomNumberGenerator; | 82 class RandomNumberGenerator; |
| 81 class RegExpStack; | 83 class RegExpStack; |
| 82 class SaveContext; | 84 class SaveContext; |
| 83 class UnicodeCache; | 85 class UnicodeCache; |
| 84 class ConsStringIteratorOp; | 86 class ConsStringIteratorOp; |
| 87 class ScannerBase; |
| 85 class StringTracker; | 88 class StringTracker; |
| 86 class StubCache; | 89 class StubCache; |
| 87 class SweeperThread; | 90 class SweeperThread; |
| 88 class ThreadManager; | 91 class ThreadManager; |
| 89 class ThreadState; | 92 class ThreadState; |
| 90 class ThreadVisitor; // Defined in v8threads.h | 93 class ThreadVisitor; // Defined in v8threads.h |
| 91 template <StateTag Tag> class VMState; | 94 template <StateTag Tag> class VMState; |
| 92 | 95 |
| 93 // 'void function pointer', used to roundtrip the | 96 // 'void function pointer', used to roundtrip the |
| 94 // ExternalReference::ExternalReferenceRedirector since we can not include | 97 // ExternalReference::ExternalReferenceRedirector since we can not include |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1135 function_entry_hook_ = function_entry_hook; | 1138 function_entry_hook_ = function_entry_hook; |
| 1136 } | 1139 } |
| 1137 | 1140 |
| 1138 void* stress_deopt_count_address() { return &stress_deopt_count_; } | 1141 void* stress_deopt_count_address() { return &stress_deopt_count_; } |
| 1139 | 1142 |
| 1140 inline RandomNumberGenerator* random_number_generator(); | 1143 inline RandomNumberGenerator* random_number_generator(); |
| 1141 | 1144 |
| 1142 // Given an address occupied by a live code object, return that object. | 1145 // Given an address occupied by a live code object, return that object. |
| 1143 Object* FindCodeObject(Address a); | 1146 Object* FindCodeObject(Address a); |
| 1144 | 1147 |
| 1148 void AddScanner(ScannerBase* scanner); |
| 1149 void RemoveScanner(ScannerBase* scanner); |
| 1150 |
| 1145 private: | 1151 private: |
| 1146 Isolate(); | 1152 Isolate(); |
| 1147 | 1153 |
| 1148 friend struct GlobalState; | 1154 friend struct GlobalState; |
| 1149 friend struct InitializeGlobalState; | 1155 friend struct InitializeGlobalState; |
| 1150 | 1156 |
| 1151 enum State { | 1157 enum State { |
| 1152 UNINITIALIZED, // Some components may not have been allocated. | 1158 UNINITIALIZED, // Some components may not have been allocated. |
| 1153 INITIALIZED // All components are fully initialized. | 1159 INITIALIZED // All components are fully initialized. |
| 1154 }; | 1160 }; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 void FillCache(); | 1253 void FillCache(); |
| 1248 | 1254 |
| 1249 void PropagatePendingExceptionToExternalTryCatch(); | 1255 void PropagatePendingExceptionToExternalTryCatch(); |
| 1250 | 1256 |
| 1251 void InitializeDebugger(); | 1257 void InitializeDebugger(); |
| 1252 | 1258 |
| 1253 // Traverse prototype chain to find out whether the object is derived from | 1259 // Traverse prototype chain to find out whether the object is derived from |
| 1254 // the Error object. | 1260 // the Error object. |
| 1255 bool IsErrorObject(Handle<Object> obj); | 1261 bool IsErrorObject(Handle<Object> obj); |
| 1256 | 1262 |
| 1263 static void UpdateScannersAfterGC(v8::Isolate*, GCType, GCCallbackFlags); |
| 1264 void UpdateScannersAfterGC(); |
| 1265 |
| 1257 Atomic32 id_; | 1266 Atomic32 id_; |
| 1258 EntryStackItem* entry_stack_; | 1267 EntryStackItem* entry_stack_; |
| 1259 int stack_trace_nesting_level_; | 1268 int stack_trace_nesting_level_; |
| 1260 StringStream* incomplete_message_; | 1269 StringStream* incomplete_message_; |
| 1261 // The preallocated memory thread singleton. | 1270 // The preallocated memory thread singleton. |
| 1262 PreallocatedMemoryThread* preallocated_memory_thread_; | 1271 PreallocatedMemoryThread* preallocated_memory_thread_; |
| 1263 Address isolate_addresses_[kIsolateAddressCount + 1]; // NOLINT | 1272 Address isolate_addresses_[kIsolateAddressCount + 1]; // NOLINT |
| 1264 NoAllocationStringAllocator* preallocated_message_space_; | 1273 NoAllocationStringAllocator* preallocated_message_space_; |
| 1265 Bootstrapper* bootstrapper_; | 1274 Bootstrapper* bootstrapper_; |
| 1266 RuntimeProfiler* runtime_profiler_; | 1275 RuntimeProfiler* runtime_profiler_; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 #undef ISOLATE_FIELD_OFFSET | 1379 #undef ISOLATE_FIELD_OFFSET |
| 1371 #endif | 1380 #endif |
| 1372 | 1381 |
| 1373 DeferredHandles* deferred_handles_head_; | 1382 DeferredHandles* deferred_handles_head_; |
| 1374 OptimizingCompilerThread* optimizing_compiler_thread_; | 1383 OptimizingCompilerThread* optimizing_compiler_thread_; |
| 1375 SweeperThread** sweeper_thread_; | 1384 SweeperThread** sweeper_thread_; |
| 1376 | 1385 |
| 1377 // Counts deopt points if deopt_every_n_times is enabled. | 1386 // Counts deopt points if deopt_every_n_times is enabled. |
| 1378 unsigned int stress_deopt_count_; | 1387 unsigned int stress_deopt_count_; |
| 1379 | 1388 |
| 1389 // Stores information about the ScannerBase objects currently alive, so that |
| 1390 // we can update the raw string pointers they hold after GC. |
| 1391 std::set<ScannerBase*> scanners_; |
| 1392 |
| 1380 friend class ExecutionAccess; | 1393 friend class ExecutionAccess; |
| 1381 friend class HandleScopeImplementer; | 1394 friend class HandleScopeImplementer; |
| 1382 friend class IsolateInitializer; | 1395 friend class IsolateInitializer; |
| 1383 friend class OptimizingCompilerThread; | 1396 friend class OptimizingCompilerThread; |
| 1384 friend class SweeperThread; | 1397 friend class SweeperThread; |
| 1385 friend class ThreadManager; | 1398 friend class ThreadManager; |
| 1386 friend class Simulator; | 1399 friend class Simulator; |
| 1387 friend class StackGuard; | 1400 friend class StackGuard; |
| 1388 friend class ThreadId; | 1401 friend class ThreadId; |
| 1389 friend class TestMemoryAllocatorScope; | 1402 friend class TestMemoryAllocatorScope; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1574 } | 1587 } |
| 1575 | 1588 |
| 1576 EmbeddedVector<char, 128> filename_; | 1589 EmbeddedVector<char, 128> filename_; |
| 1577 FILE* file_; | 1590 FILE* file_; |
| 1578 int scope_depth_; | 1591 int scope_depth_; |
| 1579 }; | 1592 }; |
| 1580 | 1593 |
| 1581 } } // namespace v8::internal | 1594 } } // namespace v8::internal |
| 1582 | 1595 |
| 1583 #endif // V8_ISOLATE_H_ | 1596 #endif // V8_ISOLATE_H_ |
| OLD | NEW |