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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 has_fatal_error_ = true; | 99 has_fatal_error_ = true; |
100 } | 100 } |
101 | 101 |
102 | 102 |
103 void V8::TearDown() { | 103 void V8::TearDown() { |
104 Isolate* isolate = Isolate::Current(); | 104 Isolate* isolate = Isolate::Current(); |
105 ASSERT(isolate->IsDefaultIsolate()); | 105 ASSERT(isolate->IsDefaultIsolate()); |
106 | 106 |
107 if (!has_been_set_up_ || has_been_disposed_) return; | 107 if (!has_been_set_up_ || has_been_disposed_) return; |
108 | 108 |
| 109 // The isolate has to be torn down before clearing the LOperand |
| 110 // caches so that the optimizing compiler thread (if running) |
| 111 // doesn't see an inconsistent view of the lithium instructions. |
| 112 isolate->TearDown(); |
| 113 delete isolate; |
| 114 |
109 ElementsAccessor::TearDown(); | 115 ElementsAccessor::TearDown(); |
110 LOperand::TearDownCaches(); | 116 LOperand::TearDownCaches(); |
111 RegisteredExtension::UnregisterAll(); | 117 RegisteredExtension::UnregisterAll(); |
112 | 118 |
113 isolate->TearDown(); | |
114 delete isolate; | |
115 | |
116 is_running_ = false; | 119 is_running_ = false; |
117 has_been_disposed_ = true; | 120 has_been_disposed_ = true; |
118 | 121 |
119 delete call_completed_callbacks_; | 122 delete call_completed_callbacks_; |
120 call_completed_callbacks_ = NULL; | 123 call_completed_callbacks_ = NULL; |
121 | 124 |
122 OS::TearDown(); | 125 OS::TearDown(); |
123 } | 126 } |
124 | 127 |
125 | 128 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 SetUpJSCallerSavedCodeData(); | 282 SetUpJSCallerSavedCodeData(); |
280 SamplerRegistry::SetUp(); | 283 SamplerRegistry::SetUp(); |
281 ExternalReference::SetUp(); | 284 ExternalReference::SetUp(); |
282 } | 285 } |
283 | 286 |
284 void V8::InitializeOncePerProcess() { | 287 void V8::InitializeOncePerProcess() { |
285 CallOnce(&init_once, &InitializeOncePerProcessImpl); | 288 CallOnce(&init_once, &InitializeOncePerProcessImpl); |
286 } | 289 } |
287 | 290 |
288 } } // namespace v8::internal | 291 } } // namespace v8::internal |
OLD | NEW |