OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 void V8::SetFatalError() { | 61 void V8::SetFatalError() { |
62 is_running_ = false; | 62 is_running_ = false; |
63 has_fatal_error_ = true; | 63 has_fatal_error_ = true; |
64 } | 64 } |
65 | 65 |
66 | 66 |
67 void V8::TearDown() { | 67 void V8::TearDown() { |
68 if (!has_been_setup_ || has_been_disposed_) return; | 68 if (!has_been_setup_ || has_been_disposed_) return; |
69 | 69 |
70 OProfileAgent::TearDown(); | 70 Isolate::TearDownAndRecreateGlobalIsolate(); |
71 | |
72 if (FLAG_preemption) { | |
73 v8::Locker locker; | |
74 v8::Locker::StopPreemption(); | |
75 } | |
76 | |
77 Builtins::TearDown(); | |
78 Isolate::Current()->bootstrapper()->TearDown(); | |
79 | |
80 Top::TearDown(); | |
81 | |
82 HeapProfiler::TearDown(); | |
83 | |
84 CpuProfiler::TearDown(); | |
85 | |
86 HEAP->TearDown(); | |
87 | |
88 Logger::TearDown(); | |
89 | 71 |
90 is_running_ = false; | 72 is_running_ = false; |
91 has_been_disposed_ = true; | 73 has_been_disposed_ = true; |
92 } | 74 } |
93 | 75 |
94 | 76 |
95 static uint32_t random_seed() { | 77 static uint32_t random_seed() { |
96 if (FLAG_random_seed == 0) { | 78 if (FLAG_random_seed == 0) { |
97 return random(); | 79 return random(); |
98 } | 80 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 129 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
148 const double binary_million = 1048576.0; | 130 const double binary_million = 1048576.0; |
149 r->double_value = binary_million; | 131 r->double_value = binary_million; |
150 r->uint64_t_value |= random_bits; | 132 r->uint64_t_value |= random_bits; |
151 r->double_value -= binary_million; | 133 r->double_value -= binary_million; |
152 | 134 |
153 return heap_number; | 135 return heap_number; |
154 } | 136 } |
155 | 137 |
156 } } // namespace v8::internal | 138 } } // namespace v8::internal |
OLD | NEW |