V8 Project
js-builtin-reducer.h
Go to the documentation of this file.
1 // 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_BUILTIN_REDUCER_H_
6 #define V8_COMPILER_JS_BUILTIN_REDUCER_H_
7 
11 #include "src/compiler/node.h"
13 
14 namespace v8 {
15 namespace internal {
16 namespace compiler {
17 
18 class JSBuiltinReducer FINAL : public Reducer {
19  public:
20  explicit JSBuiltinReducer(JSGraph* jsgraph)
21  : jsgraph_(jsgraph), simplified_(jsgraph->zone()) {}
22  virtual ~JSBuiltinReducer() {}
23 
24  virtual Reduction Reduce(Node* node) OVERRIDE;
25 
26  private:
27  JSGraph* jsgraph() const { return jsgraph_; }
28  Graph* graph() const { return jsgraph_->graph(); }
29  CommonOperatorBuilder* common() const { return jsgraph_->common(); }
30  MachineOperatorBuilder* machine() const { return jsgraph_->machine(); }
31  SimplifiedOperatorBuilder* simplified() { return &simplified_; }
32 
33  Reduction ReduceMathAbs(Node* node);
34  Reduction ReduceMathSqrt(Node* node);
35  Reduction ReduceMathMax(Node* node);
36  Reduction ReduceMathImul(Node* node);
37  Reduction ReduceMathFround(Node* node);
38 
39  JSGraph* jsgraph_;
40  SimplifiedOperatorBuilder simplified_;
41 };
42 
43 } // namespace compiler
44 } // namespace internal
45 } // namespace v8
46 
47 #endif // V8_COMPILER_JS_BUILTIN_REDUCER_H_
SimplifiedOperatorBuilder * simplified()
MachineOperatorBuilder * machine() const
Reduction ReduceMathMax(Node *node)
SimplifiedOperatorBuilder simplified_
Reduction ReduceMathSqrt(Node *node)
Reduction ReduceMathImul(Node *node)
CommonOperatorBuilder * common() const
Reduction ReduceMathAbs(Node *node)
virtual Reduction Reduce(Node *node) OVERRIDE
Reduction ReduceMathFround(Node *node)
#define OVERRIDE
#define FINAL
Debugger support for the V8 JavaScript engine.
Definition: accessors.cc:20