js-builtin-reducer.h revision 014dc512cdd3e367bee49a713fdc5ed92584a3e5
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 8#include "src/compiler/graph-reducer.h" 9 10namespace v8 { 11namespace internal { 12namespace compiler { 13 14// Forward declarations. 15class CommonOperatorBuilder; 16class JSGraph; 17class MachineOperatorBuilder; 18class SimplifiedOperatorBuilder; 19 20 21class JSBuiltinReducer final : public AdvancedReducer { 22 public: 23 explicit JSBuiltinReducer(Editor* editor, JSGraph* jsgraph); 24 ~JSBuiltinReducer() final {} 25 26 Reduction Reduce(Node* node) final; 27 28 private: 29 Reduction ReduceFunctionCall(Node* node); 30 Reduction ReduceMathMax(Node* node); 31 Reduction ReduceMathImul(Node* node); 32 Reduction ReduceMathFround(Node* node); 33 34 Graph* graph() const; 35 JSGraph* jsgraph() const { return jsgraph_; } 36 Isolate* isolate() const; 37 CommonOperatorBuilder* common() const; 38 MachineOperatorBuilder* machine() const; 39 SimplifiedOperatorBuilder* simplified() const; 40 41 JSGraph* jsgraph_; 42}; 43 44} // namespace compiler 45} // namespace internal 46} // namespace v8 47 48#endif // V8_COMPILER_JS_BUILTIN_REDUCER_H_ 49