| 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/graph-reducer.h" | 8 #include "src/compiler/graph-reducer.h" |
| 9 #include "src/compiler/simplified-operator.h" | 9 #include "src/compiler/simplified-operator.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 namespace compiler { | 13 namespace compiler { |
| 14 | 14 |
| 15 // Forward declarations. | 15 // Forward declarations. |
| 16 class CommonOperatorBuilder; | 16 class CommonOperatorBuilder; |
| 17 class JSGraph; | 17 class JSGraph; |
| 18 class MachineOperatorBuilder; | 18 class MachineOperatorBuilder; |
| 19 | 19 |
| 20 | 20 |
| 21 // Lowers certain JS-level runtime calls. | 21 // Lowers certain JS-level runtime calls. |
| 22 class JSIntrinsicLowering FINAL : public Reducer { | 22 class JSIntrinsicLowering FINAL : public Reducer { |
| 23 public: | 23 public: |
| 24 explicit JSIntrinsicLowering(JSGraph* jsgraph); | 24 explicit JSIntrinsicLowering(JSGraph* jsgraph); |
| 25 ~JSIntrinsicLowering() FINAL {} | 25 ~JSIntrinsicLowering() FINAL {} |
| 26 | 26 |
| 27 Reduction Reduce(Node* node) FINAL; | 27 Reduction Reduce(Node* node) FINAL; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 Reduction ReduceInlineDeoptimizeNow(Node* node); | 30 Reduction ReduceConstructDouble(Node* node); |
| 31 Reduction ReduceInlineIsSmi(Node* node); | 31 Reduction ReduceDeoptimizeNow(Node* node); |
| 32 Reduction ReduceInlineIsNonNegativeSmi(Node* node); | 32 Reduction ReduceDoubleHi(Node* node); |
| 33 Reduction ReduceInlineIsInstanceType(Node* node, InstanceType instance_type); | 33 Reduction ReduceDoubleLo(Node* node); |
| 34 Reduction ReduceInlineJSValueGetValue(Node* node); | 34 Reduction ReduceHeapObjectGetMap(Node* node); |
| 35 Reduction ReduceInlineConstructDouble(Node* node); | 35 Reduction ReduceIsInstanceType(Node* node, InstanceType instance_type); |
| 36 Reduction ReduceInlineDoubleLo(Node* node); | 36 Reduction ReduceIsNonNegativeSmi(Node* node); |
| 37 Reduction ReduceInlineDoubleHi(Node* node); | 37 Reduction ReduceIsSmi(Node* node); |
| 38 Reduction ReduceInlineMathClz32(Node* node); | 38 Reduction ReduceJSValueGetValue(Node* node); |
| 39 Reduction ReduceInlineMathFloor(Node* node); | 39 Reduction ReduceMapGetInstanceType(Node* node); |
| 40 Reduction ReduceInlineMathSqrt(Node* node); | 40 Reduction ReduceMathClz32(Node* node); |
| 41 Reduction ReduceInlineStringGetLength(Node* node); | 41 Reduction ReduceMathFloor(Node* node); |
| 42 Reduction ReduceInlineValueOf(Node* node); | 42 Reduction ReduceMathSqrt(Node* node); |
| 43 Reduction ReduceStringGetLength(Node* node); |
| 44 Reduction ReduceValueOf(Node* node); |
| 43 | 45 |
| 44 Reduction Change(Node* node, const Operator* op); | 46 Reduction Change(Node* node, const Operator* op); |
| 45 Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c); | 47 Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c); |
| 46 | 48 |
| 47 Graph* graph() const; | 49 Graph* graph() const; |
| 48 JSGraph* jsgraph() const { return jsgraph_; } | 50 JSGraph* jsgraph() const { return jsgraph_; } |
| 49 CommonOperatorBuilder* common() const; | 51 CommonOperatorBuilder* common() const; |
| 50 MachineOperatorBuilder* machine() const; | 52 MachineOperatorBuilder* machine() const; |
| 51 SimplifiedOperatorBuilder* simplified() { return &simplified_; } | 53 SimplifiedOperatorBuilder* simplified() { return &simplified_; } |
| 52 | 54 |
| 53 JSGraph* jsgraph_; | 55 JSGraph* jsgraph_; |
| 54 SimplifiedOperatorBuilder simplified_; | 56 SimplifiedOperatorBuilder simplified_; |
| 55 }; | 57 }; |
| 56 | 58 |
| 57 } // namespace compiler | 59 } // namespace compiler |
| 58 } // namespace internal | 60 } // namespace internal |
| 59 } // namespace v8 | 61 } // namespace v8 |
| 60 | 62 |
| 61 #endif // V8_COMPILER_JS_INTRINSIC_LOWERING_H_ | 63 #endif // V8_COMPILER_JS_INTRINSIC_LOWERING_H_ |
| OLD | NEW |