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 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 memset(&js_spill_information_, 0, sizeof(js_spill_information_)); | 1438 memset(&js_spill_information_, 0, sizeof(js_spill_information_)); |
1439 memset(code_kind_statistics_, 0, | 1439 memset(code_kind_statistics_, 0, |
1440 sizeof(code_kind_statistics_[0]) * Code::NUMBER_OF_KINDS); | 1440 sizeof(code_kind_statistics_[0]) * Code::NUMBER_OF_KINDS); |
1441 #endif | 1441 #endif |
1442 | 1442 |
1443 #ifdef ENABLE_DEBUGGER_SUPPORT | 1443 #ifdef ENABLE_DEBUGGER_SUPPORT |
1444 debug_ = NULL; | 1444 debug_ = NULL; |
1445 debugger_ = NULL; | 1445 debugger_ = NULL; |
1446 #endif | 1446 #endif |
1447 | 1447 |
1448 #ifdef ENABLE_LOGGING_AND_PROFILING | |
1449 producer_heap_profile_ = NULL; | |
1450 #endif | |
1451 | |
1452 handle_scope_data_.Initialize(); | 1448 handle_scope_data_.Initialize(); |
1453 | 1449 |
1454 #define ISOLATE_INIT_EXECUTE(type, name, initial_value) \ | 1450 #define ISOLATE_INIT_EXECUTE(type, name, initial_value) \ |
1455 name##_ = (initial_value); | 1451 name##_ = (initial_value); |
1456 ISOLATE_INIT_LIST(ISOLATE_INIT_EXECUTE) | 1452 ISOLATE_INIT_LIST(ISOLATE_INIT_EXECUTE) |
1457 #undef ISOLATE_INIT_EXECUTE | 1453 #undef ISOLATE_INIT_EXECUTE |
1458 | 1454 |
1459 #define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length) \ | 1455 #define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length) \ |
1460 memset(name##_, 0, sizeof(type) * length); | 1456 memset(name##_, 0, sizeof(type) * length); |
1461 ISOLATE_INIT_ARRAY_LIST(ISOLATE_INIT_ARRAY_EXECUTE) | 1457 ISOLATE_INIT_ARRAY_LIST(ISOLATE_INIT_ARRAY_EXECUTE) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 void Isolate::SetIsolateThreadLocals(Isolate* isolate, | 1526 void Isolate::SetIsolateThreadLocals(Isolate* isolate, |
1531 PerIsolateThreadData* data) { | 1527 PerIsolateThreadData* data) { |
1532 Thread::SetThreadLocal(isolate_key_, isolate); | 1528 Thread::SetThreadLocal(isolate_key_, isolate); |
1533 Thread::SetThreadLocal(per_isolate_thread_data_key_, data); | 1529 Thread::SetThreadLocal(per_isolate_thread_data_key_, data); |
1534 } | 1530 } |
1535 | 1531 |
1536 | 1532 |
1537 Isolate::~Isolate() { | 1533 Isolate::~Isolate() { |
1538 TRACE_ISOLATE(destructor); | 1534 TRACE_ISOLATE(destructor); |
1539 | 1535 |
1540 #ifdef ENABLE_LOGGING_AND_PROFILING | |
1541 delete producer_heap_profile_; | |
1542 producer_heap_profile_ = NULL; | |
1543 #endif | |
1544 | |
1545 delete unicode_cache_; | 1536 delete unicode_cache_; |
1546 unicode_cache_ = NULL; | 1537 unicode_cache_ = NULL; |
1547 | 1538 |
1548 delete regexp_stack_; | 1539 delete regexp_stack_; |
1549 regexp_stack_ = NULL; | 1540 regexp_stack_ = NULL; |
1550 | 1541 |
1551 delete ast_sentinels_; | 1542 delete ast_sentinels_; |
1552 ast_sentinels_ = NULL; | 1543 ast_sentinels_ = NULL; |
1553 | 1544 |
1554 delete descriptor_lookup_cache_; | 1545 delete descriptor_lookup_cache_; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 pc_to_code_cache_ = new PcToCodeCache(this); | 1641 pc_to_code_cache_ = new PcToCodeCache(this); |
1651 write_input_buffer_ = new StringInputBuffer(); | 1642 write_input_buffer_ = new StringInputBuffer(); |
1652 global_handles_ = new GlobalHandles(this); | 1643 global_handles_ = new GlobalHandles(this); |
1653 bootstrapper_ = new Bootstrapper(); | 1644 bootstrapper_ = new Bootstrapper(); |
1654 handle_scope_implementer_ = new HandleScopeImplementer(this); | 1645 handle_scope_implementer_ = new HandleScopeImplementer(this); |
1655 stub_cache_ = new StubCache(this); | 1646 stub_cache_ = new StubCache(this); |
1656 ast_sentinels_ = new AstSentinels(); | 1647 ast_sentinels_ = new AstSentinels(); |
1657 regexp_stack_ = new RegExpStack(); | 1648 regexp_stack_ = new RegExpStack(); |
1658 regexp_stack_->isolate_ = this; | 1649 regexp_stack_->isolate_ = this; |
1659 | 1650 |
1660 #ifdef ENABLE_LOGGING_AND_PROFILING | |
1661 producer_heap_profile_ = new ProducerHeapProfile(); | |
1662 producer_heap_profile_->isolate_ = this; | |
1663 #endif | |
1664 | |
1665 state_ = PREINITIALIZED; | 1651 state_ = PREINITIALIZED; |
1666 return true; | 1652 return true; |
1667 } | 1653 } |
1668 | 1654 |
1669 | 1655 |
1670 void Isolate::InitializeThreadLocal() { | 1656 void Isolate::InitializeThreadLocal() { |
1671 thread_local_top_.isolate_ = this; | 1657 thread_local_top_.isolate_ = this; |
1672 thread_local_top_.Initialize(); | 1658 thread_local_top_.Initialize(); |
1673 clear_pending_exception(); | 1659 clear_pending_exception(); |
1674 clear_pending_message(); | 1660 clear_pending_message(); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 | 1862 |
1877 #ifdef DEBUG | 1863 #ifdef DEBUG |
1878 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 1864 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
1879 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 1865 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
1880 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 1866 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
1881 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 1867 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
1882 #undef ISOLATE_FIELD_OFFSET | 1868 #undef ISOLATE_FIELD_OFFSET |
1883 #endif | 1869 #endif |
1884 | 1870 |
1885 } } // namespace v8::internal | 1871 } } // namespace v8::internal |
OLD | NEW |