OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1407 write_input_buffer_(NULL), | 1407 write_input_buffer_(NULL), |
1408 global_handles_(NULL), | 1408 global_handles_(NULL), |
1409 context_switcher_(NULL), | 1409 context_switcher_(NULL), |
1410 thread_manager_(NULL), | 1410 thread_manager_(NULL), |
1411 string_tracker_(NULL), | 1411 string_tracker_(NULL), |
1412 regexp_stack_(NULL), | 1412 regexp_stack_(NULL), |
1413 embedder_data_(NULL) { | 1413 embedder_data_(NULL) { |
1414 TRACE_ISOLATE(constructor); | 1414 TRACE_ISOLATE(constructor); |
1415 | 1415 |
1416 memset(isolate_addresses_, 0, | 1416 memset(isolate_addresses_, 0, |
1417 sizeof(isolate_addresses_[0]) * (k_isolate_address_count + 1)); | 1417 sizeof(isolate_addresses_[0]) * (kIsolateAddressCount + 1)); |
1418 | 1418 |
1419 heap_.isolate_ = this; | 1419 heap_.isolate_ = this; |
1420 zone_.isolate_ = this; | 1420 zone_.isolate_ = this; |
1421 stack_guard_.isolate_ = this; | 1421 stack_guard_.isolate_ = this; |
1422 | 1422 |
1423 // ThreadManager is initialized early to support locking an isolate | 1423 // ThreadManager is initialized early to support locking an isolate |
1424 // before it is entered. | 1424 // before it is entered. |
1425 thread_manager_ = new ThreadManager(); | 1425 thread_manager_ = new ThreadManager(); |
1426 thread_manager_->isolate_ = this; | 1426 thread_manager_->isolate_ = this; |
1427 | 1427 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 | 1679 |
1680 InitializeDebugger(); | 1680 InitializeDebugger(); |
1681 | 1681 |
1682 memory_allocator_ = new MemoryAllocator(this); | 1682 memory_allocator_ = new MemoryAllocator(this); |
1683 code_range_ = new CodeRange(this); | 1683 code_range_ = new CodeRange(this); |
1684 | 1684 |
1685 // Safe after setting Heap::isolate_, initializing StackGuard and | 1685 // Safe after setting Heap::isolate_, initializing StackGuard and |
1686 // ensuring that Isolate::Current() == this. | 1686 // ensuring that Isolate::Current() == this. |
1687 heap_.SetStackLimits(); | 1687 heap_.SetStackLimits(); |
1688 | 1688 |
1689 #define C(name) isolate_addresses_[Isolate::k_##name] = \ | 1689 #define ASSIGN_ELEMENT(CamelName, hacker_name) \ |
1690 reinterpret_cast<Address>(name()); | 1690 isolate_addresses_[Isolate::k##CamelName##Address] = \ |
1691 ISOLATE_ADDRESS_LIST(C) | 1691 reinterpret_cast<Address>(hacker_name##_address()); |
| 1692 FOR_EACH_ISOLATE_ADDRESS_NAME(ASSIGN_ELEMENT) |
1692 #undef C | 1693 #undef C |
1693 | 1694 |
1694 string_tracker_ = new StringTracker(); | 1695 string_tracker_ = new StringTracker(); |
1695 string_tracker_->isolate_ = this; | 1696 string_tracker_->isolate_ = this; |
1696 compilation_cache_ = new CompilationCache(this); | 1697 compilation_cache_ = new CompilationCache(this); |
1697 transcendental_cache_ = new TranscendentalCache(); | 1698 transcendental_cache_ = new TranscendentalCache(); |
1698 keyed_lookup_cache_ = new KeyedLookupCache(); | 1699 keyed_lookup_cache_ = new KeyedLookupCache(); |
1699 context_slot_cache_ = new ContextSlotCache(); | 1700 context_slot_cache_ = new ContextSlotCache(); |
1700 descriptor_lookup_cache_ = new DescriptorLookupCache(); | 1701 descriptor_lookup_cache_ = new DescriptorLookupCache(); |
1701 unicode_cache_ = new UnicodeCache(); | 1702 unicode_cache_ = new UnicodeCache(); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1871 | 1872 |
1872 #ifdef DEBUG | 1873 #ifdef DEBUG |
1873 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1874 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
1874 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1875 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
1875 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1876 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
1876 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1877 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
1877 #undef ISOLATE_FIELD_OFFSET | 1878 #undef ISOLATE_FIELD_OFFSET |
1878 #endif | 1879 #endif |
1879 | 1880 |
1880 } } // namespace v8::internal | 1881 } } // namespace v8::internal |
OLD | NEW |