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

Side by Side Diff: src/isolate.h

Issue 796623003: Support multiple interrupt requests in v8 API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/execution.cc ('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 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 "include/v8-debug.h" 9 #include "include/v8-debug.h"
9 #include "src/allocation.h" 10 #include "src/allocation.h"
10 #include "src/assert-scope.h" 11 #include "src/assert-scope.h"
11 #include "src/base/atomicops.h" 12 #include "src/base/atomicops.h"
12 #include "src/builtins.h" 13 #include "src/builtins.h"
13 #include "src/contexts.h" 14 #include "src/contexts.h"
14 #include "src/date.h" 15 #include "src/date.h"
15 #include "src/execution.h" 16 #include "src/execution.h"
16 #include "src/frames.h" 17 #include "src/frames.h"
17 #include "src/global-handles.h" 18 #include "src/global-handles.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 V(ExternalReferenceTable*, external_reference_table, NULL) \ 384 V(ExternalReferenceTable*, external_reference_table, NULL) \
384 V(int, pending_microtask_count, 0) \ 385 V(int, pending_microtask_count, 0) \
385 V(bool, autorun_microtasks, true) \ 386 V(bool, autorun_microtasks, true) \
386 V(HStatistics*, hstatistics, NULL) \ 387 V(HStatistics*, hstatistics, NULL) \
387 V(CompilationStatistics*, turbo_statistics, NULL) \ 388 V(CompilationStatistics*, turbo_statistics, NULL) \
388 V(HTracer*, htracer, NULL) \ 389 V(HTracer*, htracer, NULL) \
389 V(CodeTracer*, code_tracer, NULL) \ 390 V(CodeTracer*, code_tracer, NULL) \
390 V(bool, fp_stubs_generated, false) \ 391 V(bool, fp_stubs_generated, false) \
391 V(int, max_available_threads, 0) \ 392 V(int, max_available_threads, 0) \
392 V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \ 393 V(uint32_t, per_isolate_assert_data, 0xFFFFFFFFu) \
393 V(InterruptCallback, api_interrupt_callback, NULL) \
394 V(void*, api_interrupt_callback_data, NULL) \
395 V(PromiseRejectCallback, promise_reject_callback, NULL) \ 394 V(PromiseRejectCallback, promise_reject_callback, NULL) \
396 ISOLATE_INIT_SIMULATOR_LIST(V) 395 ISOLATE_INIT_SIMULATOR_LIST(V)
397 396
398 #define THREAD_LOCAL_TOP_ACCESSOR(type, name) \ 397 #define THREAD_LOCAL_TOP_ACCESSOR(type, name) \
399 inline void set_##name(type v) { thread_local_top_.name##_ = v; } \ 398 inline void set_##name(type v) { thread_local_top_.name##_ = v; } \
400 inline type name() const { return thread_local_top_.name##_; } 399 inline type name() const { return thread_local_top_.name##_; }
401 400
402 401
403 class Isolate { 402 class Isolate {
404 // These forward declarations are required to make the friend declarations in 403 // These forward declarations are required to make the friend declarations in
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 Handle<Object> exception); 806 Handle<Object> exception);
808 807
809 Handle<JSMessageObject> CreateMessage(Handle<Object> exception, 808 Handle<JSMessageObject> CreateMessage(Handle<Object> exception,
810 MessageLocation* location); 809 MessageLocation* location);
811 810
812 // Out of resource exception helpers. 811 // Out of resource exception helpers.
813 Object* StackOverflow(); 812 Object* StackOverflow();
814 Object* TerminateExecution(); 813 Object* TerminateExecution();
815 void CancelTerminateExecution(); 814 void CancelTerminateExecution();
816 815
817 void InvokeApiInterruptCallback(); 816 void RequestInterrupt(InterruptCallback callback, void* data);
817 void InvokeApiInterruptCallbacks();
818 818
819 // Administration 819 // Administration
820 void Iterate(ObjectVisitor* v); 820 void Iterate(ObjectVisitor* v);
821 void Iterate(ObjectVisitor* v, ThreadLocalTop* t); 821 void Iterate(ObjectVisitor* v, ThreadLocalTop* t);
822 char* Iterate(ObjectVisitor* v, char* t); 822 char* Iterate(ObjectVisitor* v, char* t);
823 void IterateThread(ThreadVisitor* v, char* t); 823 void IterateThread(ThreadVisitor* v, char* t);
824 824
825 825
826 // Returns the current native context. 826 // Returns the current native context.
827 Handle<Context> native_context(); 827 Handle<Context> native_context();
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 // A static array of histogram info for each type. 1285 // A static array of histogram info for each type.
1286 HistogramInfo heap_histograms_[LAST_TYPE + 1]; 1286 HistogramInfo heap_histograms_[LAST_TYPE + 1];
1287 JSObject::SpillInformation js_spill_information_; 1287 JSObject::SpillInformation js_spill_information_;
1288 #endif 1288 #endif
1289 1289
1290 Debug* debug_; 1290 Debug* debug_;
1291 CpuProfiler* cpu_profiler_; 1291 CpuProfiler* cpu_profiler_;
1292 HeapProfiler* heap_profiler_; 1292 HeapProfiler* heap_profiler_;
1293 FunctionEntryHook function_entry_hook_; 1293 FunctionEntryHook function_entry_hook_;
1294 1294
1295 typedef std::pair<InterruptCallback, void*> InterruptEntry;
1296 std::queue<InterruptEntry> api_interrupts_queue_;
1297
1295 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \ 1298 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \
1296 type name##_; 1299 type name##_;
1297 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE) 1300 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE)
1298 #undef GLOBAL_BACKING_STORE 1301 #undef GLOBAL_BACKING_STORE
1299 1302
1300 #define GLOBAL_ARRAY_BACKING_STORE(type, name, length) \ 1303 #define GLOBAL_ARRAY_BACKING_STORE(type, name, length) \
1301 type name##_[length]; 1304 type name##_[length];
1302 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_BACKING_STORE) 1305 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_BACKING_STORE)
1303 #undef GLOBAL_ARRAY_BACKING_STORE 1306 #undef GLOBAL_ARRAY_BACKING_STORE
1304 1307
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1552 } 1555 }
1553 1556
1554 EmbeddedVector<char, 128> filename_; 1557 EmbeddedVector<char, 128> filename_;
1555 FILE* file_; 1558 FILE* file_;
1556 int scope_depth_; 1559 int scope_depth_;
1557 }; 1560 };
1558 1561
1559 } } // namespace v8::internal 1562 } } // namespace v8::internal
1560 1563
1561 #endif // V8_ISOLATE_H_ 1564 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698