Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: src/isolate.h

Issue 6529055: [Isolates] Merge crankshaft (r5922 from bleeding_edge). (Closed)
Patch Set: Win32 port Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic-inl.h ('k') | src/isolate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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
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 "../include/v8-debug.h"
31 #include "allocation.h" 32 #include "allocation.h"
32 #include "apiutils.h" 33 #include "apiutils.h"
34 #include "atomicops.h"
33 #include "builtins.h" 35 #include "builtins.h"
34 #include "contexts.h" 36 #include "contexts.h"
35 #include "execution.h" 37 #include "execution.h"
36 #include "frames.h" 38 #include "frames.h"
37 #include "global-handles.h" 39 #include "global-handles.h"
38 #include "handles.h" 40 #include "handles.h"
39 #include "heap.h" 41 #include "heap.h"
40 #include "regexp-stack.h" 42 #include "regexp-stack.h"
43 #include "runtime-profiler.h"
41 #include "runtime.h" 44 #include "runtime.h"
42 #include "zone.h" 45 #include "zone.h"
43 #include "../include/v8-debug.h"
44 46
45 47
46 #if !defined(__arm__) && defined(V8_TARGET_ARCH_ARM) 48 #if !defined(__arm__) && defined(V8_TARGET_ARCH_ARM)
47 namespace assembler { 49 namespace assembler {
48 namespace arm { 50 namespace arm {
49 class Redirection; 51 class Redirection;
50 class Simulator; 52 class Simulator;
51 } 53 }
52 } 54 }
53 #endif 55 #endif
54 56
55 57
56 namespace v8 { 58 namespace v8 {
57 namespace internal { 59 namespace internal {
58 60
59 class AstSentinels; 61 class AstSentinels;
60 class Bootstrapper; 62 class Bootstrapper;
61 class CodeGenerator; 63 class CodeGenerator;
64 class CodeRange;
62 class CompilationCache; 65 class CompilationCache;
63 class ContextSlotCache; 66 class ContextSlotCache;
64 class ContextSwitcher; 67 class ContextSwitcher;
65 class CodeRange;
66 class Counters; 68 class Counters;
67 class CpuFeatures; 69 class CpuFeatures;
68 class CpuProfiler; 70 class CpuProfiler;
71 class DeoptimizerData;
69 class Deserializer; 72 class Deserializer;
70 class EmptyStatement; 73 class EmptyStatement;
71 class ExternalReferenceTable; 74 class ExternalReferenceTable;
72 class Factory; 75 class Factory;
73 class FunctionInfoListener; 76 class FunctionInfoListener;
74 class HandleScopeImplementer; 77 class HandleScopeImplementer;
75 class HeapProfiler; 78 class HeapProfiler;
76 class InlineRuntimeFunctionsTable; 79 class InlineRuntimeFunctionsTable;
77 class NoAllocationStringAllocator; 80 class NoAllocationStringAllocator;
81 class PcToCodeCache;
78 class PreallocatedMemoryThread; 82 class PreallocatedMemoryThread;
79 class ProducerHeapProfile; 83 class ProducerHeapProfile;
80 class RegExpStack; 84 class RegExpStack;
81 class SaveContext; 85 class SaveContext;
82 class StubCache; 86 class ScannerConstants;
83 class StringInputBuffer; 87 class StringInputBuffer;
84 class StringTracker; 88 class StringTracker;
85 class ScannerConstants; 89 class StubCache;
86 class ThreadVisitor; // Defined in v8threads.h
87 class ThreadManager; 90 class ThreadManager;
88 class ThreadState; 91 class ThreadState;
92 class ThreadVisitor; // Defined in v8threads.h
89 class VMState; 93 class VMState;
90 94
91 typedef void* ExternalReferenceRedirector(void* original, bool fp_return); 95 typedef void* ExternalReferenceRedirector(void* original, bool fp_return);
92 96
93 97
94 #ifdef ENABLE_DEBUGGER_SUPPORT 98 #ifdef ENABLE_DEBUGGER_SUPPORT
95 class Debug; 99 class Debug;
96 class Debugger; 100 class Debugger;
97 class DebuggerAgent; 101 class DebuggerAgent;
98 #endif 102 #endif
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 #ifdef USE_SIMULATOR 192 #ifdef USE_SIMULATOR
189 #ifdef V8_TARGET_ARCH_ARM 193 #ifdef V8_TARGET_ARCH_ARM
190 assembler::arm::Simulator* simulator_; 194 assembler::arm::Simulator* simulator_;
191 #elif V8_TARGET_ARCH_MIPS 195 #elif V8_TARGET_ARCH_MIPS
192 assembler::mips::Simulator* simulator_; 196 assembler::mips::Simulator* simulator_;
193 #endif 197 #endif
194 #endif // USE_SIMULATOR 198 #endif // USE_SIMULATOR
195 199
196 #ifdef ENABLE_LOGGING_AND_PROFILING 200 #ifdef ENABLE_LOGGING_AND_PROFILING
197 Address js_entry_sp_; // the stack pointer of the bottom js entry frame 201 Address js_entry_sp_; // the stack pointer of the bottom js entry frame
202 Address external_callback_; // the external callback we're currently in
198 #endif 203 #endif
199 204
200 #ifdef ENABLE_VMSTATE_TRACKING 205 #ifdef ENABLE_VMSTATE_TRACKING
201 VMState* current_vm_state_; 206 StateTag current_vm_state_;
202 #endif 207 #endif
203 208
204 // Generated code scratch locations. 209 // Generated code scratch locations.
205 int32_t formal_count_; 210 int32_t formal_count_;
206 211
207 // Call back function to report unsafe JS accesses. 212 // Call back function to report unsafe JS accesses.
208 v8::FailedAccessCheckCallback failed_access_check_callback_; 213 v8::FailedAccessCheckCallback failed_access_check_callback_;
209 214
210 private: 215 private:
211 Address try_catch_handler_address_; 216 Address try_catch_handler_address_;
212 }; 217 };
213 218
214 #if defined(V8_TARGET_ARCH_ARM) 219 #if defined(V8_TARGET_ARCH_ARM)
215 220
216 #define ISOLATE_PLATFORM_INIT_LIST(V) \ 221 #define ISOLATE_PLATFORM_INIT_LIST(V) \
217 /* VirtualFrame::SpilledScope state */ \ 222 /* VirtualFrame::SpilledScope state */ \
218 V(bool, is_virtual_frame_in_spilled_scope, false) 223 V(bool, is_virtual_frame_in_spilled_scope, false) \
224 /* CodeGenerator::EmitNamedStore state */ \
225 V(int, inlined_write_barrier_size, -1)
219 226
220 #if !defined(__arm__) 227 #if !defined(__arm__)
221 class HashMap; 228 class HashMap;
222 #endif 229 #endif
223 230
224 #else 231 #else
225 232
226 #define ISOLATE_PLATFORM_INIT_LIST(V) 233 #define ISOLATE_PLATFORM_INIT_LIST(V)
227 234
228 #endif 235 #endif
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 V(Relocatable*, relocatable_top, NULL) \ 302 V(Relocatable*, relocatable_top, NULL) \
296 /* State for CodeEntry in profile-generator. */ \ 303 /* State for CodeEntry in profile-generator. */ \
297 V(CodeGenerator*, current_code_generator, NULL) \ 304 V(CodeGenerator*, current_code_generator, NULL) \
298 V(bool, jump_target_compiling_deferred_code, false) \ 305 V(bool, jump_target_compiling_deferred_code, false) \
299 V(DebugObjectCache*, string_stream_debug_object_cache, NULL) \ 306 V(DebugObjectCache*, string_stream_debug_object_cache, NULL) \
300 V(Object*, string_stream_current_security_token, NULL) \ 307 V(Object*, string_stream_current_security_token, NULL) \
301 /* TODO(isolates): Release this on destruction? */ \ 308 /* TODO(isolates): Release this on destruction? */ \
302 V(int*, irregexp_interpreter_backtrack_stack_cache, NULL) \ 309 V(int*, irregexp_interpreter_backtrack_stack_cache, NULL) \
303 /* Serializer state. */ \ 310 /* Serializer state. */ \
304 V(ExternalReferenceTable*, external_reference_table, NULL) \ 311 V(ExternalReferenceTable*, external_reference_table, NULL) \
312 /* AstNode state. */ \
313 V(unsigned, ast_node_id, 0) \
314 V(unsigned, ast_node_count, 0) \
305 ISOLATE_PLATFORM_INIT_LIST(V) \ 315 ISOLATE_PLATFORM_INIT_LIST(V) \
306 ISOLATE_LOGGING_INIT_LIST(V) \ 316 ISOLATE_LOGGING_INIT_LIST(V) \
307 ISOLATE_DEBUGGER_INIT_LIST(V) 317 ISOLATE_DEBUGGER_INIT_LIST(V)
308 318
309 class Isolate { 319 class Isolate {
310 // These forward declarations are required to make the friend declarations in 320 // These forward declarations are required to make the friend declarations in
311 // PerIsolateThreadData work on some older versions of gcc. 321 // PerIsolateThreadData work on some older versions of gcc.
312 class ThreadDataTable; 322 class ThreadDataTable;
313 class EntryStackItem; 323 class EntryStackItem;
314 public: 324 public:
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 #ifdef ENABLE_LOGGING_AND_PROFILING 540 #ifdef ENABLE_LOGGING_AND_PROFILING
531 // Bottom JS entry (see StackTracer::Trace in log.cc). 541 // Bottom JS entry (see StackTracer::Trace in log.cc).
532 static Address js_entry_sp(ThreadLocalTop* thread) { 542 static Address js_entry_sp(ThreadLocalTop* thread) {
533 return thread->js_entry_sp_; 543 return thread->js_entry_sp_;
534 } 544 }
535 inline Address* js_entry_sp_address() { 545 inline Address* js_entry_sp_address() {
536 return &thread_local_top_.js_entry_sp_; 546 return &thread_local_top_.js_entry_sp_;
537 } 547 }
538 #endif 548 #endif
539 549
540 #ifdef ENABLE_VMSTATE_TRACKING
541 VMState* current_vm_state() {
542 return thread_local_top_.current_vm_state_;
543 }
544
545 void set_current_vm_state(VMState* state) {
546 thread_local_top_.current_vm_state_ = state;
547 }
548 #endif
549
550 // Generated code scratch locations. 550 // Generated code scratch locations.
551 void* formal_count_address() { return &thread_local_top_.formal_count_; } 551 void* formal_count_address() { return &thread_local_top_.formal_count_; }
552 552
553 // Returns the global object of the current context. It could be 553 // Returns the global object of the current context. It could be
554 // a builtin object, or a js global object. 554 // a builtin object, or a js global object.
555 Handle<GlobalObject> global() { 555 Handle<GlobalObject> global() {
556 return Handle<GlobalObject>(context()->global()); 556 return Handle<GlobalObject>(context()->global());
557 } 557 }
558 558
559 // Returns the global proxy object of the current context. 559 // Returns the global proxy object of the current context.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 675
676 #define GLOBAL_CONTEXT_FIELD_ACCESSOR(index, type, name) \ 676 #define GLOBAL_CONTEXT_FIELD_ACCESSOR(index, type, name) \
677 Handle<type> name() { \ 677 Handle<type> name() { \
678 return Handle<type>(context()->global_context()->name()); \ 678 return Handle<type>(context()->global_context()->name()); \
679 } 679 }
680 GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSOR) 680 GLOBAL_CONTEXT_FIELDS(GLOBAL_CONTEXT_FIELD_ACCESSOR)
681 #undef GLOBAL_CONTEXT_FIELD_ACCESSOR 681 #undef GLOBAL_CONTEXT_FIELD_ACCESSOR
682 682
683 Bootstrapper* bootstrapper() { return bootstrapper_; } 683 Bootstrapper* bootstrapper() { return bootstrapper_; }
684 Counters* counters() { return counters_; } 684 Counters* counters() { return counters_; }
685 // TODO(isolates): Having CPU features per isolate is probably too
686 // flexible. We only really need to have the set of currently
687 // enabled features for asserts in DEBUG builds.
685 CpuFeatures* cpu_features() { return cpu_features_; } 688 CpuFeatures* cpu_features() { return cpu_features_; }
686 CodeRange* code_range() { return code_range_; } 689 CodeRange* code_range() { return code_range_; }
690 RuntimeProfiler* runtime_profiler() { return runtime_profiler_; }
687 CompilationCache* compilation_cache() { return compilation_cache_; } 691 CompilationCache* compilation_cache() { return compilation_cache_; }
688 Logger* logger() { return logger_; } 692 Logger* logger() { return logger_; }
689 StackGuard* stack_guard() { return &stack_guard_; } 693 StackGuard* stack_guard() { return &stack_guard_; }
690 Heap* heap() { return &heap_; } 694 Heap* heap() { return &heap_; }
691 StatsTable* stats_table() { return stats_table_; } 695 StatsTable* stats_table() { return stats_table_; }
692 StubCache* stub_cache() { return stub_cache_; } 696 StubCache* stub_cache() { return stub_cache_; }
697 DeoptimizerData* deoptimizer_data() { return deoptimizer_data_; }
693 ThreadLocalTop* thread_local_top() { return &thread_local_top_; } 698 ThreadLocalTop* thread_local_top() { return &thread_local_top_; }
694 699
695 TranscendentalCache* transcendental_cache() const { 700 TranscendentalCache* transcendental_cache() const {
696 return transcendental_cache_; 701 return transcendental_cache_;
697 } 702 }
698 703
699 MemoryAllocator* memory_allocator() { 704 MemoryAllocator* memory_allocator() {
700 return memory_allocator_; 705 return memory_allocator_;
701 } 706 }
702 707
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 848 }
844 #endif 849 #endif
845 850
846 Factory* factory() { return reinterpret_cast<Factory*>(this); } 851 Factory* factory() { return reinterpret_cast<Factory*>(this); }
847 852
848 // SerializerDeserializer state. 853 // SerializerDeserializer state.
849 static const int kPartialSnapshotCacheCapacity = 1400; 854 static const int kPartialSnapshotCacheCapacity = 1400;
850 855
851 static const int kJSRegexpStaticOffsetsVectorSize = 50; 856 static const int kJSRegexpStaticOffsetsVectorSize = 50;
852 857
858 #ifdef ENABLE_LOGGING_AND_PROFILING
859 Address external_callback() {
860 return thread_local_top_.external_callback_;
861 }
862 void set_external_callback(Address callback) {
863 thread_local_top_.external_callback_ = callback;
864 }
865 #endif
866
867 #ifdef ENABLE_VMSTATE_TRACKING
868 StateTag current_vm_state() {
869 return thread_local_top_.current_vm_state_;
870 }
871
872 void SetCurrentVMState(StateTag state) {
873 if (RuntimeProfiler::IsEnabled()) {
874 if (state == JS) {
875 // JS or non-JS -> JS transition.
876 RuntimeProfiler::IsolateEnteredJS(this);
877 } else if (thread_local_top_.current_vm_state_ == JS) {
878 // JS -> non-JS transition.
879 ASSERT(RuntimeProfiler::IsSomeIsolateInJS());
880 RuntimeProfiler::IsolateExitedJS(this);
881 }
882 }
883 thread_local_top_.current_vm_state_ = state;
884 }
885 #endif
886
887 void ResetEagerOptimizingData();
853 888
854 private: 889 private:
855 Isolate(); 890 Isolate();
856 891
857 // The per-process lock should be acquired before the ThreadDataTable is 892 // The per-process lock should be acquired before the ThreadDataTable is
858 // modified. 893 // modified.
859 class ThreadDataTable { 894 class ThreadDataTable {
860 public: 895 public:
861 ThreadDataTable(); 896 ThreadDataTable();
862 ~ThreadDataTable(); 897 ~ThreadDataTable();
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 void FillCache(); 992 void FillCache();
958 993
959 int stack_trace_nesting_level_; 994 int stack_trace_nesting_level_;
960 StringStream* incomplete_message_; 995 StringStream* incomplete_message_;
961 // The preallocated memory thread singleton. 996 // The preallocated memory thread singleton.
962 PreallocatedMemoryThread* preallocated_memory_thread_; 997 PreallocatedMemoryThread* preallocated_memory_thread_;
963 Address isolate_addresses_[k_isolate_address_count + 1]; // NOLINT 998 Address isolate_addresses_[k_isolate_address_count + 1]; // NOLINT
964 NoAllocationStringAllocator* preallocated_message_space_; 999 NoAllocationStringAllocator* preallocated_message_space_;
965 1000
966 Bootstrapper* bootstrapper_; 1001 Bootstrapper* bootstrapper_;
1002 RuntimeProfiler* runtime_profiler_;
967 CompilationCache* compilation_cache_; 1003 CompilationCache* compilation_cache_;
968 Counters* counters_; 1004 Counters* counters_;
969 CpuFeatures* cpu_features_; 1005 CpuFeatures* cpu_features_;
970 CodeRange* code_range_; 1006 CodeRange* code_range_;
971 Mutex* break_access_; 1007 Mutex* break_access_;
972 Heap heap_; 1008 Heap heap_;
973 Logger* logger_; 1009 Logger* logger_;
974 StackGuard stack_guard_; 1010 StackGuard stack_guard_;
975 StatsTable* stats_table_; 1011 StatsTable* stats_table_;
976 StubCache* stub_cache_; 1012 StubCache* stub_cache_;
1013 DeoptimizerData* deoptimizer_data_;
977 ThreadLocalTop thread_local_top_; 1014 ThreadLocalTop thread_local_top_;
978 bool capture_stack_trace_for_uncaught_exceptions_; 1015 bool capture_stack_trace_for_uncaught_exceptions_;
979 int stack_trace_for_uncaught_exceptions_frame_limit_; 1016 int stack_trace_for_uncaught_exceptions_frame_limit_;
980 StackTrace::StackTraceOptions stack_trace_for_uncaught_exceptions_options_; 1017 StackTrace::StackTraceOptions stack_trace_for_uncaught_exceptions_options_;
981 TranscendentalCache* transcendental_cache_; 1018 TranscendentalCache* transcendental_cache_;
982 MemoryAllocator* memory_allocator_; 1019 MemoryAllocator* memory_allocator_;
983 KeyedLookupCache* keyed_lookup_cache_; 1020 KeyedLookupCache* keyed_lookup_cache_;
984 ContextSlotCache* context_slot_cache_; 1021 ContextSlotCache* context_slot_cache_;
985 DescriptorLookupCache* descriptor_lookup_cache_; 1022 DescriptorLookupCache* descriptor_lookup_cache_;
986 v8::ImplementationUtilities::HandleScopeData handle_scope_data_; 1023 v8::ImplementationUtilities::HandleScopeData handle_scope_data_;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \ 1076 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \
1040 type name##_; 1077 type name##_;
1041 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE) 1078 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE)
1042 #undef GLOBAL_BACKING_STORE 1079 #undef GLOBAL_BACKING_STORE
1043 1080
1044 #define GLOBAL_ARRAY_BACKING_STORE(type, name, length) \ 1081 #define GLOBAL_ARRAY_BACKING_STORE(type, name, length) \
1045 type name##_[length]; 1082 type name##_[length];
1046 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_BACKING_STORE) 1083 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_BACKING_STORE)
1047 #undef GLOBAL_ARRAY_BACKING_STORE 1084 #undef GLOBAL_ARRAY_BACKING_STORE
1048 1085
1086 friend class ExecutionAccess;
1049 friend class IsolateInitializer; 1087 friend class IsolateInitializer;
1050 friend class v8::Isolate; 1088 friend class v8::Isolate;
1051 friend class v8::Locker; 1089 friend class v8::Locker;
1052 1090
1053 DISALLOW_COPY_AND_ASSIGN(Isolate); 1091 DISALLOW_COPY_AND_ASSIGN(Isolate);
1054 }; 1092 };
1055 1093
1056 1094
1057 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the 1095 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the
1058 // class as a work around for a bug in the generated code found with these 1096 // class as a work around for a bug in the generated code found with these
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 Handle<Context> context_; 1157 Handle<Context> context_;
1120 #else 1158 #else
1121 public: 1159 public:
1122 AssertNoContextChange() { } 1160 AssertNoContextChange() { }
1123 #endif 1161 #endif
1124 }; 1162 };
1125 1163
1126 1164
1127 class ExecutionAccess BASE_EMBEDDED { 1165 class ExecutionAccess BASE_EMBEDDED {
1128 public: 1166 public:
1129 ExecutionAccess(); 1167 explicit ExecutionAccess(Isolate* isolate) : isolate_(isolate) {
1130 ~ExecutionAccess(); 1168 Lock(isolate);
1169 }
1170 ~ExecutionAccess() { Unlock(isolate_); }
1171
1172 static void Lock(Isolate* isolate) { isolate->break_access_->Lock(); }
1173 static void Unlock(Isolate* isolate) { isolate->break_access_->Unlock(); }
1174
1175 static bool TryLock(Isolate* isolate) {
1176 return isolate->break_access_->TryLock();
1177 }
1178
1179 private:
1180 Isolate* isolate_;
1131 }; 1181 };
1132 1182
1133 1183
1134 // Support for checking for stack-overflows in C++ code. 1184 // Support for checking for stack-overflows in C++ code.
1135 class StackLimitCheck BASE_EMBEDDED { 1185 class StackLimitCheck BASE_EMBEDDED {
1136 public: 1186 public:
1137 explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { } 1187 explicit StackLimitCheck(Isolate* isolate) : isolate_(isolate) { }
1138 1188
1139 bool HasOverflowed() const { 1189 bool HasOverflowed() const {
1140 StackGuard* stack_guard = isolate_->stack_guard(); 1190 StackGuard* stack_guard = isolate_->stack_guard();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 1259
1210 } } // namespace v8::internal 1260 } } // namespace v8::internal
1211 1261
1212 // TODO(isolates): Get rid of these -inl.h includes and place them only where 1262 // TODO(isolates): Get rid of these -inl.h includes and place them only where
1213 // they're needed. 1263 // they're needed.
1214 #include "allocation-inl.h" 1264 #include "allocation-inl.h"
1215 #include "zone-inl.h" 1265 #include "zone-inl.h"
1216 #include "frames-inl.h" 1266 #include "frames-inl.h"
1217 1267
1218 #endif // V8_ISOLATE_H_ 1268 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/ic-inl.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698