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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 V(int32_t, jsregexp_static_offsets_vector, kJSRegexpStaticOffsetsVectorSize) \ | 354 V(int32_t, jsregexp_static_offsets_vector, kJSRegexpStaticOffsetsVectorSize) \ |
355 V(int, bad_char_shift_table, kUC16AlphabetSize) \ | 355 V(int, bad_char_shift_table, kUC16AlphabetSize) \ |
356 V(int, good_suffix_shift_table, (kBMMaxShift + 1)) \ | 356 V(int, good_suffix_shift_table, (kBMMaxShift + 1)) \ |
357 V(int, suffix_table, (kBMMaxShift + 1)) \ | 357 V(int, suffix_table, (kBMMaxShift + 1)) \ |
358 V(uint32_t, private_random_seed, 2) \ | 358 V(uint32_t, private_random_seed, 2) \ |
359 ISOLATE_INIT_DEBUG_ARRAY_LIST(V) | 359 ISOLATE_INIT_DEBUG_ARRAY_LIST(V) |
360 | 360 |
361 typedef List<HeapObject*> DebugObjectCache; | 361 typedef List<HeapObject*> DebugObjectCache; |
362 | 362 |
363 #define ISOLATE_INIT_LIST(V) \ | 363 #define ISOLATE_INIT_LIST(V) \ |
364 /* SerializerDeserializer state. */ \ | |
365 V(int, serialize_partial_snapshot_cache_length, 0) \ | |
366 V(int, serialize_partial_snapshot_cache_capacity, 0) \ | |
367 V(Object**, serialize_partial_snapshot_cache, NULL) \ | |
368 /* Assembler state. */ \ | 364 /* Assembler state. */ \ |
369 V(FatalErrorCallback, exception_behavior, NULL) \ | 365 V(FatalErrorCallback, exception_behavior, NULL) \ |
370 V(LogEventCallback, event_logger, NULL) \ | 366 V(LogEventCallback, event_logger, NULL) \ |
371 V(AllowCodeGenerationFromStringsCallback, allow_code_gen_callback, NULL) \ | 367 V(AllowCodeGenerationFromStringsCallback, allow_code_gen_callback, NULL) \ |
372 /* To distinguish the function templates, so that we can find them in the */ \ | 368 /* To distinguish the function templates, so that we can find them in the */ \ |
373 /* function cache of the native context. */ \ | 369 /* function cache of the native context. */ \ |
374 V(int, next_serial_number, 0) \ | 370 V(int, next_serial_number, 0) \ |
375 V(ExternalReferenceRedirectorPointer*, external_reference_redirector, NULL) \ | 371 V(ExternalReferenceRedirectorPointer*, external_reference_redirector, NULL) \ |
376 /* Part of the state of liveedit. */ \ | 372 /* Part of the state of liveedit. */ \ |
377 V(FunctionInfoListener*, active_function_info_listener, NULL) \ | 373 V(FunctionInfoListener*, active_function_info_listener, NULL) \ |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); | 638 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); |
643 } | 639 } |
644 | 640 |
645 bool HasExternalTryCatch(); | 641 bool HasExternalTryCatch(); |
646 bool IsFinallyOnTop(); | 642 bool IsFinallyOnTop(); |
647 | 643 |
648 bool is_catchable_by_javascript(Object* exception) { | 644 bool is_catchable_by_javascript(Object* exception) { |
649 return exception != heap()->termination_exception(); | 645 return exception != heap()->termination_exception(); |
650 } | 646 } |
651 | 647 |
652 // Serializer. | |
653 void PushToPartialSnapshotCache(Object* obj); | |
654 | |
655 // JS execution stack (see frames.h). | 648 // JS execution stack (see frames.h). |
656 static Address c_entry_fp(ThreadLocalTop* thread) { | 649 static Address c_entry_fp(ThreadLocalTop* thread) { |
657 return thread->c_entry_fp_; | 650 return thread->c_entry_fp_; |
658 } | 651 } |
659 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } | 652 static Address handler(ThreadLocalTop* thread) { return thread->handler_; } |
660 Address c_function() { return thread_local_top_.c_function_; } | 653 Address c_function() { return thread_local_top_.c_function_; } |
661 | 654 |
662 inline Address* c_entry_fp_address() { | 655 inline Address* c_entry_fp_address() { |
663 return &thread_local_top_.c_entry_fp_; | 656 return &thread_local_top_.c_entry_fp_; |
664 } | 657 } |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1132 store_buffer_hash_set_2_address_ = store_buffer_hash_set_2_address; | 1125 store_buffer_hash_set_2_address_ = store_buffer_hash_set_2_address; |
1133 } | 1126 } |
1134 | 1127 |
1135 uintptr_t* store_buffer_hash_set_2_address() { | 1128 uintptr_t* store_buffer_hash_set_2_address() { |
1136 return store_buffer_hash_set_2_address_; | 1129 return store_buffer_hash_set_2_address_; |
1137 } | 1130 } |
1138 | 1131 |
1139 void AddDetachedContext(Handle<Context> context); | 1132 void AddDetachedContext(Handle<Context> context); |
1140 void CheckDetachedContextsAfterGC(); | 1133 void CheckDetachedContextsAfterGC(); |
1141 | 1134 |
| 1135 List<Object*>* partial_snapshot_cache() { return &partial_snapshot_cache_; } |
| 1136 |
1142 private: | 1137 private: |
1143 explicit Isolate(bool enable_serializer); | 1138 explicit Isolate(bool enable_serializer); |
1144 | 1139 |
1145 friend struct GlobalState; | 1140 friend struct GlobalState; |
1146 friend struct InitializeGlobalState; | 1141 friend struct InitializeGlobalState; |
1147 | 1142 |
1148 // These fields are accessed through the API, offsets must be kept in sync | 1143 // These fields are accessed through the API, offsets must be kept in sync |
1149 // with v8::internal::Internals (in include/v8.h) constants. This is also | 1144 // with v8::internal::Internals (in include/v8.h) constants. This is also |
1150 // verified in Isolate::Init() using runtime checks. | 1145 // verified in Isolate::Init() using runtime checks. |
1151 void* embedder_data_[Internals::kNumIsolateDataSlots]; | 1146 void* embedder_data_[Internals::kNumIsolateDataSlots]; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 #if TRACE_MAPS | 1348 #if TRACE_MAPS |
1354 int next_unique_sfi_id_; | 1349 int next_unique_sfi_id_; |
1355 #endif | 1350 #endif |
1356 | 1351 |
1357 // List of callbacks when a Call completes. | 1352 // List of callbacks when a Call completes. |
1358 List<CallCompletedCallback> call_completed_callbacks_; | 1353 List<CallCompletedCallback> call_completed_callbacks_; |
1359 | 1354 |
1360 v8::Isolate::UseCounterCallback use_counter_callback_; | 1355 v8::Isolate::UseCounterCallback use_counter_callback_; |
1361 BasicBlockProfiler* basic_block_profiler_; | 1356 BasicBlockProfiler* basic_block_profiler_; |
1362 | 1357 |
| 1358 List<Object*> partial_snapshot_cache_; |
1363 | 1359 |
1364 friend class ExecutionAccess; | 1360 friend class ExecutionAccess; |
1365 friend class HandleScopeImplementer; | 1361 friend class HandleScopeImplementer; |
1366 friend class OptimizingCompilerThread; | 1362 friend class OptimizingCompilerThread; |
1367 friend class SweeperThread; | 1363 friend class SweeperThread; |
1368 friend class ThreadManager; | 1364 friend class ThreadManager; |
1369 friend class Simulator; | 1365 friend class Simulator; |
1370 friend class StackGuard; | 1366 friend class StackGuard; |
1371 friend class ThreadId; | 1367 friend class ThreadId; |
1372 friend class TestMemoryAllocatorScope; | 1368 friend class TestMemoryAllocatorScope; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 } | 1577 } |
1582 | 1578 |
1583 EmbeddedVector<char, 128> filename_; | 1579 EmbeddedVector<char, 128> filename_; |
1584 FILE* file_; | 1580 FILE* file_; |
1585 int scope_depth_; | 1581 int scope_depth_; |
1586 }; | 1582 }; |
1587 | 1583 |
1588 } } // namespace v8::internal | 1584 } } // namespace v8::internal |
1589 | 1585 |
1590 #endif // V8_ISOLATE_H_ | 1586 #endif // V8_ISOLATE_H_ |
OLD | NEW |