| OLD | NEW | 
|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #ifndef V8_COMPILER_JS_INTRINSIC_LOWERING_H_ | 5 #ifndef V8_COMPILER_JS_INTRINSIC_LOWERING_H_ | 
| 6 #define V8_COMPILER_JS_INTRINSIC_LOWERING_H_ | 6 #define V8_COMPILER_JS_INTRINSIC_LOWERING_H_ | 
| 7 | 7 | 
| 8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" | 
| 9 #include "src/compiler/graph-reducer.h" | 9 #include "src/compiler/graph-reducer.h" | 
| 10 #include "src/compiler/simplified-operator.h" | 10 #include "src/compiler/simplified-operator.h" | 
| 11 | 11 | 
| 12 namespace v8 { | 12 namespace v8 { | 
| 13 namespace internal { | 13 namespace internal { | 
| 14 namespace compiler { | 14 namespace compiler { | 
| 15 | 15 | 
| 16 // Forward declarations. | 16 // Forward declarations. | 
| 17 class CommonOperatorBuilder; | 17 class CommonOperatorBuilder; | 
| 18 class JSGraph; | 18 class JSGraph; | 
| 19 class MachineOperatorBuilder; | 19 class MachineOperatorBuilder; | 
| 20 | 20 | 
| 21 | 21 | 
| 22 // Lowers certain JS-level runtime calls. | 22 // Lowers certain JS-level runtime calls. | 
| 23 class JSIntrinsicLowering final : public AdvancedReducer { | 23 class JSIntrinsicLowering final : public AdvancedReducer { | 
| 24  public: | 24  public: | 
| 25   JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph); | 25   enum DeoptimizationMode { kDeoptimizationEnabled, kDeoptimizationDisabled }; | 
|  | 26 | 
|  | 27   JSIntrinsicLowering(Editor* editor, JSGraph* jsgraph, | 
|  | 28                       DeoptimizationMode mode); | 
| 26   ~JSIntrinsicLowering() final {} | 29   ~JSIntrinsicLowering() final {} | 
| 27 | 30 | 
| 28   Reduction Reduce(Node* node) final; | 31   Reduction Reduce(Node* node) final; | 
| 29 | 32 | 
| 30  private: | 33  private: | 
| 31   Reduction ReduceConstructDouble(Node* node); | 34   Reduction ReduceConstructDouble(Node* node); | 
| 32   Reduction ReduceDeoptimizeNow(Node* node); | 35   Reduction ReduceDeoptimizeNow(Node* node); | 
| 33   Reduction ReduceDoubleHi(Node* node); | 36   Reduction ReduceDoubleHi(Node* node); | 
| 34   Reduction ReduceDoubleLo(Node* node); | 37   Reduction ReduceDoubleLo(Node* node); | 
| 35   Reduction ReduceHeapObjectGetMap(Node* node); | 38   Reduction ReduceHeapObjectGetMap(Node* node); | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 53 | 56 | 
| 54   Reduction Change(Node* node, const Operator* op); | 57   Reduction Change(Node* node, const Operator* op); | 
| 55   Reduction Change(Node* node, const Operator* op, Node* a, Node* b); | 58   Reduction Change(Node* node, const Operator* op, Node* a, Node* b); | 
| 56   Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c); | 59   Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c); | 
| 57   Reduction ChangeToUndefined(Node* node, Node* effect = nullptr); | 60   Reduction ChangeToUndefined(Node* node, Node* effect = nullptr); | 
| 58 | 61 | 
| 59   Graph* graph() const; | 62   Graph* graph() const; | 
| 60   JSGraph* jsgraph() const { return jsgraph_; } | 63   JSGraph* jsgraph() const { return jsgraph_; } | 
| 61   CommonOperatorBuilder* common() const; | 64   CommonOperatorBuilder* common() const; | 
| 62   MachineOperatorBuilder* machine() const; | 65   MachineOperatorBuilder* machine() const; | 
|  | 66   DeoptimizationMode mode() const { return mode_; } | 
| 63   SimplifiedOperatorBuilder* simplified() { return &simplified_; } | 67   SimplifiedOperatorBuilder* simplified() { return &simplified_; } | 
| 64 | 68 | 
| 65   JSGraph* jsgraph_; | 69   JSGraph* const jsgraph_; | 
|  | 70   DeoptimizationMode const mode_; | 
| 66   SimplifiedOperatorBuilder simplified_; | 71   SimplifiedOperatorBuilder simplified_; | 
| 67 }; | 72 }; | 
| 68 | 73 | 
| 69 }  // namespace compiler | 74 }  // namespace compiler | 
| 70 }  // namespace internal | 75 }  // namespace internal | 
| 71 }  // namespace v8 | 76 }  // namespace v8 | 
| 72 | 77 | 
| 73 #endif  // V8_COMPILER_JS_INTRINSIC_LOWERING_H_ | 78 #endif  // V8_COMPILER_JS_INTRINSIC_LOWERING_H_ | 
| OLD | NEW | 
|---|