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

Unified Diff: src/compiler/js-context-relaxation.h

Issue 1220823004: [turbofan]: Add a context relaxation Reducer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 5 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/js-context-relaxation.h
diff --git a/src/compiler/js-context-relaxation.h b/src/compiler/js-context-relaxation.h
new file mode 100644
index 0000000000000000000000000000000000000000..59e06be2c487abab762f9af26110ba23ec285ded
--- /dev/null
+++ b/src/compiler/js-context-relaxation.h
@@ -0,0 +1,40 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_COMPILER_JS_CONTEXT_RELAXATION_H_
+#define V8_COMPILER_JS_CONTEXT_RELAXATION_H_
+
+#include "src/code-factory.h"
+#include "src/compiler/graph-reducer.h"
+
+namespace v8 {
+namespace internal {
+namespace compiler {
+
+// Ensures that operations that only need to access the native context use the
+// outer-most context rather than the specific context given by the AST graph
+// builder. This makes it possible to use they operations with context
+// specialization (e.g. for generating stubs) without forcing inner contexts to
+// be embedded in generated code thus causing leaks.
+class JSContextRelaxation final : public Reducer {
+ public:
+ JSContextRelaxation(Node* start, Node* relaxed_context)
+ : start_(start),
+ relaxed_context_(relaxed_context),
+ context_is_wired_(false) {}
+ ~JSContextRelaxation() final{};
+
+ Reduction Reduce(Node* node) final;
+
+ private:
+ Node* start_;
+ Node* relaxed_context_;
+ bool context_is_wired_;
+};
+
+} // namespace compiler
+} // namespace internal
+} // namespace v8
+
+#endif // V8_COMPILER_JS_CONTEXT_RELAXATION_H_

Powered by Google App Engine
This is Rietveld 408576698