| 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 "include/v8-debug.h" | 8 #include "include/v8-debug.h" |
| 9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
| 10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 return value; \ | 114 return value; \ |
| 115 } \ | 115 } \ |
| 116 } while (false) | 116 } while (false) |
| 117 | 117 |
| 118 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ | 118 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ |
| 119 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) | 119 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) |
| 120 | 120 |
| 121 #define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) \ | 121 #define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) \ |
| 122 do { \ | 122 do { \ |
| 123 if (!(call).ToHandle(&dst)) { \ | 123 if (!(call).ToHandle(&dst)) { \ |
| 124 ASSERT((isolate)->has_pending_exception()); \ | 124 DCHECK((isolate)->has_pending_exception()); \ |
| 125 return value; \ | 125 return value; \ |
| 126 } \ | 126 } \ |
| 127 } while (false) | 127 } while (false) |
| 128 | 128 |
| 129 #define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \ | 129 #define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \ |
| 130 ASSIGN_RETURN_ON_EXCEPTION_VALUE( \ | 130 ASSIGN_RETURN_ON_EXCEPTION_VALUE( \ |
| 131 isolate, dst, call, isolate->heap()->exception()) | 131 isolate, dst, call, isolate->heap()->exception()) |
| 132 | 132 |
| 133 #define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call, T) \ | 133 #define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call, T) \ |
| 134 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, MaybeHandle<T>()) | 134 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, MaybeHandle<T>()) |
| 135 | 135 |
| 136 #define RETURN_ON_EXCEPTION_VALUE(isolate, call, value) \ | 136 #define RETURN_ON_EXCEPTION_VALUE(isolate, call, value) \ |
| 137 do { \ | 137 do { \ |
| 138 if ((call).is_null()) { \ | 138 if ((call).is_null()) { \ |
| 139 ASSERT((isolate)->has_pending_exception()); \ | 139 DCHECK((isolate)->has_pending_exception()); \ |
| 140 return value; \ | 140 return value; \ |
| 141 } \ | 141 } \ |
| 142 } while (false) | 142 } while (false) |
| 143 | 143 |
| 144 #define RETURN_FAILURE_ON_EXCEPTION(isolate, call) \ | 144 #define RETURN_FAILURE_ON_EXCEPTION(isolate, call) \ |
| 145 RETURN_ON_EXCEPTION_VALUE(isolate, call, isolate->heap()->exception()) | 145 RETURN_ON_EXCEPTION_VALUE(isolate, call, isolate->heap()->exception()) |
| 146 | 146 |
| 147 #define RETURN_ON_EXCEPTION(isolate, call, T) \ | 147 #define RETURN_ON_EXCEPTION(isolate, call, T) \ |
| 148 RETURN_ON_EXCEPTION_VALUE(isolate, call, MaybeHandle<T>()) | 148 RETURN_ON_EXCEPTION_VALUE(isolate, call, MaybeHandle<T>()) |
| 149 | 149 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // the same pointer. When running on a simulator with a separate JS | 234 // the same pointer. When running on a simulator with a separate JS |
| 235 // stack, try_catch_handler_address returns a JS stack address that | 235 // stack, try_catch_handler_address returns a JS stack address that |
| 236 // corresponds to the place on the JS stack where the C++ handler | 236 // corresponds to the place on the JS stack where the C++ handler |
| 237 // would have been if the stack were not separate. | 237 // would have been if the stack were not separate. |
| 238 Address try_catch_handler_address() { | 238 Address try_catch_handler_address() { |
| 239 return reinterpret_cast<Address>( | 239 return reinterpret_cast<Address>( |
| 240 v8::TryCatch::JSStackComparableAddress(try_catch_handler())); | 240 v8::TryCatch::JSStackComparableAddress(try_catch_handler())); |
| 241 } | 241 } |
| 242 | 242 |
| 243 void Free() { | 243 void Free() { |
| 244 ASSERT(!has_pending_message_); | 244 DCHECK(!has_pending_message_); |
| 245 ASSERT(!external_caught_exception_); | 245 DCHECK(!external_caught_exception_); |
| 246 ASSERT(try_catch_handler_ == NULL); | 246 DCHECK(try_catch_handler_ == NULL); |
| 247 } | 247 } |
| 248 | 248 |
| 249 Isolate* isolate_; | 249 Isolate* isolate_; |
| 250 // The context where the current execution method is created and for variable | 250 // The context where the current execution method is created and for variable |
| 251 // lookups. | 251 // lookups. |
| 252 Context* context_; | 252 Context* context_; |
| 253 ThreadId thread_id_; | 253 ThreadId thread_id_; |
| 254 Object* pending_exception_; | 254 Object* pending_exception_; |
| 255 bool has_pending_message_; | 255 bool has_pending_message_; |
| 256 bool rethrowing_message_; | 256 bool rethrowing_message_; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 EnsureInitialized(); | 459 EnsureInitialized(); |
| 460 return reinterpret_cast<PerIsolateThreadData*>( | 460 return reinterpret_cast<PerIsolateThreadData*>( |
| 461 base::Thread::GetThreadLocal(per_isolate_thread_data_key_)); | 461 base::Thread::GetThreadLocal(per_isolate_thread_data_key_)); |
| 462 } | 462 } |
| 463 | 463 |
| 464 // Returns the isolate inside which the current thread is running. | 464 // Returns the isolate inside which the current thread is running. |
| 465 INLINE(static Isolate* Current()) { | 465 INLINE(static Isolate* Current()) { |
| 466 EnsureInitialized(); | 466 EnsureInitialized(); |
| 467 Isolate* isolate = reinterpret_cast<Isolate*>( | 467 Isolate* isolate = reinterpret_cast<Isolate*>( |
| 468 base::Thread::GetExistingThreadLocal(isolate_key_)); | 468 base::Thread::GetExistingThreadLocal(isolate_key_)); |
| 469 ASSERT(isolate != NULL); | 469 DCHECK(isolate != NULL); |
| 470 return isolate; | 470 return isolate; |
| 471 } | 471 } |
| 472 | 472 |
| 473 INLINE(static Isolate* UncheckedCurrent()) { | 473 INLINE(static Isolate* UncheckedCurrent()) { |
| 474 EnsureInitialized(); | 474 EnsureInitialized(); |
| 475 return reinterpret_cast<Isolate*>( | 475 return reinterpret_cast<Isolate*>( |
| 476 base::Thread::GetThreadLocal(isolate_key_)); | 476 base::Thread::GetThreadLocal(isolate_key_)); |
| 477 } | 477 } |
| 478 | 478 |
| 479 // Like UncheckedCurrent, but skips the check that |isolate_key_| was | 479 // Like UncheckedCurrent, but skips the check that |isolate_key_| was |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 static base::Thread::LocalStorageKey per_isolate_thread_data_key(); | 529 static base::Thread::LocalStorageKey per_isolate_thread_data_key(); |
| 530 | 530 |
| 531 // Mutex for serializing access to break control structures. | 531 // Mutex for serializing access to break control structures. |
| 532 base::RecursiveMutex* break_access() { return &break_access_; } | 532 base::RecursiveMutex* break_access() { return &break_access_; } |
| 533 | 533 |
| 534 Address get_address_from_id(AddressId id); | 534 Address get_address_from_id(AddressId id); |
| 535 | 535 |
| 536 // Access to top context (where the current function object was created). | 536 // Access to top context (where the current function object was created). |
| 537 Context* context() { return thread_local_top_.context_; } | 537 Context* context() { return thread_local_top_.context_; } |
| 538 void set_context(Context* context) { | 538 void set_context(Context* context) { |
| 539 ASSERT(context == NULL || context->IsContext()); | 539 DCHECK(context == NULL || context->IsContext()); |
| 540 thread_local_top_.context_ = context; | 540 thread_local_top_.context_ = context; |
| 541 } | 541 } |
| 542 Context** context_address() { return &thread_local_top_.context_; } | 542 Context** context_address() { return &thread_local_top_.context_; } |
| 543 | 543 |
| 544 THREAD_LOCAL_TOP_ACCESSOR(SaveContext*, save_context) | 544 THREAD_LOCAL_TOP_ACCESSOR(SaveContext*, save_context) |
| 545 | 545 |
| 546 // Access to current thread id. | 546 // Access to current thread id. |
| 547 THREAD_LOCAL_TOP_ACCESSOR(ThreadId, thread_id) | 547 THREAD_LOCAL_TOP_ACCESSOR(ThreadId, thread_id) |
| 548 | 548 |
| 549 // Interface to pending exception. | 549 // Interface to pending exception. |
| 550 Object* pending_exception() { | 550 Object* pending_exception() { |
| 551 ASSERT(has_pending_exception()); | 551 DCHECK(has_pending_exception()); |
| 552 ASSERT(!thread_local_top_.pending_exception_->IsException()); | 552 DCHECK(!thread_local_top_.pending_exception_->IsException()); |
| 553 return thread_local_top_.pending_exception_; | 553 return thread_local_top_.pending_exception_; |
| 554 } | 554 } |
| 555 | 555 |
| 556 void set_pending_exception(Object* exception_obj) { | 556 void set_pending_exception(Object* exception_obj) { |
| 557 ASSERT(!exception_obj->IsException()); | 557 DCHECK(!exception_obj->IsException()); |
| 558 thread_local_top_.pending_exception_ = exception_obj; | 558 thread_local_top_.pending_exception_ = exception_obj; |
| 559 } | 559 } |
| 560 | 560 |
| 561 void clear_pending_exception() { | 561 void clear_pending_exception() { |
| 562 ASSERT(!thread_local_top_.pending_exception_->IsException()); | 562 DCHECK(!thread_local_top_.pending_exception_->IsException()); |
| 563 thread_local_top_.pending_exception_ = heap_.the_hole_value(); | 563 thread_local_top_.pending_exception_ = heap_.the_hole_value(); |
| 564 } | 564 } |
| 565 | 565 |
| 566 Object** pending_exception_address() { | 566 Object** pending_exception_address() { |
| 567 return &thread_local_top_.pending_exception_; | 567 return &thread_local_top_.pending_exception_; |
| 568 } | 568 } |
| 569 | 569 |
| 570 bool has_pending_exception() { | 570 bool has_pending_exception() { |
| 571 ASSERT(!thread_local_top_.pending_exception_->IsException()); | 571 DCHECK(!thread_local_top_.pending_exception_->IsException()); |
| 572 return !thread_local_top_.pending_exception_->IsTheHole(); | 572 return !thread_local_top_.pending_exception_->IsTheHole(); |
| 573 } | 573 } |
| 574 | 574 |
| 575 THREAD_LOCAL_TOP_ACCESSOR(bool, external_caught_exception) | 575 THREAD_LOCAL_TOP_ACCESSOR(bool, external_caught_exception) |
| 576 | 576 |
| 577 void clear_pending_message() { | 577 void clear_pending_message() { |
| 578 thread_local_top_.has_pending_message_ = false; | 578 thread_local_top_.has_pending_message_ = false; |
| 579 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); | 579 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); |
| 580 thread_local_top_.pending_message_script_ = heap_.the_hole_value(); | 580 thread_local_top_.pending_message_script_ = heap_.the_hole_value(); |
| 581 } | 581 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 602 Address has_pending_message_address() { | 602 Address has_pending_message_address() { |
| 603 return reinterpret_cast<Address>(&thread_local_top_.has_pending_message_); | 603 return reinterpret_cast<Address>(&thread_local_top_.has_pending_message_); |
| 604 } | 604 } |
| 605 | 605 |
| 606 Address pending_message_script_address() { | 606 Address pending_message_script_address() { |
| 607 return reinterpret_cast<Address>( | 607 return reinterpret_cast<Address>( |
| 608 &thread_local_top_.pending_message_script_); | 608 &thread_local_top_.pending_message_script_); |
| 609 } | 609 } |
| 610 | 610 |
| 611 Object* scheduled_exception() { | 611 Object* scheduled_exception() { |
| 612 ASSERT(has_scheduled_exception()); | 612 DCHECK(has_scheduled_exception()); |
| 613 ASSERT(!thread_local_top_.scheduled_exception_->IsException()); | 613 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); |
| 614 return thread_local_top_.scheduled_exception_; | 614 return thread_local_top_.scheduled_exception_; |
| 615 } | 615 } |
| 616 bool has_scheduled_exception() { | 616 bool has_scheduled_exception() { |
| 617 ASSERT(!thread_local_top_.scheduled_exception_->IsException()); | 617 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); |
| 618 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); | 618 return thread_local_top_.scheduled_exception_ != heap_.the_hole_value(); |
| 619 } | 619 } |
| 620 void clear_scheduled_exception() { | 620 void clear_scheduled_exception() { |
| 621 ASSERT(!thread_local_top_.scheduled_exception_->IsException()); | 621 DCHECK(!thread_local_top_.scheduled_exception_->IsException()); |
| 622 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); | 622 thread_local_top_.scheduled_exception_ = heap_.the_hole_value(); |
| 623 } | 623 } |
| 624 | 624 |
| 625 bool HasExternalTryCatch(); | 625 bool HasExternalTryCatch(); |
| 626 bool IsFinallyOnTop(); | 626 bool IsFinallyOnTop(); |
| 627 | 627 |
| 628 bool is_catchable_by_javascript(Object* exception) { | 628 bool is_catchable_by_javascript(Object* exception) { |
| 629 return exception != heap()->termination_exception(); | 629 return exception != heap()->termination_exception(); |
| 630 } | 630 } |
| 631 | 631 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 char* RestoreThread(char* from); | 803 char* RestoreThread(char* from); |
| 804 | 804 |
| 805 static const char* const kStackOverflowMessage; | 805 static const char* const kStackOverflowMessage; |
| 806 | 806 |
| 807 static const int kUC16AlphabetSize = 256; // See StringSearchBase. | 807 static const int kUC16AlphabetSize = 256; // See StringSearchBase. |
| 808 static const int kBMMaxShift = 250; // See StringSearchBase. | 808 static const int kBMMaxShift = 250; // See StringSearchBase. |
| 809 | 809 |
| 810 // Accessors. | 810 // Accessors. |
| 811 #define GLOBAL_ACCESSOR(type, name, initialvalue) \ | 811 #define GLOBAL_ACCESSOR(type, name, initialvalue) \ |
| 812 inline type name() const { \ | 812 inline type name() const { \ |
| 813 ASSERT(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \ | 813 DCHECK(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \ |
| 814 return name##_; \ | 814 return name##_; \ |
| 815 } \ | 815 } \ |
| 816 inline void set_##name(type value) { \ | 816 inline void set_##name(type value) { \ |
| 817 ASSERT(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \ | 817 DCHECK(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \ |
| 818 name##_ = value; \ | 818 name##_ = value; \ |
| 819 } | 819 } |
| 820 ISOLATE_INIT_LIST(GLOBAL_ACCESSOR) | 820 ISOLATE_INIT_LIST(GLOBAL_ACCESSOR) |
| 821 #undef GLOBAL_ACCESSOR | 821 #undef GLOBAL_ACCESSOR |
| 822 | 822 |
| 823 #define GLOBAL_ARRAY_ACCESSOR(type, name, length) \ | 823 #define GLOBAL_ARRAY_ACCESSOR(type, name, length) \ |
| 824 inline type* name() { \ | 824 inline type* name() { \ |
| 825 ASSERT(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \ | 825 DCHECK(OFFSET_OF(Isolate, name##_) == name##_debug_offset_); \ |
| 826 return &(name##_)[0]; \ | 826 return &(name##_)[0]; \ |
| 827 } | 827 } |
| 828 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR) | 828 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR) |
| 829 #undef GLOBAL_ARRAY_ACCESSOR | 829 #undef GLOBAL_ARRAY_ACCESSOR |
| 830 | 830 |
| 831 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ | 831 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ |
| 832 Handle<type> name() { \ | 832 Handle<type> name() { \ |
| 833 return Handle<type>(native_context()->name(), this); \ | 833 return Handle<type>(native_context()->name(), this); \ |
| 834 } \ | 834 } \ |
| 835 bool is_##name(type* value) { \ | 835 bool is_##name(type* value) { \ |
| 836 return native_context()->is_##name(value); \ | 836 return native_context()->is_##name(value); \ |
| 837 } | 837 } |
| 838 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) | 838 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) |
| 839 #undef NATIVE_CONTEXT_FIELD_ACCESSOR | 839 #undef NATIVE_CONTEXT_FIELD_ACCESSOR |
| 840 | 840 |
| 841 Bootstrapper* bootstrapper() { return bootstrapper_; } | 841 Bootstrapper* bootstrapper() { return bootstrapper_; } |
| 842 Counters* counters() { | 842 Counters* counters() { |
| 843 // Call InitializeLoggingAndCounters() if logging is needed before | 843 // Call InitializeLoggingAndCounters() if logging is needed before |
| 844 // the isolate is fully initialized. | 844 // the isolate is fully initialized. |
| 845 ASSERT(counters_ != NULL); | 845 DCHECK(counters_ != NULL); |
| 846 return counters_; | 846 return counters_; |
| 847 } | 847 } |
| 848 CodeRange* code_range() { return code_range_; } | 848 CodeRange* code_range() { return code_range_; } |
| 849 RuntimeProfiler* runtime_profiler() { return runtime_profiler_; } | 849 RuntimeProfiler* runtime_profiler() { return runtime_profiler_; } |
| 850 CompilationCache* compilation_cache() { return compilation_cache_; } | 850 CompilationCache* compilation_cache() { return compilation_cache_; } |
| 851 Logger* logger() { | 851 Logger* logger() { |
| 852 // Call InitializeLoggingAndCounters() if logging is needed before | 852 // Call InitializeLoggingAndCounters() if logging is needed before |
| 853 // the isolate is fully initialized. | 853 // the isolate is fully initialized. |
| 854 ASSERT(logger_ != NULL); | 854 DCHECK(logger_ != NULL); |
| 855 return logger_; | 855 return logger_; |
| 856 } | 856 } |
| 857 StackGuard* stack_guard() { return &stack_guard_; } | 857 StackGuard* stack_guard() { return &stack_guard_; } |
| 858 Heap* heap() { return &heap_; } | 858 Heap* heap() { return &heap_; } |
| 859 StatsTable* stats_table(); | 859 StatsTable* stats_table(); |
| 860 StubCache* stub_cache() { return stub_cache_; } | 860 StubCache* stub_cache() { return stub_cache_; } |
| 861 CodeAgingHelper* code_aging_helper() { return code_aging_helper_; } | 861 CodeAgingHelper* code_aging_helper() { return code_aging_helper_; } |
| 862 DeoptimizerData* deoptimizer_data() { return deoptimizer_data_; } | 862 DeoptimizerData* deoptimizer_data() { return deoptimizer_data_; } |
| 863 ThreadLocalTop* thread_local_top() { return &thread_local_top_; } | 863 ThreadLocalTop* thread_local_top() { return &thread_local_top_; } |
| 864 MaterializedObjectStore* materialized_object_store() { | 864 MaterializedObjectStore* materialized_object_store() { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 877 return context_slot_cache_; | 877 return context_slot_cache_; |
| 878 } | 878 } |
| 879 | 879 |
| 880 DescriptorLookupCache* descriptor_lookup_cache() { | 880 DescriptorLookupCache* descriptor_lookup_cache() { |
| 881 return descriptor_lookup_cache_; | 881 return descriptor_lookup_cache_; |
| 882 } | 882 } |
| 883 | 883 |
| 884 HandleScopeData* handle_scope_data() { return &handle_scope_data_; } | 884 HandleScopeData* handle_scope_data() { return &handle_scope_data_; } |
| 885 | 885 |
| 886 HandleScopeImplementer* handle_scope_implementer() { | 886 HandleScopeImplementer* handle_scope_implementer() { |
| 887 ASSERT(handle_scope_implementer_); | 887 DCHECK(handle_scope_implementer_); |
| 888 return handle_scope_implementer_; | 888 return handle_scope_implementer_; |
| 889 } | 889 } |
| 890 Zone* runtime_zone() { return &runtime_zone_; } | 890 Zone* runtime_zone() { return &runtime_zone_; } |
| 891 | 891 |
| 892 UnicodeCache* unicode_cache() { | 892 UnicodeCache* unicode_cache() { |
| 893 return unicode_cache_; | 893 return unicode_cache_; |
| 894 } | 894 } |
| 895 | 895 |
| 896 InnerPointerToCodeCache* inner_pointer_to_code_cache() { | 896 InnerPointerToCodeCache* inner_pointer_to_code_cache() { |
| 897 return inner_pointer_to_code_cache_; | 897 return inner_pointer_to_code_cache_; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 966 | 966 |
| 967 Factory* factory() { return reinterpret_cast<Factory*>(this); } | 967 Factory* factory() { return reinterpret_cast<Factory*>(this); } |
| 968 | 968 |
| 969 static const int kJSRegexpStaticOffsetsVectorSize = 128; | 969 static const int kJSRegexpStaticOffsetsVectorSize = 128; |
| 970 | 970 |
| 971 THREAD_LOCAL_TOP_ACCESSOR(ExternalCallbackScope*, external_callback_scope) | 971 THREAD_LOCAL_TOP_ACCESSOR(ExternalCallbackScope*, external_callback_scope) |
| 972 | 972 |
| 973 THREAD_LOCAL_TOP_ACCESSOR(StateTag, current_vm_state) | 973 THREAD_LOCAL_TOP_ACCESSOR(StateTag, current_vm_state) |
| 974 | 974 |
| 975 void SetData(uint32_t slot, void* data) { | 975 void SetData(uint32_t slot, void* data) { |
| 976 ASSERT(slot < Internals::kNumIsolateDataSlots); | 976 DCHECK(slot < Internals::kNumIsolateDataSlots); |
| 977 embedder_data_[slot] = data; | 977 embedder_data_[slot] = data; |
| 978 } | 978 } |
| 979 void* GetData(uint32_t slot) { | 979 void* GetData(uint32_t slot) { |
| 980 ASSERT(slot < Internals::kNumIsolateDataSlots); | 980 DCHECK(slot < Internals::kNumIsolateDataSlots); |
| 981 return embedder_data_[slot]; | 981 return embedder_data_[slot]; |
| 982 } | 982 } |
| 983 | 983 |
| 984 THREAD_LOCAL_TOP_ACCESSOR(LookupResult*, top_lookup_result) | 984 THREAD_LOCAL_TOP_ACCESSOR(LookupResult*, top_lookup_result) |
| 985 | 985 |
| 986 void enable_serializer() { | 986 void enable_serializer() { |
| 987 // The serializer can only be enabled before the isolate init. | 987 // The serializer can only be enabled before the isolate init. |
| 988 ASSERT(state_ != INITIALIZED); | 988 DCHECK(state_ != INITIALIZED); |
| 989 serializer_enabled_ = true; | 989 serializer_enabled_ = true; |
| 990 } | 990 } |
| 991 | 991 |
| 992 bool serializer_enabled() const { return serializer_enabled_; } | 992 bool serializer_enabled() const { return serializer_enabled_; } |
| 993 | 993 |
| 994 bool IsDead() { return has_fatal_error_; } | 994 bool IsDead() { return has_fatal_error_; } |
| 995 void SignalFatalError() { has_fatal_error_ = true; } | 995 void SignalFatalError() { has_fatal_error_ = true; } |
| 996 | 996 |
| 997 bool use_crankshaft() const; | 997 bool use_crankshaft() const; |
| 998 | 998 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 void IterateDeferredHandles(ObjectVisitor* visitor); | 1034 void IterateDeferredHandles(ObjectVisitor* visitor); |
| 1035 void LinkDeferredHandles(DeferredHandles* deferred_handles); | 1035 void LinkDeferredHandles(DeferredHandles* deferred_handles); |
| 1036 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); | 1036 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); |
| 1037 | 1037 |
| 1038 #ifdef DEBUG | 1038 #ifdef DEBUG |
| 1039 bool IsDeferredHandle(Object** location); | 1039 bool IsDeferredHandle(Object** location); |
| 1040 #endif // DEBUG | 1040 #endif // DEBUG |
| 1041 | 1041 |
| 1042 bool concurrent_recompilation_enabled() { | 1042 bool concurrent_recompilation_enabled() { |
| 1043 // Thread is only available with flag enabled. | 1043 // Thread is only available with flag enabled. |
| 1044 ASSERT(optimizing_compiler_thread_ == NULL || | 1044 DCHECK(optimizing_compiler_thread_ == NULL || |
| 1045 FLAG_concurrent_recompilation); | 1045 FLAG_concurrent_recompilation); |
| 1046 return optimizing_compiler_thread_ != NULL; | 1046 return optimizing_compiler_thread_ != NULL; |
| 1047 } | 1047 } |
| 1048 | 1048 |
| 1049 bool concurrent_osr_enabled() const { | 1049 bool concurrent_osr_enabled() const { |
| 1050 // Thread is only available with flag enabled. | 1050 // Thread is only available with flag enabled. |
| 1051 ASSERT(optimizing_compiler_thread_ == NULL || | 1051 DCHECK(optimizing_compiler_thread_ == NULL || |
| 1052 FLAG_concurrent_recompilation); | 1052 FLAG_concurrent_recompilation); |
| 1053 return optimizing_compiler_thread_ != NULL && FLAG_concurrent_osr; | 1053 return optimizing_compiler_thread_ != NULL && FLAG_concurrent_osr; |
| 1054 } | 1054 } |
| 1055 | 1055 |
| 1056 OptimizingCompilerThread* optimizing_compiler_thread() { | 1056 OptimizingCompilerThread* optimizing_compiler_thread() { |
| 1057 return optimizing_compiler_thread_; | 1057 return optimizing_compiler_thread_; |
| 1058 } | 1058 } |
| 1059 | 1059 |
| 1060 int num_sweeper_threads() const { | 1060 int num_sweeper_threads() const { |
| 1061 return num_sweeper_threads_; | 1061 return num_sweeper_threads_; |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 }; | 1379 }; |
| 1380 | 1380 |
| 1381 | 1381 |
| 1382 class AssertNoContextChange BASE_EMBEDDED { | 1382 class AssertNoContextChange BASE_EMBEDDED { |
| 1383 #ifdef DEBUG | 1383 #ifdef DEBUG |
| 1384 public: | 1384 public: |
| 1385 explicit AssertNoContextChange(Isolate* isolate) | 1385 explicit AssertNoContextChange(Isolate* isolate) |
| 1386 : isolate_(isolate), | 1386 : isolate_(isolate), |
| 1387 context_(isolate->context(), isolate) { } | 1387 context_(isolate->context(), isolate) { } |
| 1388 ~AssertNoContextChange() { | 1388 ~AssertNoContextChange() { |
| 1389 ASSERT(isolate_->context() == *context_); | 1389 DCHECK(isolate_->context() == *context_); |
| 1390 } | 1390 } |
| 1391 | 1391 |
| 1392 private: | 1392 private: |
| 1393 Isolate* isolate_; | 1393 Isolate* isolate_; |
| 1394 Handle<Context> context_; | 1394 Handle<Context> context_; |
| 1395 #else | 1395 #else |
| 1396 public: | 1396 public: |
| 1397 explicit AssertNoContextChange(Isolate* isolate) { } | 1397 explicit AssertNoContextChange(Isolate* isolate) { } |
| 1398 #endif | 1398 #endif |
| 1399 }; | 1399 }; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 EmbeddedVector<char, 128> filename_; | 1535 EmbeddedVector<char, 128> filename_; |
| 1536 FILE* file_; | 1536 FILE* file_; |
| 1537 int scope_depth_; | 1537 int scope_depth_; |
| 1538 }; | 1538 }; |
| 1539 | 1539 |
| 1540 } } // namespace v8::internal | 1540 } } // namespace v8::internal |
| 1541 | 1541 |
| 1542 #endif // V8_ISOLATE_H_ | 1542 #endif // V8_ISOLATE_H_ |
| OLD | NEW |