OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/assembler.h" | 7 #include "src/assembler.h" |
8 #include "src/base/once.h" | 8 #include "src/base/once.h" |
9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 | 43 |
44 | 44 |
45 void V8::TearDown() { | 45 void V8::TearDown() { |
46 Bootstrapper::TearDownExtensions(); | 46 Bootstrapper::TearDownExtensions(); |
47 ElementsAccessor::TearDown(); | 47 ElementsAccessor::TearDown(); |
48 LOperand::TearDownCaches(); | 48 LOperand::TearDownCaches(); |
49 ExternalReference::TearDownMathExpData(); | 49 ExternalReference::TearDownMathExpData(); |
50 RegisteredExtension::UnregisterAll(); | 50 RegisteredExtension::UnregisterAll(); |
51 Isolate::GlobalTearDown(); | 51 Isolate::GlobalTearDown(); |
52 Sampler::TearDown(); | |
53 FlagList::ResetAllFlags(); // Frees memory held by string arguments. | 52 FlagList::ResetAllFlags(); // Frees memory held by string arguments. |
54 } | 53 } |
55 | 54 |
56 | 55 |
57 void V8::InitializeOncePerProcessImpl() { | 56 void V8::InitializeOncePerProcessImpl() { |
58 FlagList::EnforceFlagImplications(); | 57 FlagList::EnforceFlagImplications(); |
59 | 58 |
60 if (FLAG_predictable && FLAG_random_seed == 0) { | 59 if (FLAG_predictable && FLAG_random_seed == 0) { |
61 // Avoid random seeds in predictable mode. | 60 // Avoid random seeds in predictable mode. |
62 FLAG_random_seed = 12347; | 61 FLAG_random_seed = 12347; |
63 } | 62 } |
64 | 63 |
65 if (FLAG_stress_compaction) { | 64 if (FLAG_stress_compaction) { |
66 FLAG_force_marking_deque_overflows = true; | 65 FLAG_force_marking_deque_overflows = true; |
67 FLAG_gc_global = true; | 66 FLAG_gc_global = true; |
68 FLAG_max_semi_space_size = 1; | 67 FLAG_max_semi_space_size = 1; |
69 } | 68 } |
70 | 69 |
71 if (FLAG_turbo && strcmp(FLAG_turbo_filter, "~~") == 0) { | 70 if (FLAG_turbo && strcmp(FLAG_turbo_filter, "~~") == 0) { |
72 const char* filter_flag = "--turbo-filter=*"; | 71 const char* filter_flag = "--turbo-filter=*"; |
73 FlagList::SetFlagsFromString(filter_flag, StrLength(filter_flag)); | 72 FlagList::SetFlagsFromString(filter_flag, StrLength(filter_flag)); |
74 } | 73 } |
75 | 74 |
76 base::OS::Initialize(FLAG_random_seed, FLAG_hard_abort, FLAG_gc_fake_mmap); | 75 base::OS::Initialize(FLAG_random_seed, FLAG_hard_abort, FLAG_gc_fake_mmap); |
77 | 76 |
78 Isolate::InitializeOncePerProcess(); | 77 Isolate::InitializeOncePerProcess(); |
79 | 78 |
80 Sampler::SetUp(); | |
81 CpuFeatures::Probe(false); | 79 CpuFeatures::Probe(false); |
82 ElementsAccessor::InitializeOncePerProcess(); | 80 ElementsAccessor::InitializeOncePerProcess(); |
83 LOperand::SetUpCaches(); | 81 LOperand::SetUpCaches(); |
84 SetUpJSCallerSavedCodeData(); | 82 SetUpJSCallerSavedCodeData(); |
85 ExternalReference::SetUp(); | 83 ExternalReference::SetUp(); |
86 Bootstrapper::InitializeOncePerProcess(); | 84 Bootstrapper::InitializeOncePerProcess(); |
87 } | 85 } |
88 | 86 |
89 | 87 |
90 void V8::InitializeOncePerProcess() { | 88 void V8::InitializeOncePerProcess() { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 123 |
126 void V8::SetSnapshotBlob(StartupData* snapshot_blob) { | 124 void V8::SetSnapshotBlob(StartupData* snapshot_blob) { |
127 #ifdef V8_USE_EXTERNAL_STARTUP_DATA | 125 #ifdef V8_USE_EXTERNAL_STARTUP_DATA |
128 base::CallOnce(&init_snapshot_once, &SetSnapshotFromFile, snapshot_blob); | 126 base::CallOnce(&init_snapshot_once, &SetSnapshotFromFile, snapshot_blob); |
129 #else | 127 #else |
130 CHECK(false); | 128 CHECK(false); |
131 #endif | 129 #endif |
132 } | 130 } |
133 } // namespace internal | 131 } // namespace internal |
134 } // namespace v8 | 132 } // namespace v8 |
OLD | NEW |