| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 static int GetCurrentThreadId(); | 200 static int GetCurrentThreadId(); |
| 201 | 201 |
| 202 int id_; | 202 int id_; |
| 203 | 203 |
| 204 static Atomic32 highest_thread_id_; | 204 static Atomic32 highest_thread_id_; |
| 205 | 205 |
| 206 friend class Isolate; | 206 friend class Isolate; |
| 207 }; | 207 }; |
| 208 | 208 |
| 209 | 209 |
| 210 #define FIELD_ACCESSOR(type, name) \ |
| 211 inline void set_##name(type v) { name##_ = v; } \ |
| 212 inline type name() const { return name##_; } |
| 213 |
| 214 |
| 210 class ThreadLocalTop BASE_EMBEDDED { | 215 class ThreadLocalTop BASE_EMBEDDED { |
| 211 public: | 216 public: |
| 212 // Does early low-level initialization that does not depend on the | 217 // Does early low-level initialization that does not depend on the |
| 213 // isolate being present. | 218 // isolate being present. |
| 214 ThreadLocalTop(); | 219 ThreadLocalTop(); |
| 215 | 220 |
| 216 // Initialize the thread data. | 221 // Initialize the thread data. |
| 217 void Initialize(); | 222 void Initialize(); |
| 218 | 223 |
| 219 // Get the top C++ try catch handler or NULL if none are registered. | 224 // Get the top C++ try catch handler or NULL if none are registered. |
| 220 // | 225 // |
| 221 // This method is not guarenteed to return an address that can be | 226 // This method is not guarenteed to return an address that can be |
| 222 // used for comparison with addresses into the JS stack. If such an | 227 // used for comparison with addresses into the JS stack. If such an |
| 223 // address is needed, use try_catch_handler_address. | 228 // address is needed, use try_catch_handler_address. |
| 224 v8::TryCatch* TryCatchHandler(); | 229 v8::TryCatch* TryCatchHandler(); |
| 225 | 230 |
| 226 // Get the address of the top C++ try catch handler or NULL if | 231 // Get the address of the top C++ try catch handler or NULL if |
| 227 // none are registered. | 232 // none are registered. |
| 228 // | 233 // |
| 229 // This method always returns an address that can be compared to | 234 // This method always returns an address that can be compared to |
| 230 // pointers into the JavaScript stack. When running on actual | 235 // pointers into the JavaScript stack. When running on actual |
| 231 // hardware, try_catch_handler_address and TryCatchHandler return | 236 // hardware, try_catch_handler_address and TryCatchHandler return |
| 232 // the same pointer. When running on a simulator with a separate JS | 237 // the same pointer. When running on a simulator with a separate JS |
| 233 // stack, try_catch_handler_address returns a JS stack address that | 238 // stack, try_catch_handler_address returns a JS stack address that |
| 234 // corresponds to the place on the JS stack where the C++ handler | 239 // corresponds to the place on the JS stack where the C++ handler |
| 235 // would have been if the stack were not separate. | 240 // would have been if the stack were not separate. |
| 236 inline Address try_catch_handler_address() { | 241 FIELD_ACCESSOR(Address, try_catch_handler_address) |
| 237 return try_catch_handler_address_; | |
| 238 } | |
| 239 | |
| 240 // Set the address of the top C++ try catch handler. | |
| 241 inline void set_try_catch_handler_address(Address address) { | |
| 242 try_catch_handler_address_ = address; | |
| 243 } | |
| 244 | 242 |
| 245 void Free() { | 243 void Free() { |
| 246 ASSERT(!has_pending_message_); | 244 ASSERT(!has_pending_message_); |
| 247 ASSERT(!external_caught_exception_); | 245 ASSERT(!external_caught_exception_); |
| 248 ASSERT(try_catch_handler_address_ == NULL); | 246 ASSERT(try_catch_handler_address_ == NULL); |
| 249 } | 247 } |
| 250 | 248 |
| 251 Isolate* isolate_; | 249 Isolate* isolate_; |
| 252 // 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 |
| 253 // lookups. | 251 // lookups. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 V(ExternalReferenceTable*, external_reference_table, NULL) \ | 357 V(ExternalReferenceTable*, external_reference_table, NULL) \ |
| 360 /* AstNode state. */ \ | 358 /* AstNode state. */ \ |
| 361 V(int, ast_node_id, 0) \ | 359 V(int, ast_node_id, 0) \ |
| 362 V(unsigned, ast_node_count, 0) \ | 360 V(unsigned, ast_node_count, 0) \ |
| 363 V(bool, microtask_pending, false) \ | 361 V(bool, microtask_pending, false) \ |
| 364 V(HStatistics*, hstatistics, NULL) \ | 362 V(HStatistics*, hstatistics, NULL) \ |
| 365 V(HTracer*, htracer, NULL) \ | 363 V(HTracer*, htracer, NULL) \ |
| 366 V(CodeTracer*, code_tracer, NULL) \ | 364 V(CodeTracer*, code_tracer, NULL) \ |
| 367 ISOLATE_DEBUGGER_INIT_LIST(V) | 365 ISOLATE_DEBUGGER_INIT_LIST(V) |
| 368 | 366 |
| 367 #define THREAD_LOCAL_TOP_ACCESSOR(type, name) \ |
| 368 inline void set_##name(type v) { thread_local_top_.name##_ = v; } \ |
| 369 inline type name() const { return thread_local_top_.name##_; } |
| 370 |
| 371 |
| 369 class Isolate { | 372 class Isolate { |
| 370 // These forward declarations are required to make the friend declarations in | 373 // These forward declarations are required to make the friend declarations in |
| 371 // PerIsolateThreadData work on some older versions of gcc. | 374 // PerIsolateThreadData work on some older versions of gcc. |
| 372 class ThreadDataTable; | 375 class ThreadDataTable; |
| 373 class EntryStackItem; | 376 class EntryStackItem; |
| 374 public: | 377 public: |
| 375 ~Isolate(); | 378 ~Isolate(); |
| 376 | 379 |
| 377 // A thread has a PerIsolateThreadData instance for each isolate that it has | 380 // A thread has a PerIsolateThreadData instance for each isolate that it has |
| 378 // entered. That instance is allocated when the isolate is initially entered | 381 // entered. That instance is allocated when the isolate is initially entered |
| 379 // and reused on subsequent entries. | 382 // and reused on subsequent entries. |
| 380 class PerIsolateThreadData { | 383 class PerIsolateThreadData { |
| 381 public: | 384 public: |
| 382 PerIsolateThreadData(Isolate* isolate, ThreadId thread_id) | 385 PerIsolateThreadData(Isolate* isolate, ThreadId thread_id) |
| 383 : isolate_(isolate), | 386 : isolate_(isolate), |
| 384 thread_id_(thread_id), | 387 thread_id_(thread_id), |
| 385 stack_limit_(0), | 388 stack_limit_(0), |
| 386 thread_state_(NULL), | 389 thread_state_(NULL), |
| 387 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 390 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 388 !defined(__mips__) && V8_TARGET_ARCH_MIPS | 391 !defined(__mips__) && V8_TARGET_ARCH_MIPS |
| 389 simulator_(NULL), | 392 simulator_(NULL), |
| 390 #endif | 393 #endif |
| 391 next_(NULL), | 394 next_(NULL), |
| 392 prev_(NULL) { } | 395 prev_(NULL) { } |
| 393 Isolate* isolate() const { return isolate_; } | 396 Isolate* isolate() const { return isolate_; } |
| 394 ThreadId thread_id() const { return thread_id_; } | 397 ThreadId thread_id() const { return thread_id_; } |
| 395 void set_stack_limit(uintptr_t value) { stack_limit_ = value; } | 398 |
| 396 uintptr_t stack_limit() const { return stack_limit_; } | 399 FIELD_ACCESSOR(uintptr_t, stack_limit) |
| 397 ThreadState* thread_state() const { return thread_state_; } | 400 FIELD_ACCESSOR(ThreadState*, thread_state) |
| 398 void set_thread_state(ThreadState* value) { thread_state_ = value; } | |
| 399 | 401 |
| 400 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ | 402 #if !defined(__arm__) && V8_TARGET_ARCH_ARM || \ |
| 401 !defined(__mips__) && V8_TARGET_ARCH_MIPS | 403 !defined(__mips__) && V8_TARGET_ARCH_MIPS |
| 402 Simulator* simulator() const { return simulator_; } | 404 FIELD_ACCESSOR(Simulator*, simulator) |
| 403 void set_simulator(Simulator* simulator) { | |
| 404 simulator_ = simulator; | |
| 405 } | |
| 406 #endif | 405 #endif |
| 407 | 406 |
| 408 bool Matches(Isolate* isolate, ThreadId thread_id) const { | 407 bool Matches(Isolate* isolate, ThreadId thread_id) const { |
| 409 return isolate_ == isolate && thread_id_.Equals(thread_id); | 408 return isolate_ == isolate && thread_id_.Equals(thread_id); |
| 410 } | 409 } |
| 411 | 410 |
| 412 private: | 411 private: |
| 413 Isolate* isolate_; | 412 Isolate* isolate_; |
| 414 ThreadId thread_id_; | 413 ThreadId thread_id_; |
| 415 uintptr_t stack_limit_; | 414 uintptr_t stack_limit_; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 Address get_address_from_id(AddressId id); | 533 Address get_address_from_id(AddressId id); |
| 535 | 534 |
| 536 // Access to top context (where the current function object was created). | 535 // Access to top context (where the current function object was created). |
| 537 Context* context() { return thread_local_top_.context_; } | 536 Context* context() { return thread_local_top_.context_; } |
| 538 void set_context(Context* context) { | 537 void set_context(Context* context) { |
| 539 ASSERT(context == NULL || context->IsContext()); | 538 ASSERT(context == NULL || context->IsContext()); |
| 540 thread_local_top_.context_ = context; | 539 thread_local_top_.context_ = context; |
| 541 } | 540 } |
| 542 Context** context_address() { return &thread_local_top_.context_; } | 541 Context** context_address() { return &thread_local_top_.context_; } |
| 543 | 542 |
| 544 SaveContext* save_context() { return thread_local_top_.save_context_; } | 543 THREAD_LOCAL_TOP_ACCESSOR(SaveContext*, save_context) |
| 545 void set_save_context(SaveContext* save) { | |
| 546 thread_local_top_.save_context_ = save; | |
| 547 } | |
| 548 | 544 |
| 549 // Access to current thread id. | 545 // Access to current thread id. |
| 550 ThreadId thread_id() { return thread_local_top_.thread_id_; } | 546 THREAD_LOCAL_TOP_ACCESSOR(ThreadId, thread_id) |
| 551 void set_thread_id(ThreadId id) { thread_local_top_.thread_id_ = id; } | |
| 552 | 547 |
| 553 // Interface to pending exception. | 548 // Interface to pending exception. |
| 554 MaybeObject* pending_exception() { | 549 MaybeObject* pending_exception() { |
| 555 ASSERT(has_pending_exception()); | 550 ASSERT(has_pending_exception()); |
| 556 return thread_local_top_.pending_exception_; | 551 return thread_local_top_.pending_exception_; |
| 557 } | 552 } |
| 558 bool external_caught_exception() { | 553 |
| 559 return thread_local_top_.external_caught_exception_; | |
| 560 } | |
| 561 void set_external_caught_exception(bool value) { | |
| 562 thread_local_top_.external_caught_exception_ = value; | |
| 563 } | |
| 564 void set_pending_exception(MaybeObject* exception) { | 554 void set_pending_exception(MaybeObject* exception) { |
| 565 thread_local_top_.pending_exception_ = exception; | 555 thread_local_top_.pending_exception_ = exception; |
| 566 } | 556 } |
| 557 |
| 567 void clear_pending_exception() { | 558 void clear_pending_exception() { |
| 568 thread_local_top_.pending_exception_ = heap_.the_hole_value(); | 559 thread_local_top_.pending_exception_ = heap_.the_hole_value(); |
| 569 } | 560 } |
| 561 |
| 570 MaybeObject** pending_exception_address() { | 562 MaybeObject** pending_exception_address() { |
| 571 return &thread_local_top_.pending_exception_; | 563 return &thread_local_top_.pending_exception_; |
| 572 } | 564 } |
| 565 |
| 573 bool has_pending_exception() { | 566 bool has_pending_exception() { |
| 574 return !thread_local_top_.pending_exception_->IsTheHole(); | 567 return !thread_local_top_.pending_exception_->IsTheHole(); |
| 575 } | 568 } |
| 569 |
| 570 THREAD_LOCAL_TOP_ACCESSOR(bool, external_caught_exception) |
| 571 |
| 576 void clear_pending_message() { | 572 void clear_pending_message() { |
| 577 thread_local_top_.has_pending_message_ = false; | 573 thread_local_top_.has_pending_message_ = false; |
| 578 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); | 574 thread_local_top_.pending_message_obj_ = heap_.the_hole_value(); |
| 579 thread_local_top_.pending_message_script_ = heap_.the_hole_value(); | 575 thread_local_top_.pending_message_script_ = heap_.the_hole_value(); |
| 580 } | 576 } |
| 581 v8::TryCatch* try_catch_handler() { | 577 v8::TryCatch* try_catch_handler() { |
| 582 return thread_local_top_.TryCatchHandler(); | 578 return thread_local_top_.TryCatchHandler(); |
| 583 } | 579 } |
| 584 Address try_catch_handler_address() { | 580 Address try_catch_handler_address() { |
| 585 return thread_local_top_.try_catch_handler_address(); | 581 return thread_local_top_.try_catch_handler_address(); |
| 586 } | 582 } |
| 587 bool* external_caught_exception_address() { | 583 bool* external_caught_exception_address() { |
| 588 return &thread_local_top_.external_caught_exception_; | 584 return &thread_local_top_.external_caught_exception_; |
| 589 } | 585 } |
| 590 v8::TryCatch* catcher() { | 586 |
| 591 return thread_local_top_.catcher_; | 587 THREAD_LOCAL_TOP_ACCESSOR(v8::TryCatch*, catcher) |
| 592 } | |
| 593 void set_catcher(v8::TryCatch* catcher) { | |
| 594 thread_local_top_.catcher_ = catcher; | |
| 595 } | |
| 596 | 588 |
| 597 MaybeObject** scheduled_exception_address() { | 589 MaybeObject** scheduled_exception_address() { |
| 598 return &thread_local_top_.scheduled_exception_; | 590 return &thread_local_top_.scheduled_exception_; |
| 599 } | 591 } |
| 600 | 592 |
| 601 Address pending_message_obj_address() { | 593 Address pending_message_obj_address() { |
| 602 return reinterpret_cast<Address>(&thread_local_top_.pending_message_obj_); | 594 return reinterpret_cast<Address>(&thread_local_top_.pending_message_obj_); |
| 603 } | 595 } |
| 604 | 596 |
| 605 Address has_pending_message_address() { | 597 Address has_pending_message_address() { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 }; | 693 }; |
| 702 | 694 |
| 703 void SetCaptureStackTraceForUncaughtExceptions( | 695 void SetCaptureStackTraceForUncaughtExceptions( |
| 704 bool capture, | 696 bool capture, |
| 705 int frame_limit, | 697 int frame_limit, |
| 706 StackTrace::StackTraceOptions options); | 698 StackTrace::StackTraceOptions options); |
| 707 | 699 |
| 708 // Tells whether the current context has experienced an out of memory | 700 // Tells whether the current context has experienced an out of memory |
| 709 // exception. | 701 // exception. |
| 710 bool is_out_of_memory(); | 702 bool is_out_of_memory(); |
| 711 bool ignore_out_of_memory() { | 703 |
| 712 return thread_local_top_.ignore_out_of_memory_; | 704 THREAD_LOCAL_TOP_ACCESSOR(bool, ignore_out_of_memory) |
| 713 } | |
| 714 void set_ignore_out_of_memory(bool value) { | |
| 715 thread_local_top_.ignore_out_of_memory_ = value; | |
| 716 } | |
| 717 | 705 |
| 718 void PrintCurrentStackTrace(FILE* out); | 706 void PrintCurrentStackTrace(FILE* out); |
| 719 void PrintStack(StringStream* accumulator); | 707 void PrintStack(StringStream* accumulator); |
| 720 void PrintStack(FILE* out); | 708 void PrintStack(FILE* out); |
| 721 Handle<String> StackTraceString(); | 709 Handle<String> StackTraceString(); |
| 722 NO_INLINE(void PushStackTraceAndDie(unsigned int magic, | 710 NO_INLINE(void PushStackTraceAndDie(unsigned int magic, |
| 723 Object* object, | 711 Object* object, |
| 724 Map* map, | 712 Map* map, |
| 725 unsigned int magic2)); | 713 unsigned int magic2)); |
| 726 Handle<JSArray> CaptureCurrentStackTrace( | 714 Handle<JSArray> CaptureCurrentStackTrace( |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 ConsStringIteratorOp* objects_string_compare_iterator_b() { | 919 ConsStringIteratorOp* objects_string_compare_iterator_b() { |
| 932 return &objects_string_compare_iterator_b_; | 920 return &objects_string_compare_iterator_b_; |
| 933 } | 921 } |
| 934 | 922 |
| 935 StaticResource<ConsStringIteratorOp>* objects_string_iterator() { | 923 StaticResource<ConsStringIteratorOp>* objects_string_iterator() { |
| 936 return &objects_string_iterator_; | 924 return &objects_string_iterator_; |
| 937 } | 925 } |
| 938 | 926 |
| 939 RuntimeState* runtime_state() { return &runtime_state_; } | 927 RuntimeState* runtime_state() { return &runtime_state_; } |
| 940 | 928 |
| 941 void set_fp_stubs_generated(bool value) { | 929 FIELD_ACCESSOR(bool, fp_stubs_generated); |
| 942 fp_stubs_generated_ = value; | |
| 943 } | |
| 944 | |
| 945 bool fp_stubs_generated() { return fp_stubs_generated_; } | |
| 946 | 930 |
| 947 Builtins* builtins() { return &builtins_; } | 931 Builtins* builtins() { return &builtins_; } |
| 948 | 932 |
| 949 void NotifyExtensionInstalled() { | 933 void NotifyExtensionInstalled() { |
| 950 has_installed_extensions_ = true; | 934 has_installed_extensions_ = true; |
| 951 } | 935 } |
| 952 | 936 |
| 953 bool has_installed_extensions() { return has_installed_extensions_; } | 937 bool has_installed_extensions() { return has_installed_extensions_; } |
| 954 | 938 |
| 955 unibrow::Mapping<unibrow::Ecma262Canonicalize>* | 939 unibrow::Mapping<unibrow::Ecma262Canonicalize>* |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 | 972 |
| 989 JSObject::SpillInformation* js_spill_information() { | 973 JSObject::SpillInformation* js_spill_information() { |
| 990 return &js_spill_information_; | 974 return &js_spill_information_; |
| 991 } | 975 } |
| 992 | 976 |
| 993 int* code_kind_statistics() { return code_kind_statistics_; } | 977 int* code_kind_statistics() { return code_kind_statistics_; } |
| 994 #endif | 978 #endif |
| 995 | 979 |
| 996 #if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ | 980 #if V8_TARGET_ARCH_ARM && !defined(__arm__) || \ |
| 997 V8_TARGET_ARCH_MIPS && !defined(__mips__) | 981 V8_TARGET_ARCH_MIPS && !defined(__mips__) |
| 998 bool simulator_initialized() { return simulator_initialized_; } | 982 FIELD_ACCESSOR(bool, simulator_initialized) |
| 999 void set_simulator_initialized(bool initialized) { | 983 FIELD_ACCESSOR(HashMap*, simulator_i_cache) |
| 1000 simulator_initialized_ = initialized; | 984 FIELD_ACCESSOR(Redirection*, simulator_redirection) |
| 1001 } | |
| 1002 | |
| 1003 HashMap* simulator_i_cache() { return simulator_i_cache_; } | |
| 1004 void set_simulator_i_cache(HashMap* hash_map) { | |
| 1005 simulator_i_cache_ = hash_map; | |
| 1006 } | |
| 1007 | |
| 1008 Redirection* simulator_redirection() { | |
| 1009 return simulator_redirection_; | |
| 1010 } | |
| 1011 void set_simulator_redirection(Redirection* redirection) { | |
| 1012 simulator_redirection_ = redirection; | |
| 1013 } | |
| 1014 #endif | 985 #endif |
| 1015 | 986 |
| 1016 Factory* factory() { return reinterpret_cast<Factory*>(this); } | 987 Factory* factory() { return reinterpret_cast<Factory*>(this); } |
| 1017 | 988 |
| 1018 static const int kJSRegexpStaticOffsetsVectorSize = 128; | 989 static const int kJSRegexpStaticOffsetsVectorSize = 128; |
| 1019 | 990 |
| 1020 ExternalCallbackScope* external_callback_scope() { | 991 THREAD_LOCAL_TOP_ACCESSOR(ExternalCallbackScope*, external_callback_scope) |
| 1021 return thread_local_top_.external_callback_scope_; | |
| 1022 } | |
| 1023 void set_external_callback_scope(ExternalCallbackScope* scope) { | |
| 1024 thread_local_top_.external_callback_scope_ = scope; | |
| 1025 } | |
| 1026 | 992 |
| 1027 StateTag current_vm_state() { | 993 THREAD_LOCAL_TOP_ACCESSOR(StateTag, current_vm_state) |
| 1028 return thread_local_top_.current_vm_state_; | |
| 1029 } | |
| 1030 | |
| 1031 void set_current_vm_state(StateTag state) { | |
| 1032 thread_local_top_.current_vm_state_ = state; | |
| 1033 } | |
| 1034 | 994 |
| 1035 void SetData(uint32_t slot, void* data) { | 995 void SetData(uint32_t slot, void* data) { |
| 1036 ASSERT(slot < Internals::kNumIsolateDataSlots); | 996 ASSERT(slot < Internals::kNumIsolateDataSlots); |
| 1037 embedder_data_[slot] = data; | 997 embedder_data_[slot] = data; |
| 1038 } | 998 } |
| 1039 void* GetData(uint32_t slot) { | 999 void* GetData(uint32_t slot) { |
| 1040 ASSERT(slot < Internals::kNumIsolateDataSlots); | 1000 ASSERT(slot < Internals::kNumIsolateDataSlots); |
| 1041 return embedder_data_[slot]; | 1001 return embedder_data_[slot]; |
| 1042 } | 1002 } |
| 1043 | 1003 |
| 1044 LookupResult* top_lookup_result() { | 1004 THREAD_LOCAL_TOP_ACCESSOR(LookupResult*, top_lookup_result) |
| 1045 return thread_local_top_.top_lookup_result_; | |
| 1046 } | |
| 1047 void SetTopLookupResult(LookupResult* top) { | |
| 1048 thread_local_top_.top_lookup_result_ = top; | |
| 1049 } | |
| 1050 | 1005 |
| 1051 bool IsDead() { return has_fatal_error_; } | 1006 bool IsDead() { return has_fatal_error_; } |
| 1052 void SignalFatalError() { has_fatal_error_ = true; } | 1007 void SignalFatalError() { has_fatal_error_ = true; } |
| 1053 | 1008 |
| 1054 bool use_crankshaft() const { return use_crankshaft_; } | 1009 bool use_crankshaft() const { return use_crankshaft_; } |
| 1055 | 1010 |
| 1056 bool initialized_from_snapshot() { return initialized_from_snapshot_; } | 1011 bool initialized_from_snapshot() { return initialized_from_snapshot_; } |
| 1057 | 1012 |
| 1058 double time_millis_since_init() { | 1013 double time_millis_since_init() { |
| 1059 return OS::TimeCurrentMillis() - time_millis_at_init_; | 1014 return OS::TimeCurrentMillis() - time_millis_at_init_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 1089 CallInterfaceDescriptor* call_descriptor(CallDescriptorKey index); | 1044 CallInterfaceDescriptor* call_descriptor(CallDescriptorKey index); |
| 1090 | 1045 |
| 1091 void IterateDeferredHandles(ObjectVisitor* visitor); | 1046 void IterateDeferredHandles(ObjectVisitor* visitor); |
| 1092 void LinkDeferredHandles(DeferredHandles* deferred_handles); | 1047 void LinkDeferredHandles(DeferredHandles* deferred_handles); |
| 1093 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); | 1048 void UnlinkDeferredHandles(DeferredHandles* deferred_handles); |
| 1094 | 1049 |
| 1095 #ifdef DEBUG | 1050 #ifdef DEBUG |
| 1096 bool IsDeferredHandle(Object** location); | 1051 bool IsDeferredHandle(Object** location); |
| 1097 #endif // DEBUG | 1052 #endif // DEBUG |
| 1098 | 1053 |
| 1099 int max_available_threads() const { | 1054 FIELD_ACCESSOR(int, max_available_threads); |
| 1100 return max_available_threads_; | |
| 1101 } | |
| 1102 | |
| 1103 void set_max_available_threads(int value) { | |
| 1104 max_available_threads_ = value; | |
| 1105 } | |
| 1106 | 1055 |
| 1107 bool concurrent_recompilation_enabled() { | 1056 bool concurrent_recompilation_enabled() { |
| 1108 // Thread is only available with flag enabled. | 1057 // Thread is only available with flag enabled. |
| 1109 ASSERT(optimizing_compiler_thread_ == NULL || | 1058 ASSERT(optimizing_compiler_thread_ == NULL || |
| 1110 FLAG_concurrent_recompilation); | 1059 FLAG_concurrent_recompilation); |
| 1111 return optimizing_compiler_thread_ != NULL; | 1060 return optimizing_compiler_thread_ != NULL; |
| 1112 } | 1061 } |
| 1113 | 1062 |
| 1114 bool concurrent_osr_enabled() const { | 1063 bool concurrent_osr_enabled() const { |
| 1115 // Thread is only available with flag enabled. | 1064 // Thread is only available with flag enabled. |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 friend class TestMemoryAllocatorScope; | 1345 friend class TestMemoryAllocatorScope; |
| 1397 friend class TestCodeRangeScope; | 1346 friend class TestCodeRangeScope; |
| 1398 friend class v8::Isolate; | 1347 friend class v8::Isolate; |
| 1399 friend class v8::Locker; | 1348 friend class v8::Locker; |
| 1400 friend class v8::Unlocker; | 1349 friend class v8::Unlocker; |
| 1401 | 1350 |
| 1402 DISALLOW_COPY_AND_ASSIGN(Isolate); | 1351 DISALLOW_COPY_AND_ASSIGN(Isolate); |
| 1403 }; | 1352 }; |
| 1404 | 1353 |
| 1405 | 1354 |
| 1355 #undef FIELD_ACCESSOR |
| 1356 #undef THREAD_LOCAL_TOP_ACCESSOR |
| 1357 |
| 1358 |
| 1406 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the | 1359 // If the GCC version is 4.1.x or 4.2.x an additional field is added to the |
| 1407 // class as a work around for a bug in the generated code found with these | 1360 // class as a work around for a bug in the generated code found with these |
| 1408 // versions of GCC. See V8 issue 122 for details. | 1361 // versions of GCC. See V8 issue 122 for details. |
| 1409 class SaveContext BASE_EMBEDDED { | 1362 class SaveContext BASE_EMBEDDED { |
| 1410 public: | 1363 public: |
| 1411 inline explicit SaveContext(Isolate* isolate); | 1364 inline explicit SaveContext(Isolate* isolate); |
| 1412 | 1365 |
| 1413 ~SaveContext() { | 1366 ~SaveContext() { |
| 1414 isolate_->set_context(context_.is_null() ? NULL : *context_); | 1367 isolate_->set_context(context_.is_null() ? NULL : *context_); |
| 1415 isolate_->set_save_context(prev_); | 1368 isolate_->set_save_context(prev_); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1584 } | 1537 } |
| 1585 | 1538 |
| 1586 EmbeddedVector<char, 128> filename_; | 1539 EmbeddedVector<char, 128> filename_; |
| 1587 FILE* file_; | 1540 FILE* file_; |
| 1588 int scope_depth_; | 1541 int scope_depth_; |
| 1589 }; | 1542 }; |
| 1590 | 1543 |
| 1591 } } // namespace v8::internal | 1544 } } // namespace v8::internal |
| 1592 | 1545 |
| 1593 #endif // V8_ISOLATE_H_ | 1546 #endif // V8_ISOLATE_H_ |
| OLD | NEW |