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

Side by Side Diff: src/isolate.h

Issue 2593001: [Isolates] Make lint happy. (Closed)
Patch Set: Created 10 years, 6 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 | « src/heap.h ('k') | src/zone.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 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Returns the single global isolate. 49 // Returns the single global isolate.
50 static Isolate* Current() { 50 static Isolate* Current() {
51 ASSERT(global_isolate != NULL); 51 ASSERT(global_isolate != NULL);
52 return global_isolate; 52 return global_isolate;
53 } 53 }
54 54
55 // Creates a new isolate (perhaps using a deserializer). Returns null 55 // Creates a new isolate (perhaps using a deserializer). Returns null
56 // on failure. 56 // on failure.
57 static Isolate* Create(Deserializer* des); 57 static Isolate* Create(Deserializer* des);
58 58
59 // Initialize process-wide state. 59 // Initialize process-wide state.
60 static void InitOnce(); 60 static void InitOnce();
61 61
62 #define GLOBAL_ACCESSOR(type, name, initialvalue) \ 62 #define GLOBAL_ACCESSOR(type, name, initialvalue) \
63 type name() const { return name##_; } \ 63 type name() const { return name##_; } \
64 void set_##name(type value) { name##_ = value; } 64 void set_##name(type value) { name##_ = value; }
65 ISOLATE_INIT_LIST(GLOBAL_ACCESSOR) 65 ISOLATE_INIT_LIST(GLOBAL_ACCESSOR)
66 #undef GLOBAL_ACCESSOR 66 #undef GLOBAL_ACCESSOR
67 67
68 68
69 Bootstrapper* bootstrapper() { return bootstrapper_; } 69 Bootstrapper* bootstrapper() { return bootstrapper_; }
70 Heap* heap() { return &heap_; } 70 Heap* heap() { return &heap_; }
71 StubCache* stub_cache() { return stub_cache_; } 71 StubCache* stub_cache() { return stub_cache_; }
72 v8::ImplementationUtilities::HandleScopeData* handle_scope_data() { 72 v8::ImplementationUtilities::HandleScopeData* handle_scope_data() {
73 return &handle_scope_data_; 73 return &handle_scope_data_;
74 } 74 }
75 Zone* zone() { return &zone_; } 75 Zone* zone() { return &zone_; }
76 76
77 private: 77 private:
78 Isolate(); 78 Isolate();
79 79
80 static Isolate* global_isolate; 80 static Isolate* global_isolate;
81 81
82 bool Init(Deserializer* des); 82 bool Init(Deserializer* des);
83 83
84 Bootstrapper* bootstrapper_; 84 Bootstrapper* bootstrapper_;
85 Heap heap_; 85 Heap heap_;
86 StubCache* stub_cache_; 86 StubCache* stub_cache_;
87 v8::ImplementationUtilities::HandleScopeData handle_scope_data_; 87 v8::ImplementationUtilities::HandleScopeData handle_scope_data_;
88 Zone zone_; 88 Zone zone_;
89 89
90 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \ 90 #define GLOBAL_BACKING_STORE(type, name, initialvalue) \
91 type name##_; 91 type name##_;
92 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE) 92 ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE)
93 #undef GLOBAL_BACKING_STORE 93 #undef GLOBAL_BACKING_STORE
94 94
95 DISALLOW_COPY_AND_ASSIGN(Isolate); 95 DISALLOW_COPY_AND_ASSIGN(Isolate);
96 }; 96 };
97 97
98 // Temporary macros for accessing fields off the global isolate. Define these 98 // Temporary macros for accessing fields off the global isolate. Define these
99 // when reformatting code would become burdensome. 99 // when reformatting code would become burdensome.
100 #define HEAP (v8::internal::Isolate::Current()->heap()) 100 #define HEAP (v8::internal::Isolate::Current()->heap())
101 #define ZONE (v8::internal::Isolate::Current()->zone()) 101 #define ZONE (v8::internal::Isolate::Current()->zone())
102 102
103 103
104 // Temporary macro to be used to flag definitions that are indeed static 104 // Temporary macro to be used to flag definitions that are indeed static
105 // and not per-isolate. (It would be great to be able to grep for [static]!) 105 // and not per-isolate. (It would be great to be able to grep for [static]!)
106 #define RLYSTC static 106 #define RLYSTC static
107 107
108 108
109 // Temporary macro to be used to flag classes that should be static. 109 // Temporary macro to be used to flag classes that should be static.
110 #define STATIC_CLASS class 110 #define STATIC_CLASS class
111 111
112 112
113 } } // namespace v8::internal 113 } } // namespace v8::internal
114 114
115 #endif // V8_ISOLATE_H_ 115 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/zone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698