| OLD | NEW |
| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 V(bool, is_virtual_frame_in_spilled_scope, false) | 170 V(bool, is_virtual_frame_in_spilled_scope, false) |
| 171 | 171 |
| 172 #else | 172 #else |
| 173 | 173 |
| 174 #define ISOLATE_PLATFORM_INIT_LIST(V) | 174 #define ISOLATE_PLATFORM_INIT_LIST(V) |
| 175 | 175 |
| 176 #endif | 176 #endif |
| 177 | 177 |
| 178 #define ISOLATE_INIT_ARRAY_LIST(V) \ | 178 #define ISOLATE_INIT_ARRAY_LIST(V) \ |
| 179 /* SerializerDeserializer state. */ \ | 179 /* SerializerDeserializer state. */ \ |
| 180 V(Object*, serialize_partial_snapshot_cache, kPartialSnapshotCacheCapacity) | 180 V(Object*, serialize_partial_snapshot_cache, kPartialSnapshotCacheCapacity) \ |
| 181 V(int, jsregexp_static_offsets_vector, kJSRegexpStaticOffsetsVectorSize) |
| 181 | 182 |
| 182 #define ISOLATE_INIT_LIST(V) \ | 183 #define ISOLATE_INIT_LIST(V) \ |
| 183 /* AssertNoZoneAllocation state. */ \ | 184 /* AssertNoZoneAllocation state. */ \ |
| 184 V(bool, zone_allow_allocation, true) \ | 185 V(bool, zone_allow_allocation, true) \ |
| 185 /* SerializerDeserializer state. */ \ | 186 /* SerializerDeserializer state. */ \ |
| 186 V(int, serialize_partial_snapshot_cache_length, 0) \ | 187 V(int, serialize_partial_snapshot_cache_length, 0) \ |
| 187 /* Assembler state. */ \ | 188 /* Assembler state. */ \ |
| 188 /* A previously allocated buffer of kMinimalBufferSize bytes, or NULL. */ \ | 189 /* A previously allocated buffer of kMinimalBufferSize bytes, or NULL. */ \ |
| 189 V(byte*, assembler_spare_buffer, NULL) \ | 190 V(byte*, assembler_spare_buffer, NULL) \ |
| 190 /*This static counter ensures that NativeAllocationCheckers can be nested.*/ \ | 191 /*This static counter ensures that NativeAllocationCheckers can be nested.*/ \ |
| 191 V(int, allocation_disallowed, 0) \ | 192 V(int, allocation_disallowed, 0) \ |
| 192 V(FatalErrorCallback, exception_behavior, NULL) \ | 193 V(FatalErrorCallback, exception_behavior, NULL) \ |
| 193 V(v8::Debug::MessageHandler, message_handler, NULL) \ | 194 V(v8::Debug::MessageHandler, message_handler, NULL) \ |
| 194 /* To distinguish the function templates, so that we can find them in the */ \ | 195 /* To distinguish the function templates, so that we can find them in the */ \ |
| 195 /* function cache of the global context. */ \ | 196 /* function cache of the global context. */ \ |
| 196 V(int, next_serial_number, 0) \ | 197 V(int, next_serial_number, 0) \ |
| 198 /* State for Relocatable. */ \ |
| 199 V(Relocatable*, relocatable_top, NULL) \ |
| 200 /* State for CodeEntry in profile-generator. */ \ |
| 201 V(unsigned, code_entry_next_call_uid, NULL) \ |
| 197 ISOLATE_PLATFORM_INIT_LIST(V) | 202 ISOLATE_PLATFORM_INIT_LIST(V) |
| 198 | 203 |
| 199 class Isolate { | 204 class Isolate { |
| 200 public: | 205 public: |
| 201 ~Isolate(); | 206 ~Isolate(); |
| 202 | 207 |
| 203 enum AddressId { | 208 enum AddressId { |
| 204 #define C(name) k_##name, | 209 #define C(name) k_##name, |
| 205 ISOLATE_ADDRESS_LIST(C) | 210 ISOLATE_ADDRESS_LIST(C) |
| 206 ISOLATE_ADDRESS_LIST_PROF(C) | 211 ISOLATE_ADDRESS_LIST_PROF(C) |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 ThreadManager* thread_manager() { return thread_manager_; } | 527 ThreadManager* thread_manager() { return thread_manager_; } |
| 523 | 528 |
| 524 ContextSwitcher* context_switcher() { return context_switcher_; } | 529 ContextSwitcher* context_switcher() { return context_switcher_; } |
| 525 | 530 |
| 526 void set_context_switcher(ContextSwitcher* switcher) { | 531 void set_context_switcher(ContextSwitcher* switcher) { |
| 527 context_switcher_ = switcher; | 532 context_switcher_ = switcher; |
| 528 } | 533 } |
| 529 | 534 |
| 530 StringTracker* string_tracker() { return string_tracker_; } | 535 StringTracker* string_tracker() { return string_tracker_; } |
| 531 | 536 |
| 537 unibrow::Mapping<unibrow::Ecma262UnCanonicalize>* jsregexp_uncanonicalize() { |
| 538 return &jsregexp_uncanonicalize_; |
| 539 } |
| 540 |
| 541 unibrow::Mapping<unibrow::CanonicalizationRange>* jsregexp_canonrange() { |
| 542 return &jsregexp_canonrange_; |
| 543 } |
| 544 |
| 545 StringInputBuffer* objects_string_compare_buffer_a() { |
| 546 return &objects_string_compare_buffer_a_; |
| 547 } |
| 548 |
| 549 StringInputBuffer* objects_string_compare_buffer_b() { |
| 550 return &objects_string_compare_buffer_b_; |
| 551 } |
| 552 |
| 553 StaticResource<StringInputBuffer>* objects_string_input_buffer() { |
| 554 return &objects_string_input_buffer_; |
| 555 } |
| 556 |
| 532 void* PreallocatedStorageNew(size_t size); | 557 void* PreallocatedStorageNew(size_t size); |
| 533 void PreallocatedStorageDelete(void* p); | 558 void PreallocatedStorageDelete(void* p); |
| 534 void PreallocatedStorageInit(size_t size); | 559 void PreallocatedStorageInit(size_t size); |
| 535 | 560 |
| 536 #ifdef ENABLE_DEBUGGER_SUPPORT | 561 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 537 Debugger* debugger() { return debugger_; } | 562 Debugger* debugger() { return debugger_; } |
| 538 #endif | 563 #endif |
| 539 | 564 |
| 540 #ifdef DEBUG | 565 #ifdef DEBUG |
| 541 HistogramInfo* heap_histograms() { return heap_histograms_; } | 566 HistogramInfo* heap_histograms() { return heap_histograms_; } |
| 542 | 567 |
| 543 JSObject::SpillInformation* js_spill_information() { | 568 JSObject::SpillInformation* js_spill_information() { |
| 544 return &js_spill_information_; | 569 return &js_spill_information_; |
| 545 } | 570 } |
| 546 | 571 |
| 547 int* code_kind_statistics() { return code_kind_statistics_; } | 572 int* code_kind_statistics() { return code_kind_statistics_; } |
| 548 #endif | 573 #endif |
| 549 | 574 |
| 550 bool IsDefaultIsolate() { return this == global_isolate_; } | 575 bool IsDefaultIsolate() { return this == global_isolate_; } |
| 551 | 576 |
| 552 // SerializerDeserializer state. | 577 // SerializerDeserializer state. |
| 553 static const int kPartialSnapshotCacheCapacity = 1300; | 578 static const int kPartialSnapshotCacheCapacity = 1300; |
| 554 | 579 |
| 580 static const int kJSRegexpStaticOffsetsVectorSize = 50; |
| 581 |
| 555 static int number_of_isolates() { return number_of_isolates_; } | 582 static int number_of_isolates() { return number_of_isolates_; } |
| 556 | 583 |
| 557 // Initialize process-wide state. Generally called from a static initializer, | 584 // Initialize process-wide state. Generally called from a static initializer, |
| 558 // but may be called manually if necessary. Not thread-safe; should ideally | 585 // but may be called manually if necessary. Not thread-safe; should ideally |
| 559 // be called by the same thread responsible for static initialization. | 586 // be called by the same thread responsible for static initialization. |
| 560 static void InitOnce(); | 587 static void InitOnce(); |
| 561 | 588 |
| 562 private: | 589 private: |
| 563 Isolate(); | 590 Isolate(); |
| 564 | 591 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 ScannerCharacterClasses* scanner_character_classes_; | 649 ScannerCharacterClasses* scanner_character_classes_; |
| 623 Zone zone_; | 650 Zone zone_; |
| 624 PreallocatedStorage in_use_list_; | 651 PreallocatedStorage in_use_list_; |
| 625 PreallocatedStorage free_list_; | 652 PreallocatedStorage free_list_; |
| 626 bool preallocated_storage_preallocated_; | 653 bool preallocated_storage_preallocated_; |
| 627 StringInputBuffer* write_input_buffer_; | 654 StringInputBuffer* write_input_buffer_; |
| 628 GlobalHandles* global_handles_; | 655 GlobalHandles* global_handles_; |
| 629 ContextSwitcher* context_switcher_; | 656 ContextSwitcher* context_switcher_; |
| 630 ThreadManager* thread_manager_; | 657 ThreadManager* thread_manager_; |
| 631 StringTracker* string_tracker_; | 658 StringTracker* string_tracker_; |
| 659 unibrow::Mapping<unibrow::Ecma262UnCanonicalize> jsregexp_uncanonicalize_; |
| 660 unibrow::Mapping<unibrow::CanonicalizationRange> jsregexp_canonrange_; |
| 661 StringInputBuffer objects_string_compare_buffer_a_; |
| 662 StringInputBuffer objects_string_compare_buffer_b_; |
| 663 StaticResource<StringInputBuffer> objects_string_input_buffer_; |
| 632 | 664 |
| 633 #ifdef DEBUG | 665 #ifdef DEBUG |
| 634 // A static array of histogram info for each type. | 666 // A static array of histogram info for each type. |
| 635 HistogramInfo heap_histograms_[LAST_TYPE + 1]; | 667 HistogramInfo heap_histograms_[LAST_TYPE + 1]; |
| 636 JSObject::SpillInformation js_spill_information_; | 668 JSObject::SpillInformation js_spill_information_; |
| 637 int code_kind_statistics_[Code::NUMBER_OF_KINDS]; | 669 int code_kind_statistics_[Code::NUMBER_OF_KINDS]; |
| 638 #endif | 670 #endif |
| 639 | 671 |
| 640 #ifdef ENABLE_DEBUGGER_SUPPORT | 672 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 641 Debugger* debugger_; | 673 Debugger* debugger_; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 // Temporary macro to be used to flag classes that are completely converted | 825 // Temporary macro to be used to flag classes that are completely converted |
| 794 // to be isolate-friendly. Their mix of static/nonstatic methods/fields is | 826 // to be isolate-friendly. Their mix of static/nonstatic methods/fields is |
| 795 // correct. | 827 // correct. |
| 796 #define ISOLATED_CLASS class | 828 #define ISOLATED_CLASS class |
| 797 | 829 |
| 798 } } // namespace v8::internal | 830 } } // namespace v8::internal |
| 799 | 831 |
| 800 #include "allocation-inl.h" | 832 #include "allocation-inl.h" |
| 801 | 833 |
| 802 #endif // V8_ISOLATE_H_ | 834 #endif // V8_ISOLATE_H_ |
| OLD | NEW |