blob: 4320e92391f973a6a7c9c50b6fe0aadee32a8c27 [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// Copyright 2014 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_COMPILER_JS_CONTEXT_RELAXATION_H_
6#define V8_COMPILER_JS_CONTEXT_RELAXATION_H_
7
8#include "src/compiler/graph-reducer.h"
9
10namespace v8 {
11namespace internal {
12namespace compiler {
13
14// Ensures that operations that only need to access the native context use the
15// outer-most context rather than the specific context given by the AST graph
16// builder. This makes it possible to use these operations with context
17// specialization (e.g. for generating stubs) without forcing inner contexts to
18// be embedded in generated code thus causing leaks and potentially using the
19// wrong native context (i.e. stubs are shared between native contexts).
20class JSContextRelaxation final : public Reducer {
21 public:
22 JSContextRelaxation() {}
23 ~JSContextRelaxation() final {}
24
25 Reduction Reduce(Node* node) final;
26};
27
28} // namespace compiler
29} // namespace internal
30} // namespace v8
31
32#endif // V8_COMPILER_JS_CONTEXT_RELAXATION_H_