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

Side by Side Diff: src/isolate.h

Issue 4046005: [Isolates] Always inline Isolate::Current(). (Closed)
Patch Set: Created 10 years, 2 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 }; 368 };
369 369
370 // Returns the PerIsolateThreadData for the current thread (or NULL if one is 370 // Returns the PerIsolateThreadData for the current thread (or NULL if one is
371 // not currently set). 371 // not currently set).
372 static PerIsolateThreadData* CurrentPerIsolateThreadData() { 372 static PerIsolateThreadData* CurrentPerIsolateThreadData() {
373 return reinterpret_cast<PerIsolateThreadData*>( 373 return reinterpret_cast<PerIsolateThreadData*>(
374 Thread::GetThreadLocal(per_isolate_thread_data_key_)); 374 Thread::GetThreadLocal(per_isolate_thread_data_key_));
375 } 375 }
376 376
377 // Returns the isolate inside which the current thread is running. 377 // Returns the isolate inside which the current thread is running.
378 static Isolate* Current() { 378 INLINE(static Isolate* Current()) {
379 Isolate* tls_isolate = reinterpret_cast<Isolate*>( 379 Isolate* isolate = UncheckedCurrent();
380 Thread::GetThreadLocal(isolate_key_)); 380 ASSERT(isolate != NULL);
381 ASSERT(tls_isolate != NULL); 381 return isolate;
382 return tls_isolate;
383 } 382 }
384 383
385 static Isolate* UncheckedCurrent() { 384 INLINE(static Isolate* UncheckedCurrent()) {
386 return reinterpret_cast<Isolate*>(Thread::GetThreadLocal(isolate_key_)); 385 return reinterpret_cast<Isolate*>(Thread::GetThreadLocal(isolate_key_));
387 } 386 }
388 387
389 bool Init(Deserializer* des); 388 bool Init(Deserializer* des);
390 389
391 bool IsInitialized() { return state_ == INITIALIZED; } 390 bool IsInitialized() { return state_ == INITIALIZED; }
392 391
393 // True if at least one thread Enter'ed this isolate. 392 // True if at least one thread Enter'ed this isolate.
394 bool IsInUse() { return entry_stack_ != NULL; } 393 bool IsInUse() { return entry_stack_ != NULL; }
395 394
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1193 #define ISOLATED_CLASS class 1192 #define ISOLATED_CLASS class
1194 1193
1195 } } // namespace v8::internal 1194 } } // namespace v8::internal
1196 1195
1197 // TODO(isolates): Get rid of these -inl.h includes and place them only where 1196 // TODO(isolates): Get rid of these -inl.h includes and place them only where
1198 // they're needed. 1197 // they're needed.
1199 #include "allocation-inl.h" 1198 #include "allocation-inl.h"
1200 #include "zone-inl.h" 1199 #include "zone-inl.h"
1201 1200
1202 #endif // V8_ISOLATE_H_ 1201 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698