| OLD | NEW |
| 1 // Copyright 2006-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 : state_(UNINITIALIZED), | 407 : state_(UNINITIALIZED), |
| 408 entry_stack_(NULL), | 408 entry_stack_(NULL), |
| 409 stack_trace_nesting_level_(0), | 409 stack_trace_nesting_level_(0), |
| 410 incomplete_message_(NULL), | 410 incomplete_message_(NULL), |
| 411 preallocated_memory_thread_(NULL), | 411 preallocated_memory_thread_(NULL), |
| 412 preallocated_message_space_(NULL), | 412 preallocated_message_space_(NULL), |
| 413 bootstrapper_(NULL), | 413 bootstrapper_(NULL), |
| 414 runtime_profiler_(NULL), | 414 runtime_profiler_(NULL), |
| 415 compilation_cache_(NULL), | 415 compilation_cache_(NULL), |
| 416 counters_(new Counters()), | 416 counters_(new Counters()), |
| 417 cpu_features_(NULL), |
| 417 code_range_(NULL), | 418 code_range_(NULL), |
| 418 break_access_(OS::CreateMutex()), | 419 break_access_(OS::CreateMutex()), |
| 419 logger_(new Logger()), | 420 logger_(new Logger()), |
| 420 stats_table_(new StatsTable()), | 421 stats_table_(new StatsTable()), |
| 421 stub_cache_(NULL), | 422 stub_cache_(NULL), |
| 422 deoptimizer_data_(NULL), | 423 deoptimizer_data_(NULL), |
| 423 capture_stack_trace_for_uncaught_exceptions_(false), | 424 capture_stack_trace_for_uncaught_exceptions_(false), |
| 424 stack_trace_for_uncaught_exceptions_frame_limit_(0), | 425 stack_trace_for_uncaught_exceptions_frame_limit_(0), |
| 425 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), | 426 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), |
| 426 transcendental_cache_(NULL), | 427 transcendental_cache_(NULL), |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 delete stub_cache_; | 586 delete stub_cache_; |
| 586 stub_cache_ = NULL; | 587 stub_cache_ = NULL; |
| 587 delete stats_table_; | 588 delete stats_table_; |
| 588 stats_table_ = NULL; | 589 stats_table_ = NULL; |
| 589 | 590 |
| 590 delete logger_; | 591 delete logger_; |
| 591 logger_ = NULL; | 592 logger_ = NULL; |
| 592 | 593 |
| 593 delete counters_; | 594 delete counters_; |
| 594 counters_ = NULL; | 595 counters_ = NULL; |
| 596 delete cpu_features_; |
| 597 cpu_features_ = NULL; |
| 595 | 598 |
| 596 delete handle_scope_implementer_; | 599 delete handle_scope_implementer_; |
| 597 handle_scope_implementer_ = NULL; | 600 handle_scope_implementer_ = NULL; |
| 598 delete break_access_; | 601 delete break_access_; |
| 599 break_access_ = NULL; | 602 break_access_ = NULL; |
| 600 | 603 |
| 601 delete compilation_cache_; | 604 delete compilation_cache_; |
| 602 compilation_cache_ = NULL; | 605 compilation_cache_ = NULL; |
| 603 delete bootstrapper_; | 606 delete bootstrapper_; |
| 604 bootstrapper_ = NULL; | 607 bootstrapper_ = NULL; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 compilation_cache_ = new CompilationCache(this); | 673 compilation_cache_ = new CompilationCache(this); |
| 671 transcendental_cache_ = new TranscendentalCache(); | 674 transcendental_cache_ = new TranscendentalCache(); |
| 672 keyed_lookup_cache_ = new KeyedLookupCache(); | 675 keyed_lookup_cache_ = new KeyedLookupCache(); |
| 673 context_slot_cache_ = new ContextSlotCache(); | 676 context_slot_cache_ = new ContextSlotCache(); |
| 674 descriptor_lookup_cache_ = new DescriptorLookupCache(); | 677 descriptor_lookup_cache_ = new DescriptorLookupCache(); |
| 675 scanner_constants_ = new ScannerConstants(); | 678 scanner_constants_ = new ScannerConstants(); |
| 676 pc_to_code_cache_ = new PcToCodeCache(this); | 679 pc_to_code_cache_ = new PcToCodeCache(this); |
| 677 write_input_buffer_ = new StringInputBuffer(); | 680 write_input_buffer_ = new StringInputBuffer(); |
| 678 global_handles_ = new GlobalHandles(this); | 681 global_handles_ = new GlobalHandles(this); |
| 679 bootstrapper_ = new Bootstrapper(); | 682 bootstrapper_ = new Bootstrapper(); |
| 683 cpu_features_ = new CpuFeatures(); |
| 680 handle_scope_implementer_ = new HandleScopeImplementer(); | 684 handle_scope_implementer_ = new HandleScopeImplementer(); |
| 681 stub_cache_ = new StubCache(this); | 685 stub_cache_ = new StubCache(this); |
| 682 ast_sentinels_ = new AstSentinels(); | 686 ast_sentinels_ = new AstSentinels(); |
| 683 regexp_stack_ = new RegExpStack(); | 687 regexp_stack_ = new RegExpStack(); |
| 684 regexp_stack_->isolate_ = this; | 688 regexp_stack_->isolate_ = this; |
| 685 | 689 |
| 686 #ifdef ENABLE_LOGGING_AND_PROFILING | 690 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 687 producer_heap_profile_ = new ProducerHeapProfile(); | 691 producer_heap_profile_ = new ProducerHeapProfile(); |
| 688 producer_heap_profile_->isolate_ = this; | 692 producer_heap_profile_->isolate_ = this; |
| 689 #endif | 693 #endif |
| (...skipping 24 matching lines...) Expand all Loading... |
| 714 #endif | 718 #endif |
| 715 | 719 |
| 716 if (state_ == UNINITIALIZED && !PreInit()) return false; | 720 if (state_ == UNINITIALIZED && !PreInit()) return false; |
| 717 | 721 |
| 718 // Enable logging before setting up the heap | 722 // Enable logging before setting up the heap |
| 719 logger_->Setup(); | 723 logger_->Setup(); |
| 720 | 724 |
| 721 CpuProfiler::Setup(); | 725 CpuProfiler::Setup(); |
| 722 HeapProfiler::Setup(); | 726 HeapProfiler::Setup(); |
| 723 | 727 |
| 728 // Setup the platform OS support. |
| 729 OS::Setup(); |
| 730 |
| 724 // Initialize other runtime facilities | 731 // Initialize other runtime facilities |
| 725 #if defined(USE_SIMULATOR) | 732 #if defined(USE_SIMULATOR) |
| 726 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) | 733 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_MIPS) |
| 727 Simulator::Initialize(); | 734 Simulator::Initialize(); |
| 728 #endif | 735 #endif |
| 729 #endif | 736 #endif |
| 730 | 737 |
| 731 { // NOLINT | 738 { // NOLINT |
| 732 // Ensure that the thread has a valid stack guard. The v8::Locker object | 739 // Ensure that the thread has a valid stack guard. The v8::Locker object |
| 733 // will ensure this too, but we don't have to use lockers if we are only | 740 // will ensure this too, but we don't have to use lockers if we are only |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 // If we are deserializing, read the state into the now-empty heap. | 779 // If we are deserializing, read the state into the now-empty heap. |
| 773 if (des != NULL) { | 780 if (des != NULL) { |
| 774 des->Deserialize(); | 781 des->Deserialize(); |
| 775 stub_cache_->Clear(); | 782 stub_cache_->Clear(); |
| 776 } | 783 } |
| 777 | 784 |
| 778 // Deserializing may put strange things in the root array's copy of the | 785 // Deserializing may put strange things in the root array's copy of the |
| 779 // stack guard. | 786 // stack guard. |
| 780 heap_.SetStackLimits(); | 787 heap_.SetStackLimits(); |
| 781 | 788 |
| 789 // Setup the CPU support. Must be done after heap setup and after |
| 790 // any deserialization because we have to have the initial heap |
| 791 // objects in place for creating the code object used for probing. |
| 792 CPU::Setup(); |
| 793 |
| 782 deoptimizer_data_ = new DeoptimizerData; | 794 deoptimizer_data_ = new DeoptimizerData; |
| 783 runtime_profiler_ = new RuntimeProfiler(this); | 795 runtime_profiler_ = new RuntimeProfiler(this); |
| 784 runtime_profiler_->Setup(); | 796 runtime_profiler_->Setup(); |
| 785 | 797 |
| 786 // If we are deserializing, log non-function code objects and compiled | 798 // If we are deserializing, log non-function code objects and compiled |
| 787 // functions found in the snapshot. | 799 // functions found in the snapshot. |
| 788 if (des != NULL && FLAG_log_code) { | 800 if (des != NULL && FLAG_log_code) { |
| 789 HandleScope scope; | 801 HandleScope scope; |
| 790 LOG(this, LogCodeObjects()); | 802 LOG(this, LogCodeObjects()); |
| 791 LOG(this, LogCompiledFunctions()); | 803 LOG(this, LogCompiledFunctions()); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 | 886 |
| 875 #ifdef DEBUG | 887 #ifdef DEBUG |
| 876 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 888 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
| 877 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 889 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
| 878 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 890 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
| 879 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 891 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
| 880 #undef ISOLATE_FIELD_OFFSET | 892 #undef ISOLATE_FIELD_OFFSET |
| 881 #endif | 893 #endif |
| 882 | 894 |
| 883 } } // namespace v8::internal | 895 } } // namespace v8::internal |
| OLD | NEW |