Chromium Code Reviews| Index: src/isolate.h |
| =================================================================== |
| --- src/isolate.h (revision 4781) |
| +++ src/isolate.h (working copy) |
| @@ -29,6 +29,7 @@ |
| #define V8_ISOLATE_H_ |
| #include "heap.h" |
| +#include "zone.h" |
| namespace v8 { |
| namespace internal { |
| @@ -37,6 +38,9 @@ |
| class Deserializer; |
| class StubCache; |
| +#define ISOLATE_INIT_LIST(V) \ |
| + V(bool, zone_allow_allocation, true) /* AssertNoZoneAllocation */ |
| + |
| class Isolate { |
| public: |
| // Returns the single global isolate. |
| @@ -51,17 +55,24 @@ |
| // Initialize process-wide state. |
| static void InitOnce(); |
| - |
| + |
| ~Isolate(); |
|
Vitaly Repeshko
2010/06/02 15:30:40
BTW, according to the style guide this should be t
|
| - |
| - // Accessors. |
| + |
| +#define GLOBAL_ACCESSOR(type, name, initialvalue) \ |
| + type name() const { return name##_; } \ |
| + void set_##name(type value) { name##_ = value; } |
| + ISOLATE_INIT_LIST(GLOBAL_ACCESSOR) |
| +#undef GLOBAL_ACCESSOR |
| + |
| + |
| Bootstrapper* bootstrapper() { return bootstrapper_; } |
| Heap* heap() { return &heap_; } |
| StubCache* stub_cache() { return stub_cache_; } |
| - |
| + Zone* zone() { return &zone_; } |
| + |
| private: |
| Isolate(); |
| - |
| + |
| static Isolate* global_isolate; |
| bool Init(Deserializer* des); |
| @@ -69,12 +80,20 @@ |
| Bootstrapper* bootstrapper_; |
| Heap heap_; |
| StubCache* stub_cache_; |
| + Zone zone_; |
| + |
| +#define GLOBAL_BACKING_STORE(type, name, initialvalue) \ |
| + type name##_; |
| + ISOLATE_INIT_LIST(GLOBAL_BACKING_STORE) |
| +#undef GLOBAL_BACKING_STORE |
| DISALLOW_COPY_AND_ASSIGN(Isolate); |
| }; |
| -// Temporary macros for accessing fields off the global isolate. |
| +// Temporary macros for accessing fields off the global isolate. Define these |
| +// when reformatting code would become burdensome. |
| #define HEAP (v8::internal::Isolate::Current()->heap()) |
| +#define ZONE (v8::internal::Isolate::Current()->zone()) |
| // Temporary macro to be used to flag definitions that are indeed static |
| @@ -82,6 +101,10 @@ |
| #define RLYSTC static |
| +// Temporary macro to be used to flag classes that should be static. |
| +#define STATIC_CLASS class |
|
Vitaly Repeshko
2010/06/02 15:30:40
Do we really need this?
|
| + |
| + |
| } } // namespace v8::internal |
| #endif // V8_ISOLATE_H_ |