OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_EXECUTION_H_ | 5 #ifndef V8_EXECUTION_H_ |
6 #define V8_EXECUTION_H_ | 6 #define V8_EXECUTION_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // one without the real_ prefix. | 192 // one without the real_ prefix. |
193 uintptr_t real_jslimit_; // Actual JavaScript stack limit set for the VM. | 193 uintptr_t real_jslimit_; // Actual JavaScript stack limit set for the VM. |
194 uintptr_t real_climit_; // Actual C++ stack limit set for the VM. | 194 uintptr_t real_climit_; // Actual C++ stack limit set for the VM. |
195 | 195 |
196 // jslimit_ and climit_ can be read without any lock. | 196 // jslimit_ and climit_ can be read without any lock. |
197 // Writing requires the ExecutionAccess lock. | 197 // Writing requires the ExecutionAccess lock. |
198 base::AtomicWord jslimit_; | 198 base::AtomicWord jslimit_; |
199 base::AtomicWord climit_; | 199 base::AtomicWord climit_; |
200 | 200 |
201 uintptr_t jslimit() { | 201 uintptr_t jslimit() { |
202 return bit_cast<uintptr_t>(base::NoBarrier_Load(&jslimit_)); | 202 return bit_cast<uintptr_t>(base::Relaxed_Load(&jslimit_)); |
203 } | 203 } |
204 void set_jslimit(uintptr_t limit) { | 204 void set_jslimit(uintptr_t limit) { |
205 return base::NoBarrier_Store(&jslimit_, | 205 return base::Relaxed_Store(&jslimit_, |
206 static_cast<base::AtomicWord>(limit)); | 206 static_cast<base::AtomicWord>(limit)); |
207 } | 207 } |
208 uintptr_t climit() { | 208 uintptr_t climit() { |
209 return bit_cast<uintptr_t>(base::NoBarrier_Load(&climit_)); | 209 return bit_cast<uintptr_t>(base::Relaxed_Load(&climit_)); |
210 } | 210 } |
211 void set_climit(uintptr_t limit) { | 211 void set_climit(uintptr_t limit) { |
212 return base::NoBarrier_Store(&climit_, | 212 return base::Relaxed_Store(&climit_, |
213 static_cast<base::AtomicWord>(limit)); | 213 static_cast<base::AtomicWord>(limit)); |
214 } | 214 } |
215 | 215 |
216 PostponeInterruptsScope* postpone_interrupts_; | 216 PostponeInterruptsScope* postpone_interrupts_; |
217 int interrupt_flags_; | 217 int interrupt_flags_; |
218 }; | 218 }; |
219 | 219 |
220 // TODO(isolates): Technically this could be calculated directly from a | 220 // TODO(isolates): Technically this could be calculated directly from a |
221 // pointer to StackGuard. | 221 // pointer to StackGuard. |
222 Isolate* isolate_; | 222 Isolate* isolate_; |
223 ThreadLocal thread_local_; | 223 ThreadLocal thread_local_; |
224 | 224 |
225 friend class Isolate; | 225 friend class Isolate; |
226 friend class StackLimitCheck; | 226 friend class StackLimitCheck; |
227 friend class PostponeInterruptsScope; | 227 friend class PostponeInterruptsScope; |
228 | 228 |
229 DISALLOW_COPY_AND_ASSIGN(StackGuard); | 229 DISALLOW_COPY_AND_ASSIGN(StackGuard); |
230 }; | 230 }; |
231 | 231 |
232 } // namespace internal | 232 } // namespace internal |
233 } // namespace v8 | 233 } // namespace v8 |
234 | 234 |
235 #endif // V8_EXECUTION_H_ | 235 #endif // V8_EXECUTION_H_ |
OLD | NEW |