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 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 488 |
489 // Returns the isolate inside which the current thread is running. | 489 // Returns the isolate inside which the current thread is running. |
490 INLINE(static Isolate* Current()) { | 490 INLINE(static Isolate* Current()) { |
491 DCHECK(base::NoBarrier_Load(&isolate_key_created_) == 1); | 491 DCHECK(base::NoBarrier_Load(&isolate_key_created_) == 1); |
492 Isolate* isolate = reinterpret_cast<Isolate*>( | 492 Isolate* isolate = reinterpret_cast<Isolate*>( |
493 base::Thread::GetExistingThreadLocal(isolate_key_)); | 493 base::Thread::GetExistingThreadLocal(isolate_key_)); |
494 DCHECK(isolate != NULL); | 494 DCHECK(isolate != NULL); |
495 return isolate; | 495 return isolate; |
496 } | 496 } |
497 | 497 |
498 // Like Current, but skips the check that |isolate_key_| was initialized. | |
499 // Callers have to ensure that themselves. | |
500 // DO NOT USE. The only remaining callsite will be deleted soon. | |
501 INLINE(static Isolate* UnsafeCurrent()) { | |
502 return reinterpret_cast<Isolate*>( | |
503 base::Thread::GetThreadLocal(isolate_key_)); | |
504 } | |
505 | |
506 // Usually called by Init(), but can be called early e.g. to allow | 498 // Usually called by Init(), but can be called early e.g. to allow |
507 // testing components that require logging but not the whole | 499 // testing components that require logging but not the whole |
508 // isolate. | 500 // isolate. |
509 // | 501 // |
510 // Safe to call more than once. | 502 // Safe to call more than once. |
511 void InitializeLoggingAndCounters(); | 503 void InitializeLoggingAndCounters(); |
512 | 504 |
513 bool Init(Deserializer* des); | 505 bool Init(Deserializer* des); |
514 | 506 |
515 // True if at least one thread Enter'ed this isolate. | 507 // True if at least one thread Enter'ed this isolate. |
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1588 | 1580 |
1589 EmbeddedVector<char, 128> filename_; | 1581 EmbeddedVector<char, 128> filename_; |
1590 FILE* file_; | 1582 FILE* file_; |
1591 int scope_depth_; | 1583 int scope_depth_; |
1592 }; | 1584 }; |
1593 | 1585 |
1594 } // namespace internal | 1586 } // namespace internal |
1595 } // namespace v8 | 1587 } // namespace v8 |
1596 | 1588 |
1597 #endif // V8_ISOLATE_H_ | 1589 #endif // V8_ISOLATE_H_ |
OLD | NEW |