1 // Copyright 2015 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_FRAME_SPECIALIZATION_H_
6 #define V8_COMPILER_JS_FRAME_SPECIALIZATION_H_
7 
8 #include "src/compiler/graph-reducer.h"
9 
10 namespace v8 {
11 namespace internal {
12 
13 // Forward declarations.
14 class JavaScriptFrame;
15 
16 namespace compiler {
17 
18 // Forward declarations.
19 class JSGraph;
20 
21 
22 class JSFrameSpecialization final : public Reducer {
23  public:
JSFrameSpecialization(JavaScriptFrame const * frame,JSGraph * jsgraph)24   JSFrameSpecialization(JavaScriptFrame const* frame, JSGraph* jsgraph)
25       : frame_(frame), jsgraph_(jsgraph) {}
~JSFrameSpecialization()26   ~JSFrameSpecialization() final {}
27 
28   Reduction Reduce(Node* node) final;
29 
30  private:
31   Reduction ReduceOsrValue(Node* node);
32   Reduction ReduceParameter(Node* node);
33 
34   Isolate* isolate() const;
frame()35   JavaScriptFrame const* frame() const { return frame_; }
jsgraph()36   JSGraph* jsgraph() const { return jsgraph_; }
37 
38   JavaScriptFrame const* const frame_;
39   JSGraph* const jsgraph_;
40 
41   DISALLOW_COPY_AND_ASSIGN(JSFrameSpecialization);
42 };
43 
44 }  // namespace compiler
45 }  // namespace internal
46 }  // namespace v8
47 
48 #endif  // V8_COMPILER_JS_FRAME_SPECIALIZATION_H_
49