| 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 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1522 bootstrapper_(NULL), | 1522 bootstrapper_(NULL), |
| 1523 runtime_profiler_(NULL), | 1523 runtime_profiler_(NULL), |
| 1524 compilation_cache_(NULL), | 1524 compilation_cache_(NULL), |
| 1525 counters_(NULL), | 1525 counters_(NULL), |
| 1526 code_range_(NULL), | 1526 code_range_(NULL), |
| 1527 debugger_initialized_(false), | 1527 debugger_initialized_(false), |
| 1528 logger_(NULL), | 1528 logger_(NULL), |
| 1529 stats_table_(NULL), | 1529 stats_table_(NULL), |
| 1530 stub_cache_(NULL), | 1530 stub_cache_(NULL), |
| 1531 deoptimizer_data_(NULL), | 1531 deoptimizer_data_(NULL), |
| 1532 materialized_object_store_(NULL), |
| 1532 capture_stack_trace_for_uncaught_exceptions_(false), | 1533 capture_stack_trace_for_uncaught_exceptions_(false), |
| 1533 stack_trace_for_uncaught_exceptions_frame_limit_(0), | 1534 stack_trace_for_uncaught_exceptions_frame_limit_(0), |
| 1534 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), | 1535 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), |
| 1535 memory_allocator_(NULL), | 1536 memory_allocator_(NULL), |
| 1536 keyed_lookup_cache_(NULL), | 1537 keyed_lookup_cache_(NULL), |
| 1537 context_slot_cache_(NULL), | 1538 context_slot_cache_(NULL), |
| 1538 descriptor_lookup_cache_(NULL), | 1539 descriptor_lookup_cache_(NULL), |
| 1539 handle_scope_implementer_(NULL), | 1540 handle_scope_implementer_(NULL), |
| 1540 unicode_cache_(NULL), | 1541 unicode_cache_(NULL), |
| 1541 runtime_zone_(this), | 1542 runtime_zone_(this), |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1771 delete context_slot_cache_; | 1772 delete context_slot_cache_; |
| 1772 context_slot_cache_ = NULL; | 1773 context_slot_cache_ = NULL; |
| 1773 delete keyed_lookup_cache_; | 1774 delete keyed_lookup_cache_; |
| 1774 keyed_lookup_cache_ = NULL; | 1775 keyed_lookup_cache_ = NULL; |
| 1775 | 1776 |
| 1776 delete stub_cache_; | 1777 delete stub_cache_; |
| 1777 stub_cache_ = NULL; | 1778 stub_cache_ = NULL; |
| 1778 delete stats_table_; | 1779 delete stats_table_; |
| 1779 stats_table_ = NULL; | 1780 stats_table_ = NULL; |
| 1780 | 1781 |
| 1782 delete materialized_object_store_; |
| 1783 materialized_object_store_ = NULL; |
| 1784 |
| 1781 delete logger_; | 1785 delete logger_; |
| 1782 logger_ = NULL; | 1786 logger_ = NULL; |
| 1783 | 1787 |
| 1784 delete counters_; | 1788 delete counters_; |
| 1785 counters_ = NULL; | 1789 counters_ = NULL; |
| 1786 | 1790 |
| 1787 delete handle_scope_implementer_; | 1791 delete handle_scope_implementer_; |
| 1788 handle_scope_implementer_ = NULL; | 1792 handle_scope_implementer_ = NULL; |
| 1789 | 1793 |
| 1790 delete compilation_cache_; | 1794 delete compilation_cache_; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1941 context_slot_cache_ = new ContextSlotCache(); | 1945 context_slot_cache_ = new ContextSlotCache(); |
| 1942 descriptor_lookup_cache_ = new DescriptorLookupCache(); | 1946 descriptor_lookup_cache_ = new DescriptorLookupCache(); |
| 1943 unicode_cache_ = new UnicodeCache(); | 1947 unicode_cache_ = new UnicodeCache(); |
| 1944 inner_pointer_to_code_cache_ = new InnerPointerToCodeCache(this); | 1948 inner_pointer_to_code_cache_ = new InnerPointerToCodeCache(this); |
| 1945 write_iterator_ = new ConsStringIteratorOp(); | 1949 write_iterator_ = new ConsStringIteratorOp(); |
| 1946 global_handles_ = new GlobalHandles(this); | 1950 global_handles_ = new GlobalHandles(this); |
| 1947 eternal_handles_ = new EternalHandles(); | 1951 eternal_handles_ = new EternalHandles(); |
| 1948 bootstrapper_ = new Bootstrapper(this); | 1952 bootstrapper_ = new Bootstrapper(this); |
| 1949 handle_scope_implementer_ = new HandleScopeImplementer(this); | 1953 handle_scope_implementer_ = new HandleScopeImplementer(this); |
| 1950 stub_cache_ = new StubCache(this); | 1954 stub_cache_ = new StubCache(this); |
| 1955 materialized_object_store_ = new MaterializedObjectStore(this); |
| 1951 regexp_stack_ = new RegExpStack(); | 1956 regexp_stack_ = new RegExpStack(); |
| 1952 regexp_stack_->isolate_ = this; | 1957 regexp_stack_->isolate_ = this; |
| 1953 date_cache_ = new DateCache(); | 1958 date_cache_ = new DateCache(); |
| 1954 code_stub_interface_descriptors_ = | 1959 code_stub_interface_descriptors_ = |
| 1955 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; | 1960 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; |
| 1956 call_descriptors_ = | 1961 call_descriptors_ = |
| 1957 new CallInterfaceDescriptor[NUMBER_OF_CALL_DESCRIPTORS]; | 1962 new CallInterfaceDescriptor[NUMBER_OF_CALL_DESCRIPTORS]; |
| 1958 cpu_profiler_ = new CpuProfiler(this); | 1963 cpu_profiler_ = new CpuProfiler(this); |
| 1959 heap_profiler_ = new HeapProfiler(heap()); | 1964 heap_profiler_ = new HeapProfiler(heap()); |
| 1960 | 1965 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 if (create_heap_objects) { | 1999 if (create_heap_objects) { |
| 1995 // Terminate the cache array with the sentinel so we can iterate. | 2000 // Terminate the cache array with the sentinel so we can iterate. |
| 1996 PushToPartialSnapshotCache(heap_.undefined_value()); | 2001 PushToPartialSnapshotCache(heap_.undefined_value()); |
| 1997 } | 2002 } |
| 1998 | 2003 |
| 1999 InitializeThreadLocal(); | 2004 InitializeThreadLocal(); |
| 2000 | 2005 |
| 2001 bootstrapper_->Initialize(create_heap_objects); | 2006 bootstrapper_->Initialize(create_heap_objects); |
| 2002 builtins_.SetUp(this, create_heap_objects); | 2007 builtins_.SetUp(this, create_heap_objects); |
| 2003 | 2008 |
| 2004 if (create_heap_objects) heap_.CreateStubsRequiringBuiltins(); | |
| 2005 | |
| 2006 // Set default value if not yet set. | 2009 // Set default value if not yet set. |
| 2007 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults | 2010 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults |
| 2008 // once ResourceConstraints becomes an argument to the Isolate constructor. | 2011 // once ResourceConstraints becomes an argument to the Isolate constructor. |
| 2009 if (max_available_threads_ < 1) { | 2012 if (max_available_threads_ < 1) { |
| 2010 // Choose the default between 1 and 4. | 2013 // Choose the default between 1 and 4. |
| 2011 max_available_threads_ = Max(Min(CPU::NumberOfProcessorsOnline(), 4), 1); | 2014 max_available_threads_ = Max(Min(CPU::NumberOfProcessorsOnline(), 4), 1); |
| 2012 } | 2015 } |
| 2013 | 2016 |
| 2014 num_sweeper_threads_ = SweeperThread::NumberOfThreads(max_available_threads_); | 2017 num_sweeper_threads_ = SweeperThread::NumberOfThreads(max_available_threads_); |
| 2015 | 2018 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2090 kDeoptTableSerializeEntryCount - 1); | 2093 kDeoptTableSerializeEntryCount - 1); |
| 2091 } | 2094 } |
| 2092 | 2095 |
| 2093 if (!Serializer::enabled()) { | 2096 if (!Serializer::enabled()) { |
| 2094 // Ensure that all stubs which need to be generated ahead of time, but | 2097 // Ensure that all stubs which need to be generated ahead of time, but |
| 2095 // cannot be serialized into the snapshot have been generated. | 2098 // cannot be serialized into the snapshot have been generated. |
| 2096 HandleScope scope(this); | 2099 HandleScope scope(this); |
| 2097 CodeStub::GenerateFPStubs(this); | 2100 CodeStub::GenerateFPStubs(this); |
| 2098 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); | 2101 StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime(this); |
| 2099 StubFailureTrampolineStub::GenerateAheadOfTime(this); | 2102 StubFailureTrampolineStub::GenerateAheadOfTime(this); |
| 2100 StubFailureTailCallTrampolineStub::GenerateAheadOfTime(this); | |
| 2101 // TODO(mstarzinger): The following is an ugly hack to make sure the | 2103 // TODO(mstarzinger): The following is an ugly hack to make sure the |
| 2102 // interface descriptor is initialized even when stubs have been | 2104 // interface descriptor is initialized even when stubs have been |
| 2103 // deserialized out of the snapshot without the graph builder. | 2105 // deserialized out of the snapshot without the graph builder. |
| 2104 FastCloneShallowArrayStub stub(FastCloneShallowArrayStub::CLONE_ELEMENTS, | 2106 FastCloneShallowArrayStub stub(FastCloneShallowArrayStub::CLONE_ELEMENTS, |
| 2105 DONT_TRACK_ALLOCATION_SITE, 0); | 2107 DONT_TRACK_ALLOCATION_SITE, 0); |
| 2106 stub.InitializeInterfaceDescriptor( | 2108 stub.InitializeInterfaceDescriptor( |
| 2107 this, code_stub_interface_descriptor(CodeStub::FastCloneShallowArray)); | 2109 this, code_stub_interface_descriptor(CodeStub::FastCloneShallowArray)); |
| 2108 BinaryOpICStub::InstallDescriptors(this); | 2110 BinaryOpICStub::InstallDescriptors(this); |
| 2109 BinaryOpWithAllocationSiteStub::InstallDescriptors(this); | 2111 BinaryOpWithAllocationSiteStub::InstallDescriptors(this); |
| 2110 CompareNilICStub::InitializeForIsolate(this); | 2112 CompareNilICStub::InitializeForIsolate(this); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2311 | 2313 |
| 2312 #ifdef DEBUG | 2314 #ifdef DEBUG |
| 2313 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2315 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 2314 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2316 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 2315 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2317 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 2316 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2318 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 2317 #undef ISOLATE_FIELD_OFFSET | 2319 #undef ISOLATE_FIELD_OFFSET |
| 2318 #endif | 2320 #endif |
| 2319 | 2321 |
| 2320 } } // namespace v8::internal | 2322 } } // namespace v8::internal |
| OLD | NEW |