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

Side by Side Diff: src/isolate.h

Issue 1467973002: Inline Isolate::UncheckedCurrent into isolate.cc (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/isolate.cc » ('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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 474
475 // Returns the isolate inside which the current thread is running. 475 // Returns the isolate inside which the current thread is running.
476 INLINE(static Isolate* Current()) { 476 INLINE(static Isolate* Current()) {
477 DCHECK(base::NoBarrier_Load(&isolate_key_created_) == 1); 477 DCHECK(base::NoBarrier_Load(&isolate_key_created_) == 1);
478 Isolate* isolate = reinterpret_cast<Isolate*>( 478 Isolate* isolate = reinterpret_cast<Isolate*>(
479 base::Thread::GetExistingThreadLocal(isolate_key_)); 479 base::Thread::GetExistingThreadLocal(isolate_key_));
480 DCHECK(isolate != NULL); 480 DCHECK(isolate != NULL);
481 return isolate; 481 return isolate;
482 } 482 }
483 483
484 INLINE(static Isolate* UncheckedCurrent()) { 484 // Like Current, but skips the check that |isolate_key_| was initialized.
485 DCHECK(base::NoBarrier_Load(&isolate_key_created_) == 1); 485 // Callers have to ensure that themselves.
486 return reinterpret_cast<Isolate*>( 486 // DO NOT USE. The only remaining callsite will be deleted soon.
487 base::Thread::GetThreadLocal(isolate_key_));
488 }
489
490 // Like UncheckedCurrent, but skips the check that |isolate_key_| was
491 // initialized. Callers have to ensure that themselves.
492 INLINE(static Isolate* UnsafeCurrent()) { 487 INLINE(static Isolate* UnsafeCurrent()) {
493 return reinterpret_cast<Isolate*>( 488 return reinterpret_cast<Isolate*>(
494 base::Thread::GetThreadLocal(isolate_key_)); 489 base::Thread::GetThreadLocal(isolate_key_));
495 } 490 }
496 491
497 // Usually called by Init(), but can be called early e.g. to allow 492 // Usually called by Init(), but can be called early e.g. to allow
498 // testing components that require logging but not the whole 493 // testing components that require logging but not the whole
499 // isolate. 494 // isolate.
500 // 495 //
501 // Safe to call more than once. 496 // Safe to call more than once.
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 1561
1567 EmbeddedVector<char, 128> filename_; 1562 EmbeddedVector<char, 128> filename_;
1568 FILE* file_; 1563 FILE* file_;
1569 int scope_depth_; 1564 int scope_depth_;
1570 }; 1565 };
1571 1566
1572 } // namespace internal 1567 } // namespace internal
1573 } // namespace v8 1568 } // namespace v8
1574 1569
1575 #endif // V8_ISOLATE_H_ 1570 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « no previous file | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698