Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: src/isolate.h

Issue 1897673002: Revert of Get rid of UnsafeCurrent in Sampler (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/profiler/sampler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
498 // Usually called by Init(), but can be called early e.g. to allow 506 // Usually called by Init(), but can be called early e.g. to allow
499 // testing components that require logging but not the whole 507 // testing components that require logging but not the whole
500 // isolate. 508 // isolate.
501 // 509 //
502 // Safe to call more than once. 510 // Safe to call more than once.
503 void InitializeLoggingAndCounters(); 511 void InitializeLoggingAndCounters();
504 512
505 bool Init(Deserializer* des); 513 bool Init(Deserializer* des);
506 514
507 // True if at least one thread Enter'ed this isolate. 515 // True if at least one thread Enter'ed this isolate.
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 1588
1581 EmbeddedVector<char, 128> filename_; 1589 EmbeddedVector<char, 128> filename_;
1582 FILE* file_; 1590 FILE* file_;
1583 int scope_depth_; 1591 int scope_depth_;
1584 }; 1592 };
1585 1593
1586 } // namespace internal 1594 } // namespace internal
1587 } // namespace v8 1595 } // namespace v8
1588 1596
1589 #endif // V8_ISOLATE_H_ 1597 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « no previous file | src/profiler/sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698