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

Side by Side Diff: runtime/vm/thread.h

Issue 1156593002: Cache current thread in a reserved register and use it in LoadIsolate (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added more comments. Created 5 years, 7 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
« runtime/vm/stub_code_ia32.cc ('K') | « runtime/vm/stub_code_x64.cc ('k') | 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 (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_THREAD_H_ 5 #ifndef VM_THREAD_H_
6 #define VM_THREAD_H_ 6 #define VM_THREAD_H_
7 7
8 #include "vm/base_isolate.h" 8 #include "vm/base_isolate.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/os_thread.h" 10 #include "vm/os_thread.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // Called at VM startup. 49 // Called at VM startup.
50 static void InitOnce(); 50 static void InitOnce();
51 51
52 // The topmost zone used for allocation in this thread. 52 // The topmost zone used for allocation in this thread.
53 Zone* zone() { 53 Zone* zone() {
54 return reinterpret_cast<BaseIsolate*>(isolate())->current_zone(); 54 return reinterpret_cast<BaseIsolate*>(isolate())->current_zone();
55 } 55 }
56 56
57 // The isolate that this thread is operating on, or NULL if none. 57 // The isolate that this thread is operating on, or NULL if none.
58 Isolate* isolate() const { return isolate_; } 58 Isolate* isolate() const { return isolate_; }
59 static intptr_t isolate_offset() {
60 return OFFSET_OF(Thread, isolate_);
61 }
59 62
60 // The (topmost) CHA for the compilation in the isolate of this thread. 63 // The (topmost) CHA for the compilation in the isolate of this thread.
61 // TODO(23153): Move this out of Isolate/Thread. 64 // TODO(23153): Move this out of Isolate/Thread.
62 CHA* cha() const; 65 CHA* cha() const;
63 void set_cha(CHA* value); 66 void set_cha(CHA* value);
64 67
65 private: 68 private:
66 static ThreadLocalKey thread_key_; 69 static ThreadLocalKey thread_key_;
67 70
68 Isolate* isolate_; 71 Isolate* isolate_;
69 72
70 Thread() 73 Thread()
71 : isolate_(NULL) {} 74 : isolate_(NULL) {}
72 75
73 static void SetCurrent(Thread* current); 76 static void SetCurrent(Thread* current);
74 77
75 DISALLOW_COPY_AND_ASSIGN(Thread); 78 DISALLOW_COPY_AND_ASSIGN(Thread);
76 }; 79 };
77 80
78 } // namespace dart 81 } // namespace dart
79 82
80 #endif // VM_THREAD_H_ 83 #endif // VM_THREAD_H_
OLDNEW
« runtime/vm/stub_code_ia32.cc ('K') | « runtime/vm/stub_code_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698