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

Unified Diff: src/codegen.h

Issue 113455: Clean up the Result class. Reduce the size of Result from four words... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/codegen.cc » ('j') | src/ia32/codegen-ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codegen.h
===================================================================
--- src/codegen.h (revision 1960)
+++ src/codegen.h (working copy)
@@ -86,9 +86,27 @@
#include "arm/codegen-arm.h"
#endif
+#include "register-allocator.h"
+
namespace v8 { namespace internal {
+// Code generation can be nested. Code generation scopes form a stack
+// of active code generators.
+class CodeGeneratorScope BASE_EMBEDDED {
+ public:
+ explicit CodeGeneratorScope(CodeGenerator* cgen) {
+ previous = Result::cgen_;
Kevin Millikin (Chromium) 2009/05/15 10:50:49 Does the static top code generator belong to the R
Mads Ager (chromium) 2009/05/15 11:05:25 Good point. I moved it to the CodeGeneratorScope.
+ Result::cgen_ = cgen;
+ }
+ ~CodeGeneratorScope() {
+ Result::cgen_ = previous;
+ }
+ private:
+ CodeGenerator* previous;
+};
+
+
// Use lazy compilation; defaults to true.
// NOTE: Do not remove non-lazy compilation until we can properly
// install extensions with lazy compilation enabled. At the
« no previous file with comments | « no previous file | src/codegen.cc » ('j') | src/ia32/codegen-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698