Chromium Code Reviews| Index: src/compiler/context-relaxation.h |
| diff --git a/src/compiler/context-relaxation.h b/src/compiler/context-relaxation.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c5447eb3d14d8f9dcdaf615fe61c89a86dd3386c |
| --- /dev/null |
| +++ b/src/compiler/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_CONTEXT_RELAXATION_H_ |
| +#define V8_COMPILER_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. The makes it possible to use they operations with context |
|
Michael Starzinger
2015/07/02 10:29:26
nit: s/The/This/ and s/they/these/
|
| +// specialization (e.g. for generating stubs) without embedding forcing inner |
|
Michael Starzinger
2015/07/02 10:29:26
nit: s/embedding//
|
| +// contexts to be embedded in generated code thus causing leaks. |
| +class ContextRelaxation final : public Reducer { |
| + public: |
| + explicit ContextRelaxation(Node* start, Node* relaxed_context) |
|
Michael Starzinger
2015/07/02 10:29:26
nit: Doesn't need to be marked "explicit".
|
| + : start_(start), |
| + relaxed_context_(relaxed_context), |
| + context_is_wired_(false) {} |
| + ~ContextRelaxation() 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_CONTEXT_RELAXATION_H_ |