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 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1544 write_iterator_(NULL), | 1544 write_iterator_(NULL), |
1545 global_handles_(NULL), | 1545 global_handles_(NULL), |
1546 eternal_handles_(NULL), | 1546 eternal_handles_(NULL), |
1547 thread_manager_(NULL), | 1547 thread_manager_(NULL), |
1548 fp_stubs_generated_(false), | 1548 fp_stubs_generated_(false), |
1549 has_installed_extensions_(false), | 1549 has_installed_extensions_(false), |
1550 string_tracker_(NULL), | 1550 string_tracker_(NULL), |
1551 regexp_stack_(NULL), | 1551 regexp_stack_(NULL), |
1552 date_cache_(NULL), | 1552 date_cache_(NULL), |
1553 code_stub_interface_descriptors_(NULL), | 1553 code_stub_interface_descriptors_(NULL), |
1554 call_descriptors_(NULL), | |
1554 // TODO(bmeurer) Initialized lazily because it depends on flags; can | 1555 // TODO(bmeurer) Initialized lazily because it depends on flags; can |
1555 // be fixed once the default isolate cleanup is done. | 1556 // be fixed once the default isolate cleanup is done. |
1556 random_number_generator_(NULL), | 1557 random_number_generator_(NULL), |
1557 has_fatal_error_(false), | 1558 has_fatal_error_(false), |
1558 use_crankshaft_(true), | 1559 use_crankshaft_(true), |
1559 initialized_from_snapshot_(false), | 1560 initialized_from_snapshot_(false), |
1560 cpu_profiler_(NULL), | 1561 cpu_profiler_(NULL), |
1561 heap_profiler_(NULL), | 1562 heap_profiler_(NULL), |
1562 function_entry_hook_(NULL), | 1563 function_entry_hook_(NULL), |
1563 deferred_handles_head_(NULL), | 1564 deferred_handles_head_(NULL), |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1752 | 1753 |
1753 delete unicode_cache_; | 1754 delete unicode_cache_; |
1754 unicode_cache_ = NULL; | 1755 unicode_cache_ = NULL; |
1755 | 1756 |
1756 delete date_cache_; | 1757 delete date_cache_; |
1757 date_cache_ = NULL; | 1758 date_cache_ = NULL; |
1758 | 1759 |
1759 delete[] code_stub_interface_descriptors_; | 1760 delete[] code_stub_interface_descriptors_; |
1760 code_stub_interface_descriptors_ = NULL; | 1761 code_stub_interface_descriptors_ = NULL; |
1761 | 1762 |
1763 delete[]call_descriptors_; | |
Toon Verwaest
2013/12/18 16:11:41
nit: space after [].
Jarin
2013/12/30 15:15:47
Done.
| |
1764 call_descriptors_ = NULL; | |
1765 | |
1762 delete regexp_stack_; | 1766 delete regexp_stack_; |
1763 regexp_stack_ = NULL; | 1767 regexp_stack_ = NULL; |
1764 | 1768 |
1765 delete descriptor_lookup_cache_; | 1769 delete descriptor_lookup_cache_; |
1766 descriptor_lookup_cache_ = NULL; | 1770 descriptor_lookup_cache_ = NULL; |
1767 delete context_slot_cache_; | 1771 delete context_slot_cache_; |
1768 context_slot_cache_ = NULL; | 1772 context_slot_cache_ = NULL; |
1769 delete keyed_lookup_cache_; | 1773 delete keyed_lookup_cache_; |
1770 keyed_lookup_cache_ = NULL; | 1774 keyed_lookup_cache_ = NULL; |
1771 | 1775 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1945 global_handles_ = new GlobalHandles(this); | 1949 global_handles_ = new GlobalHandles(this); |
1946 eternal_handles_ = new EternalHandles(); | 1950 eternal_handles_ = new EternalHandles(); |
1947 bootstrapper_ = new Bootstrapper(this); | 1951 bootstrapper_ = new Bootstrapper(this); |
1948 handle_scope_implementer_ = new HandleScopeImplementer(this); | 1952 handle_scope_implementer_ = new HandleScopeImplementer(this); |
1949 stub_cache_ = new StubCache(this); | 1953 stub_cache_ = new StubCache(this); |
1950 regexp_stack_ = new RegExpStack(); | 1954 regexp_stack_ = new RegExpStack(); |
1951 regexp_stack_->isolate_ = this; | 1955 regexp_stack_->isolate_ = this; |
1952 date_cache_ = new DateCache(); | 1956 date_cache_ = new DateCache(); |
1953 code_stub_interface_descriptors_ = | 1957 code_stub_interface_descriptors_ = |
1954 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; | 1958 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; |
1959 call_descriptors_ = | |
1960 new CodeStubInterfaceDescriptor[NUMBER_OF_CALL_DESCRIPTORS]; | |
1955 cpu_profiler_ = new CpuProfiler(this); | 1961 cpu_profiler_ = new CpuProfiler(this); |
1956 heap_profiler_ = new HeapProfiler(heap()); | 1962 heap_profiler_ = new HeapProfiler(heap()); |
1957 | 1963 |
1958 // Enable logging before setting up the heap | 1964 // Enable logging before setting up the heap |
1959 logger_->SetUp(this); | 1965 logger_->SetUp(this); |
1960 | 1966 |
1961 // Initialize other runtime facilities | 1967 // Initialize other runtime facilities |
1962 #if defined(USE_SIMULATOR) | 1968 #if defined(USE_SIMULATOR) |
1963 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS | 1969 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS |
1964 Simulator::Initialize(this); | 1970 Simulator::Initialize(this); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2105 BinaryOpICStub::InstallDescriptors(this); | 2111 BinaryOpICStub::InstallDescriptors(this); |
2106 CompareNilICStub::InitializeForIsolate(this); | 2112 CompareNilICStub::InitializeForIsolate(this); |
2107 ToBooleanStub::InitializeForIsolate(this); | 2113 ToBooleanStub::InitializeForIsolate(this); |
2108 ArrayConstructorStubBase::InstallDescriptors(this); | 2114 ArrayConstructorStubBase::InstallDescriptors(this); |
2109 InternalArrayConstructorStubBase::InstallDescriptors(this); | 2115 InternalArrayConstructorStubBase::InstallDescriptors(this); |
2110 FastNewClosureStub::InstallDescriptors(this); | 2116 FastNewClosureStub::InstallDescriptors(this); |
2111 NumberToStringStub::InstallDescriptors(this); | 2117 NumberToStringStub::InstallDescriptors(this); |
2112 NewStringAddStub::InstallDescriptors(this); | 2118 NewStringAddStub::InstallDescriptors(this); |
2113 } | 2119 } |
2114 | 2120 |
2121 CallDescriptors::InitializeForIsolate(this); | |
2122 | |
2115 initialized_from_snapshot_ = (des != NULL); | 2123 initialized_from_snapshot_ = (des != NULL); |
2116 | 2124 |
2117 return true; | 2125 return true; |
2118 } | 2126 } |
2119 | 2127 |
2120 | 2128 |
2121 // Initialized lazily to allow early | 2129 // Initialized lazily to allow early |
2122 // v8::V8::SetAddHistogramSampleFunction calls. | 2130 // v8::V8::SetAddHistogramSampleFunction calls. |
2123 StatsTable* Isolate::stats_table() { | 2131 StatsTable* Isolate::stats_table() { |
2124 if (stats_table_ == NULL) { | 2132 if (stats_table_ == NULL) { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2282 return initial_object_proto->GetPrototype()->IsNull(); | 2290 return initial_object_proto->GetPrototype()->IsNull(); |
2283 } | 2291 } |
2284 | 2292 |
2285 | 2293 |
2286 CodeStubInterfaceDescriptor* | 2294 CodeStubInterfaceDescriptor* |
2287 Isolate::code_stub_interface_descriptor(int index) { | 2295 Isolate::code_stub_interface_descriptor(int index) { |
2288 return code_stub_interface_descriptors_ + index; | 2296 return code_stub_interface_descriptors_ + index; |
2289 } | 2297 } |
2290 | 2298 |
2291 | 2299 |
2300 CodeStubInterfaceDescriptor* | |
2301 Isolate::call_descriptor(CallDescriptorKey index) { | |
2302 ASSERT(0 <= index && index < NUMBER_OF_CALL_DESCRIPTORS); | |
2303 return &call_descriptors_[index]; | |
2304 } | |
2305 | |
2306 | |
2292 Object* Isolate::FindCodeObject(Address a) { | 2307 Object* Isolate::FindCodeObject(Address a) { |
2293 return inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer(a); | 2308 return inner_pointer_to_code_cache()->GcSafeFindCodeForInnerPointer(a); |
2294 } | 2309 } |
2295 | 2310 |
2296 | 2311 |
2297 #ifdef DEBUG | 2312 #ifdef DEBUG |
2298 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2313 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2299 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2314 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2300 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2315 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2301 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2316 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2302 #undef ISOLATE_FIELD_OFFSET | 2317 #undef ISOLATE_FIELD_OFFSET |
2303 #endif | 2318 #endif |
2304 | 2319 |
2305 } } // namespace v8::internal | 2320 } } // namespace v8::internal |
OLD | NEW |