Chromium Code Reviews| Index: src/compiler.h |
| =================================================================== |
| --- src/compiler.h (revision 1947) |
| +++ src/compiler.h (working copy) |
| @@ -29,6 +29,8 @@ |
| #define V8_COMPILER_H_ |
| #include "parser.h" |
| +#include "zone.h" |
| +#include "frame-element.h" |
|
Kevin Millikin (Chromium)
2009/05/14 11:29:02
Is it OK to alphabetize these?
Mads Ager (chromium)
2009/05/14 11:42:40
It is. Done.
|
| namespace v8 { namespace internal { |
| @@ -69,6 +71,19 @@ |
| static bool CompileLazy(Handle<SharedFunctionInfo> shared, int loop_nesting); |
| }; |
| + |
| +// During compilation we need a global list of handles to constants |
| +// for frame elements. When the zone gets deleted, we make sure to |
| +// clear this list of handles as well. |
| +class CompilationZoneScope : public ZoneScope { |
| + public: |
| + CompilationZoneScope(ZoneScopeMode mode) : ZoneScope(mode) { }; |
| + virtual ~CompilationZoneScope() { |
| + if (ShouldDeleteOnExit()) FrameElement::ClearConstantList(); |
| + }; |
| +}; |
| + |
| + |
| } } // namespace v8::internal |
| #endif // V8_COMPILER_H_ |